Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a1fc6f4 authored by Rhed Jao's avatar Rhed Jao Committed by Android (Google) Code Review
Browse files

Merge changes I48ead977,I4ad68be5

* changes:
  Fix incorrect usage of the isInstantApp
  Fix package usage of instant app can be updated by unprivileged app
parents 459391a8 048c09f3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -798,7 +798,8 @@ public class ComputerEngine implements Computer {
        for (int n = 0; n < count; n++) {
            ResolveInfo info = candidates.get(n);
            if (blockInstant && (info.isInstantAppAvailable
                    || isInstantApp(info.activityInfo.packageName, userId))) {
                    || isInstantAppInternal(info.activityInfo.packageName, userId,
                            Process.SYSTEM_UID))) {
                continue;
            }

@@ -1075,7 +1076,8 @@ public class ComputerEngine implements Computer {
                    resolveInfos.remove(i);
                    continue;
                }
                if (blockInstant && isInstantApp(info.activityInfo.packageName, userId)) {
                if (blockInstant && isInstantAppInternal(
                        info.activityInfo.packageName, userId, Process.SYSTEM_UID)) {
                    resolveInfos.remove(i);
                    continue;
                }
+7 −5
Original line number Diff line number Diff line
@@ -4875,7 +4875,7 @@ public class PackageManagerService extends IPackageManager.Stub
                    return;
                }
            } else {
                if (isInstantApp(packageName, callingUserId)) {
                if (isInstantAppInternal(packageName, callingUserId, Process.SYSTEM_UID)) {
                    return;
                }
            }
@@ -4982,7 +4982,8 @@ public class PackageManagerService extends IPackageManager.Stub
    public void reconcileSecondaryDexFiles(String packageName) {
        if (getInstantAppPackageName(Binder.getCallingUid()) != null) {
            return;
        } else if (isInstantApp(packageName, UserHandle.getCallingUserId())) {
        } else if (isInstantAppInternal(
                packageName, UserHandle.getCallingUserId(), Process.SYSTEM_UID)) {
            return;
        }
        mDexManager.reconcileSecondaryDexFiles(packageName);
@@ -6597,7 +6598,8 @@ public class PackageManagerService extends IPackageManager.Stub
            if (DEBUG_BACKUP) {
                Slog.i(TAG, "Package " + packageName + " sending normal FIRST_LAUNCH");
            }
            final boolean isInstantApp = isInstantApp(packageName, userId);
            final boolean isInstantApp = isInstantAppInternal(
                    packageName, userId, Process.SYSTEM_UID);
            final int[] userIds = isInstantApp ? EMPTY_INT_ARRAY : new int[] { userId };
            final int[] instantUserIds = isInstantApp ? new int[] { userId } : EMPTY_INT_ARRAY;
            mBroadcastHelper.sendFirstLaunchBroadcast(
@@ -7992,7 +7994,7 @@ public class PackageManagerService extends IPackageManager.Stub
    void sendPackageChangedBroadcast(String packageName,
            boolean dontKillApp, ArrayList<String> componentNames, int packageUid, String reason) {
        final int userId = UserHandle.getUserId(packageUid);
        final boolean isInstantApp = isInstantApp(packageName, userId);
        final boolean isInstantApp = isInstantAppInternal(packageName, userId, Process.SYSTEM_UID);
        final int[] userIds = isInstantApp ? EMPTY_INT_ARRAY : new int[] { userId };
        final int[] instantUserIds = isInstantApp ? new int[] { userId } : EMPTY_INT_ARRAY;
        final SparseArray<int[]> broadcastAllowList = getBroadcastAllowList(
@@ -10340,7 +10342,7 @@ public class PackageManagerService extends IPackageManager.Stub
            throw new SecurityException(
                    "Caller uid " + callingUid + " does not own package " + packageName);
        }
        if (isInstantAppInternal(packageName, userId, callingUid)) {
        if (isInstantAppInternal(packageName, userId, Process.SYSTEM_UID)) {
            return false;
        }
        final AndroidPackage pkg;