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

Commit 6ac9efd3 authored by Alan Stokes's avatar Alan Stokes
Browse files

Revert "Don't allow PI-based starts and trampolines when sender"

This partially reverts commit
2927b542.

Reason for revert: Breaks legitimate uses (b/131862922)

The changes to handle TYPE_APPLICATION_STARTING are not being reverted
(RootWindowContainer and RootWindowContainerTests); they're unrelated.

Bug: 131862922
Bug: 129563343
Test: atest BackgroundActivityLaunchTest
Test: atest RootWindowContainerTests
Test: atest WmTests:ActivityStarterTests
Test: atest CtsWindowManagerDeviceTestCases:ActivityStarterTests
Test: atest CtsAppTestCases:.ServiceTest

Change-Id: Ib86b7cbff97ce3154c7e3ce7b3c7e46b33c575fe
parent 07b0f138
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.content.Intent;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.TransactionTooLargeException;
@@ -388,9 +387,8 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
                userId = controller.mUserController.getCurrentOrTargetUserId();
            }
            // temporarily allow receivers and services to open activities from background if the
            // PendingIntent.send() caller was foreground at the time of sendInner() call, unless
            // caller is SYSTEM_UID
            final boolean allowTrampoline = uid != callingUid && callingUid != Process.SYSTEM_UID
            // PendingIntent.send() caller was foreground at the time of sendInner() call
            final boolean allowTrampoline = uid != callingUid
                    && controller.mAtmInternal.isUidForeground(callingUid);

            // note: we on purpose don't pass in the information about the PendingIntent's creator,
+2 −3
Original line number Diff line number Diff line
@@ -976,9 +976,8 @@ class ActivityStarter {
                : (realCallingAppId == Process.SYSTEM_UID)
                        || realCallingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI;
        if (realCallingUid != callingUid) {
            // don't abort if the realCallingUid has a visible window, unless realCallingUid is
            // SYSTEM_UID, in which case it start needs to be explicitly whitelisted
            if (realCallingUidHasAnyVisibleWindow && realCallingAppId != Process.SYSTEM_UID) {
            // don't abort if the realCallingUid has a visible window
            if (realCallingUidHasAnyVisibleWindow) {
                return false;
            }
            // if the realCallingUid is a persistent system process, abort if the IntentSender