From 930aeb0c00a40369cab2793353208095eb40e438 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 13 Apr 2018 13:29:59 -0600 Subject: [PATCH] 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 --- .../core/java/com/android/server/net/NetworkStatsAccess.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/net/NetworkStatsAccess.java b/services/core/java/com/android/server/net/NetworkStatsAccess.java index 98fe770774..cebc472178 100644 --- a/services/core/java/com/android/server/net/NetworkStatsAccess.java +++ b/services/core/java/com/android/server/net/NetworkStatsAccess.java @@ -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