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

Commit 5fbc9a5d authored by Alex Chau's avatar Alex Chau Committed by Android Build Coastguard Worker
Browse files

Perform state switch to Overview from -1 screen

- This fixed a regression caused by ag/27904180, where -1 is no longer considered `visibleLauncher`. -1 still have Launcher being top activity, and recents animation will always fail
- Added isInMinusOne in LauncherActivityInterface, and return Launcher in getVisibleLauncher for -1 case
- -1 should be the only case where Launcher is top activity, but is not started

Fix: 352254279
Test: Recents button from the following scenarios: Home, -1, apps, transparent apps, video from -1
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1cd3fe27f229da4f7bb80a2e04d1416cc050fc94)
Merged-In: I0898d202b9dd4742c0c7d2c0d6b340c748e8acf7
Change-Id: I0898d202b9dd4742c0c7d2c0d6b340c748e8acf7
parent 9898ac4b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -212,6 +212,9 @@ public final class LauncherActivityInterface extends
        if (launcher.isStarted() && (isInLiveTileMode() || launcher.hasBeenResumed())) {
            return launcher;
        }
        if (isInMinusOne()) {
            return launcher;
        }

        return null;
    }
@@ -289,6 +292,15 @@ public final class LauncherActivityInterface extends
                && TopTaskTracker.INSTANCE.get(launcher).getCachedTopTask(false).isHomeTask();
    }

    private boolean isInMinusOne() {
        QuickstepLauncher launcher = getCreatedContainer();

        return launcher != null
                && launcher.getStateManager().getState() == NORMAL
                && !launcher.isStarted()
                && TopTaskTracker.INSTANCE.get(launcher).getCachedTopTask(false).isHomeTask();
    }

    @Override
    public void onLaunchTaskFailed() {
        QuickstepLauncher launcher = getCreatedContainer();