Merge "Expose isInstantApp() to more callers"

This commit is contained in:
TreeHugger Robot
2017-03-01 16:58:33 +00:00
committed by Android (Google) Code Review

View File

@@ -7312,12 +7312,17 @@ public class PackageManagerService extends IPackageManager.Stub {
return false;
}
if (!isCallerSameApp(packageName)) {
return false;
}
synchronized (mPackages) {
final PackageSetting ps = mSettings.mPackages.get(packageName);
if (ps != null) {
final boolean returnAllowed =
ps != null
&& (isCallerSameApp(packageName)
|| mContext.checkCallingOrSelfPermission(
android.Manifest.permission.ACCESS_INSTANT_APPS)
== PERMISSION_GRANTED
|| mInstantAppRegistry.isInstantAccessGranted(
userId, UserHandle.getAppId(Binder.getCallingUid()), ps.appId));
if (returnAllowed) {
return ps.getInstantApp(userId);
}
}