Merge "Support local disconnect of empty IMS Conference." into rvc-dev
diff --git a/tests/src/com/android/phone/LocationAccessPolicyTest.java b/tests/src/com/android/phone/LocationAccessPolicyTest.java
index 2061f38..b2489e7 100644
--- a/tests/src/com/android/phone/LocationAccessPolicyTest.java
+++ b/tests/src/com/android/phone/LocationAccessPolicyTest.java
@@ -147,6 +147,9 @@
}
}
+ private static final int TESTING_UID = 10001;
+ private static final int TESTING_PID = 8009;
+
@Mock Context mContext;
@Mock AppOpsManager mAppOpsManager;
@Mock LocationManager mLocationManager;
@@ -195,15 +198,18 @@
anyInt(), anyString(), nullable(String.class), nullable(String.class)))
.thenReturn(s.coarseAppOp);
+ // set this permission to denied by default, and only allow for the proper pid/uid
+ // combination
+ when(mContext.checkPermission(eq(Manifest.permission.INTERACT_ACROSS_USERS_FULL),
+ anyInt(), anyInt())).thenReturn(PackageManager.PERMISSION_DENIED);
if (s.isDynamicLocationEnabled) {
when(mLocationManager.isLocationEnabledForUser(any(UserHandle.class))).thenReturn(true);
when(mContext.checkPermission(eq(Manifest.permission.INTERACT_ACROSS_USERS_FULL),
- anyInt(), anyInt())).thenReturn(PackageManager.PERMISSION_GRANTED);
+ eq(TESTING_PID), eq(TESTING_UID)))
+ .thenReturn(PackageManager.PERMISSION_GRANTED);
} else {
when(mLocationManager.isLocationEnabledForUser(any(UserHandle.class)))
.thenReturn(false);
- when(mContext.checkPermission(eq(Manifest.permission.INTERACT_ACROSS_USERS_FULL),
- anyInt(), anyInt())).thenReturn(PackageManager.PERMISSION_DENIED);
}
ApplicationInfo fakeAppInfo = new ApplicationInfo();
@@ -222,8 +228,8 @@
.setMethod("test")
.setCallingPackage("com.android.test")
.setCallingFeatureId(null)
- .setCallingPid(10001)
- .setCallingUid(10001);
+ .setCallingPid(TESTING_PID)
+ .setCallingUid(TESTING_UID);
}
@Parameterized.Parameters(name = "{0}")