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

Commit 04652379 authored by Bryce Lee's avatar Bryce Lee Committed by android-build-merger
Browse files

Merge "Clear calling UID before resolving intent types." into pi-dev

am: c16de056

Change-Id: Idf837123922d43c612d24eadc08cfaa7a307e408
parents a4bc10ab c16de056
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -25932,16 +25932,19 @@ public class ActivityManagerService extends IActivityManager.Stub
                Bundle bOptions) {
            Preconditions.checkNotNull(intents, "intents");
            final String[] resolvedTypes = new String[intents.length];
            for (int i = 0; i < intents.length; i++) {
                resolvedTypes[i] = intents[i].resolveTypeIfNeeded(mContext.getContentResolver());
            }
            // UID of the package on user userId.
            // "= 0" is needed because otherwise catch(RemoteException) would make it look like
            // packageUid may not be initialized.
            int packageUid = 0;
            final long ident = Binder.clearCallingIdentity();
            try {
                for (int i = 0; i < intents.length; i++) {
                    resolvedTypes[i] =
                            intents[i].resolveTypeIfNeeded(mContext.getContentResolver());
                }
                packageUid = AppGlobals.getPackageManager().getPackageUid(
                        packageName, PackageManager.MATCH_DEBUG_TRIAGED_MISSING, userId);
            } catch (RemoteException e) {