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

Commit a6ea005a authored by Winson Chung's avatar Winson Chung
Browse files

Ensure we clear binder calling uid prior to removing pinned stacks.

Bug: 73311253
Test: Enter PiP, try to pin fullscreen app
Change-Id: Ide1f48d4ab32cbb5ddc51ba1e9e3aa5e66a76d20
parent 581576ef
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -11362,9 +11362,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            throw new IllegalArgumentException("Invalid task, not in foreground");
        }
        // When a task is locked, dismiss the pinned stack if it exists
        mStackSupervisor.removeStacksInWindowingModes(WINDOWING_MODE_PINNED);
        // {@code isSystemCaller} is used to distinguish whether this request is initiated by the
        // system or a specific app.
        // * System-initiated requests will only start the pinned mode (screen pinning)
@@ -11374,6 +11371,9 @@ public class ActivityManagerService extends IActivityManager.Stub
        final int callingUid = Binder.getCallingUid();
        long ident = Binder.clearCallingIdentity();
        try {
            // When a task is locked, dismiss the pinned stack if it exists
            mStackSupervisor.removeStacksInWindowingModes(WINDOWING_MODE_PINNED);
            mLockTaskController.startLockTaskMode(task, isSystemCaller, callingUid);
        } finally {
            Binder.restoreCallingIdentity(ident);