OP_GET_USAGE_STATS should be noted, not checked.
Per email feedback, we should be using "noteOp" instead of "checkOp" when testing if caller holds OP_GET_USAGE_STATS, so that we record that caller used the operation. Bug: 77662908 Test: builds, boots Exempt-From-Owner-Approval: keep tests passing Change-Id: I3a60345d590534fdbc2c1248e0d30dc85a5d6772
This commit is contained in:
committed by
Jeff Sharkey
parent
3d55d4c02e
commit
930aeb0c00
@@ -174,7 +174,7 @@ public final class NetworkStatsAccess {
|
||||
AppOpsManager appOps = (AppOpsManager) context.getSystemService(
|
||||
Context.APP_OPS_SERVICE);
|
||||
|
||||
final int mode = appOps.checkOp(AppOpsManager.OP_GET_USAGE_STATS,
|
||||
final int mode = appOps.noteOp(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
|
||||
|
||||
Reference in New Issue
Block a user