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

Commit 0033148e authored by Alex Chau's avatar Alex Chau
Browse files

Only call reset() when transitioning to a State that doesn't have RecentView visible

- Changes to BaseRecentsViewStateController/FallbackRecentsStateController to avoid calling reset when canceling transitioniong to a RecentsView visible state (e.g. canceling Overivew -> OverivewModal)
- Changes to LauncherRecentsView/FallbackRecentsView to have a consistent check in deciding if we should reset on transition finished
- Note: With 3P Launcher, there is an existing issue that isn't fix by this change: While in Overview or Split select, tap empty space to dismiss Recentsview, then immediately swipe up, Overview tiles will be blank. This is because the swipe up isn't a "brand new" gesture and doesn't call onGestureAnimationStart, so it does not reload thumbnails after the reset in animation cancels.

Fix: 359872614
Test: Reproduction steps in b/246232494, b/243471493, b/242715097 and b/359872614
Test: Trasitionoing between Normal,Hint,Overview,OverivewModal,QuickSwitch etc., and which Home/Back gesture in between to cancel the transitions; repeat the test with 3P Launcher
Flag: EXEMPT BUG_FIX
Change-Id: I86dd0c070196c9a7ce3269599811b7537dd4da37
parent b41def03
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
        }
        setStateWithAnimationInternal(toState, config, builder);
        builder.addEndListener(success -> {
            if (!success) {
            if (!success && !toState.isRecentsViewVisible) {
                mRecentsView.reset();
            }
        });
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState
        // While animating into recents, update the visible task data as needed
        setter.addOnFrameCallback(() -> mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL));
        setter.addEndListener(success -> {
            if (!success) {
            if (!success && !toState.isRecentsViewVisible()) {
                mRecentsView.reset();
            }
        });
+1 −2
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ import static android.app.ActivityTaskManager.INVALID_TASK_ID;

import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS;
import static com.android.quickstep.fallback.RecentsState.DEFAULT;
import static com.android.quickstep.fallback.RecentsState.HOME;
import static com.android.quickstep.fallback.RecentsState.MODAL_TASK;
import static com.android.quickstep.fallback.RecentsState.OVERVIEW_SPLIT_SELECT;

@@ -260,7 +259,7 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta

    @Override
    public void onStateTransitionComplete(RecentsState finalState) {
        if (finalState == HOME) {
        if (!finalState.isRecentsViewVisible()) {
            // Clean-up logic that occurs when recents is no longer in use/visible.
            reset();
        }
+1 −5
Original line number Diff line number Diff line
@@ -17,14 +17,11 @@ package com.android.quickstep.views;

import static android.app.ActivityTaskManager.INVALID_TASK_ID;

import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.CLEAR_ALL_BUTTON;
import static com.android.launcher3.LauncherState.EDIT_MODE;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_HOME;
import static com.android.wm.shell.shared.desktopmode.DesktopModeFlags.WALLPAPER_ACTIVITY;

@@ -173,8 +170,7 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher

    @Override
    public void onStateTransitionComplete(LauncherState finalState) {
        if (finalState == NORMAL || finalState == SPRING_LOADED  || finalState == EDIT_MODE
                || finalState == ALL_APPS) {
        if (!finalState.isRecentsViewVisible) {
            // Clean-up logic that occurs when recents is no longer in use/visible.
            reset();
        }