Merge cherrypicks of [3907239, 3907816] into pi-release

Change-Id: I90cbf2491df8c8606b9744aa732647ec26d3bddc
This commit is contained in:
android-build-team Robot
2018-04-16 20:14:42 +00:00

View File

@@ -176,7 +176,7 @@ public class NetworkStatsAccessTest {
}
private void setHasAppOpsPermission(int appOpsMode, boolean hasPermission) {
when(mAppOps.noteOp(AppOpsManager.OP_GET_USAGE_STATS, TEST_UID, TEST_PKG))
when(mAppOps.checkOp(AppOpsManager.OP_GET_USAGE_STATS, TEST_UID, TEST_PKG))
.thenReturn(appOpsMode);
when(mContext.checkCallingPermission(Manifest.permission.PACKAGE_USAGE_STATS)).thenReturn(
hasPermission ? PackageManager.PERMISSION_GRANTED