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

Commit 928cd154 authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Resume app switching when app process is restarted

Process restart may require trampoline activity launch, for which
app switching needs to be enabled. App switching may be allowed
only for specific cases while/after Recents is shown.

As when a process is restarted, the user should be interacting
with the app, so it's safe to do this.

Flag: EXEMPT bug fix
Bug: 421048151
Test: CompatModeTests
Change-Id: Iff2accc543549a5a22a78705f886848530443f72
parent 97370356
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@ import static android.view.WindowManager.PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENAB
import static android.view.WindowManager.PROPERTY_ALLOW_UNTRUSTED_ACTIVITY_EMBEDDING_STATE_SHARING;
import static android.view.WindowManager.TRANSIT_RELAUNCH;
import static android.view.WindowManager.hasWindowExtensionsEnabled;
import static android.window.DesktopExperienceFlags.ENABLE_RESTART_MENU_FOR_CONNECTED_DISPLAYS;
import static android.window.TransitionInfo.FLAGS_IS_OCCLUDED_NO_ANIMATION;
import static android.window.TransitionInfo.FLAG_IS_OCCLUDED;
import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;
@@ -8835,6 +8836,14 @@ final class ActivityRecord extends WindowToken {
            return;
        }

        // Process restart may require trampoline activity launch, for which app switching needs to
        // be enabled. App switching may be allowed only for specific cases while/after Recents is
        // shown. As when a process is restarted, the user should be interacting with the app, so
        // it's safe to do this. See b/421048151 for more detail.
        if (ENABLE_RESTART_MENU_FOR_CONNECTED_DISPLAYS.isTrue()) {
            mAtmService.resumeAppSwitches();
        }

        if (mTransitionController.isShellTransitionsEnabled()) {
            final Transition transition = new Transition(TRANSIT_RELAUNCH, 0 /* flags */,
                    mTransitionController, mWmService.mSyncEngine);