Merge "[MS25.2] Remove AppOpsManager.OP_GET_USAGE_STATS dependency"
This commit is contained in:
@@ -165,8 +165,8 @@ public class NetworkStatsAccessTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setHasAppOpsPermission(int appOpsMode, boolean hasPermission) {
|
private void setHasAppOpsPermission(int appOpsMode, boolean hasPermission) {
|
||||||
when(mAppOps.noteOp(AppOpsManager.OP_GET_USAGE_STATS, TEST_UID, TEST_PKG))
|
when(mAppOps.noteOp(AppOpsManager.OPSTR_GET_USAGE_STATS, TEST_UID, TEST_PKG,
|
||||||
.thenReturn(appOpsMode);
|
null /* attributionTag */, null /* message */)).thenReturn(appOpsMode);
|
||||||
when(mContext.checkCallingPermission(Manifest.permission.PACKAGE_USAGE_STATS)).thenReturn(
|
when(mContext.checkCallingPermission(Manifest.permission.PACKAGE_USAGE_STATS)).thenReturn(
|
||||||
hasPermission ? PackageManager.PERMISSION_GRANTED
|
hasPermission ? PackageManager.PERMISSION_GRANTED
|
||||||
: PackageManager.PERMISSION_DENIED);
|
: PackageManager.PERMISSION_DENIED);
|
||||||
|
|||||||
Reference in New Issue
Block a user