Allow the launcher to get all instant apps

Change-Id: Ie0381d01fe8cd5293a0a3671c1bdf497ca5c5783
Fixes: 63814920
Test: Manual
Test: Make and install a launcher that calls the protected APIs
Test: Run launcher, see that it gets a security exception
Test: Make the launcher the default, see that it gets a security exception
Test: Install the launcher as a system app
Test: Run the launcher, see that it gets a security exception
Test: Make the launcher the default, see that the API works
This commit is contained in:
Todd Kennedy
2017-07-28 07:31:51 -07:00
parent b3d487da64
commit c7df7d7dcb

View File

@@ -8282,8 +8282,10 @@ public class PackageManagerService extends IPackageManager.Stub
if (HIDE_EPHEMERAL_APIS || isEphemeralDisabled()) {
return null;
}
mContext.enforceCallingOrSelfPermission(Manifest.permission.ACCESS_INSTANT_APPS,
"getEphemeralApplications");
if (!canViewInstantApps(Binder.getCallingUid(), userId)) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.ACCESS_INSTANT_APPS,
"getEphemeralApplications");
}
enforceCrossUserPermission(Binder.getCallingUid(), userId,
true /* requireFullPermission */, false /* checkShell */,
"getEphemeralApplications");
@@ -8368,9 +8370,10 @@ public class PackageManagerService extends IPackageManager.Stub
return null;
}
mContext.enforceCallingOrSelfPermission(Manifest.permission.ACCESS_INSTANT_APPS,
"getInstantAppIcon");
if (!canViewInstantApps(Binder.getCallingUid(), userId)) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.ACCESS_INSTANT_APPS,
"getInstantAppIcon");
}
enforceCrossUserPermission(Binder.getCallingUid(), userId,
true /* requireFullPermission */, false /* checkShell */,
"getInstantAppIcon");