Merge "[MS25.2] Remove AppOpsManager.OP_GET_USAGE_STATS dependency"

This commit is contained in:
Treehugger Robot 2022-01-03 22:41:30 +00:00 • committed by Gerrit Code Review
commit 90cf8dbd92

View file

@ -165,8 +165,8 @@ public class NetworkStatsAccessTest {
}
private void setHasAppOpsPermission(int appOpsMode, boolean hasPermission) {
when(mAppOps.noteOp(AppOpsManager.OP_GET_USAGE_STATS, TEST_UID, TEST_PKG))
.thenReturn(appOpsMode);
when(mAppOps.noteOp(AppOpsManager.OPSTR_GET_USAGE_STATS, TEST_UID, TEST_PKG,
null /* attributionTag */, null /* message */)).thenReturn(appOpsMode);
when(mContext.checkCallingPermission(Manifest.permission.PACKAGE_USAGE_STATS)).thenReturn(
hasPermission ? PackageManager.PERMISSION_GRANTED
: PackageManager.PERMISSION_DENIED);