summaryrefslogtreecommitdiff
path: root/services/robotests
diff options
context:
space:
mode:
authorkholoud mohamed <kholoudm@google.com>2020-01-15 15:30:07 +0000
committerkholoud mohamed <kholoudm@google.com>2020-01-21 14:28:46 +0000
commit79a89f022d4e2f372b048b36e056fbaf496e3874 (patch)
tree881a9192474cef85a7ac2505682c874b4b034465 /services/robotests
parent30bf54729bfd2daf21eda0550f1d774f976e2fb0 (diff)
Add a checks for _ACROSS_PROFILES apppop or permission.
Use hasPermissionOrAppOpForPreflight to check for INTERACT_ACROSS_PROFILES permission or appop rather than only checking for the permission. BUG: 140728653 BUG: 136249261 Test: atest CrossProfileAppsPermissionHostSideTest Test: atest CrossProfileAppsHostSideTest Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest Test: atest ContextCrossProfileHostTest Change-Id: I81d428d47afd54f294ef9bb44133004762840d09
Diffstat (limited to 'services/robotests')
-rw-r--r--services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java b/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java
index ce0886435906..96ff9c1ba726 100644
--- a/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java
+++ b/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java
@@ -79,6 +79,7 @@ import java.util.Set;
@Config(shadows = {ShadowUserManager.class, ShadowApplicationPackageManager.class})
public class CrossProfileAppsServiceImplRoboTest {
private static final int CALLING_UID = 1111;
+ private static final int CALLING_PID = 1000;
private static final String CROSS_PROFILE_APP_PACKAGE_NAME =
"com.android.server.pm.crossprofileappsserviceimplrobotest.crossprofileapp";
private static final int PERSONAL_PROFILE_USER_ID = 0;
@@ -383,6 +384,11 @@ public class CrossProfileAppsServiceImplRoboTest {
}
@Override
+ public int getCallingPid() {
+ return CALLING_PID;
+ }
+
+ @Override
public @UserIdInt int getCallingUserId() {
return PERSONAL_PROFILE_USER_ID;
}