diff options
author | 2022-05-26 15:00:46 +0800 | |
---|---|---|
committer | 2022-06-01 12:33:48 +0800 | |
commit | 8f7e68c0f4b00f88aa0b8305aaa3ddc9ddfc1c29 (patch) | |
tree | f842934288be4dced2eac217abcceb4c7c2877f0 /services/robotests/src | |
parent | 6d8dfd00779cf98fa94b560663664e5ee8bad23b (diff) |
Fix cross user package visibility leakage for getAppOpPermissionPackages
To fix cross user package visibility leakage, this CL filters out
packages that aren't installed in the calling user before the API
returns results to the caller.
Also adding a user id parameter to the API for the system modules to
specify the correct user id when querying the appop permission packages.
NoNonSdkCheck: Keep @UnsupportedAppUsage for new signature api
Bug: 229684723
Test: atest CrossUserPackageVisibilityTests
Change-Id: I9d3de91b0195d3396d2737673cb23ef899e23467
Diffstat (limited to 'services/robotests/src')
-rw-r--r-- | services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java b/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java index 5dc048b9d7c6..df1d244ab879 100644 --- a/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java +++ b/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java @@ -171,7 +171,7 @@ public class CrossProfileAppsServiceImplRoboTest { private void mockCrossProfileAppRequestsInteractAcrossProfiles() throws Exception { final String permissionName = Manifest.permission.INTERACT_ACROSS_PROFILES; - when(mIPackageManager.getAppOpPermissionPackages(permissionName)) + when(mIPackageManager.getAppOpPermissionPackages(eq(permissionName), anyInt())) .thenReturn(new String[] {CROSS_PROFILE_APP_PACKAGE_NAME}); } @@ -488,7 +488,7 @@ public class CrossProfileAppsServiceImplRoboTest { private void mockCrossProfileAppDoesNotRequestInteractAcrossProfiles() throws Exception { final String permissionName = Manifest.permission.INTERACT_ACROSS_PROFILES; - when(mIPackageManager.getAppOpPermissionPackages(permissionName)) + when(mIPackageManager.getAppOpPermissionPackages(eq(permissionName), anyInt())) .thenReturn(new String[] {}); } |