Allow the system recents component to fetch info for user and profiles

- The recents component may need to fetch application info for the current
  user and its profiles.

Bug: 109660818
Test: atest CtsAppSecurityHostTestCases:ApplicationVisibilityTest
Change-Id: I7017d40fd2a7ac0d4f288bec21a4bc5cd93c446e
This commit is contained in:
Winson Chung
2018-06-04 15:31:54 -07:00
parent dbc6052022
commit dc0dd24287

View File

@@ -4789,7 +4789,8 @@ public class PackageManagerService extends IPackageManager.Stub
// require the permission to be held; the calling uid and given user id referring
// to the same user is not sufficient
mPermissionManager.enforceCrossUserPermission(
Binder.getCallingUid(), userId, false, false, true,
Binder.getCallingUid(), userId, false, false,
!isRecentsAccessingChildProfiles(Binder.getCallingUid(), userId),
"MATCH_ANY_USER flag requires INTERACT_ACROSS_USERS permission at "
+ Debug.getCallers(5));
} else if ((flags & PackageManager.MATCH_UNINSTALLED_PACKAGES) != 0 && isCallerSystemUser