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

Commit e8b10e39 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Correct synchronized object of pinned stack

Also check for whether the stack is detached in extreme cases
because the synchronized scope is not a continuous block in
the callback of animator.

Bug: 118816763
Test: atest ActivityManagerPinnedStackTests# \
      testRemovePipWithVisibleFullscreenStack

Change-Id: I12d4d507fe08b3bd34eed2b00ac531c2cbb2b561
parent 4353cd61
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -97,7 +97,10 @@ class PinnedActivityStack extends ActivityStack<PinnedStackWindowController>
        // It is guaranteed that the activities requiring the update will be in the pinned stack at
        // this point (either reparented before the animation into PiP, or before reparenting after
        // the animation out of PiP)
        synchronized (mService) {
        synchronized (mService.mGlobalLock) {
            if (!isAttached()) {
                return;
            }
            ArrayList<TaskRecord> tasks = getAllTasks();
            for (int i = 0; i < tasks.size(); i++ ) {
                mStackSupervisor.updatePictureInPictureMode(tasks.get(i), targetStackBounds,
+5 −0
Original line number Diff line number Diff line
@@ -1765,6 +1765,11 @@ public class TaskStack extends WindowContainer<Task> implements
    @Override
    public boolean shouldDeferStartOnMoveToFullscreen() {
        synchronized (mService.mGlobalLock) {
            if (!isAttached()) {
                // Unnecessary to pause the animation because the stack is detached.
                return false;
            }

            // Workaround for the recents animation -- normally we need to wait for the new activity
            // to show before starting the PiP animation, but because we start and show the home
            // activity early for the recents animation prior to the PiP animation starting, there