Merge cherrypicks of [3907239, 3907816] into pi-release

Change-Id: I90cbf2491df8c8606b9744aa732647ec26d3bddc
This commit is contained in:
android-build-team Robot
2018-04-16 20:14:42 +00:00

View File

@@ -174,7 +174,7 @@ public final class NetworkStatsAccess {
AppOpsManager appOps = (AppOpsManager) context.getSystemService(
Context.APP_OPS_SERVICE);
final int mode = appOps.noteOp(AppOpsManager.OP_GET_USAGE_STATS,
final int mode = appOps.checkOp(AppOpsManager.OP_GET_USAGE_STATS,
callingUid, callingPackage);
if (mode == AppOpsManager.MODE_DEFAULT) {
// The default behavior here is to check if PackageManager has given the app