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

Commit 3740c2e7 authored by Louis Chang's avatar Louis Chang
Browse files

Stop app switches only when home is the focused app

The home activity was transient launched to top when transition started.
A translucent activity was started before the transition finished.
In that case, the app switch was stopped when finishing the transition
because the transition contains visible transient launches, while
the top activity was not home. Therefore, the top translucent activity
was unable to start activity and had to wait until timed out.

Bug: 368512259
Test: wm presubmit
Flag: EXEMPT bugfix
Change-Id: Ib46d76923f3bbacd06d6d9dea3f0bfc148b8c129
parent 64358d6a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1356,6 +1356,11 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
                        mController.mAtm.setLastResumedActivityUncheckLocked(ar,
                                "transitionFinished");
                    }

                    // Prevent spurious background app switches.
                    if (ar.mDisplayContent.mFocusedApp == ar) {
                        mController.mAtm.stopAppSwitches();
                    }
                }
                continue;
            }
@@ -1410,8 +1415,6 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
            if (enterAutoPip) {
                mController.mAtm.getTaskChangeNotificationController().notifyTaskStackChanged();
            }
            // Prevent spurious background app switches.
            mController.mAtm.stopAppSwitches();
            // The end of transient launch may not reorder task, so make sure to compute the latest
            // task rank according to the current visibility.
            mController.mAtm.mRootWindowContainer.rankTaskLayers();