Merge changes from topics "ms25-appops", "ms28-service-fix"

* changes:
  [MS25.1] Remove AppOpsManager.OP_GET_USAGE_STATS dependency
  [MS28.1] Fix several hidden API dependencies
This commit is contained in:
Treehugger Robot
2022-01-03 22:41:07 +00:00
committed by Gerrit Code Review
5 changed files with 55 additions and 53 deletions

View File

@@ -192,8 +192,8 @@ public final class NetworkStatsAccess {
AppOpsManager appOps = (AppOpsManager) context.getSystemService(
Context.APP_OPS_SERVICE);
final int mode = appOps.noteOp(AppOpsManager.OP_GET_USAGE_STATS,
callingUid, callingPackage);
final int mode = appOps.noteOp(AppOpsManager.OPSTR_GET_USAGE_STATS,
callingUid, callingPackage, null /* attributionTag */, null /* message */);
if (mode == AppOpsManager.MODE_DEFAULT) {
// The default behavior here is to check if PackageManager has given the app
// permission.