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

Commit cb0de752 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Skip sending user home when the overview command queue is pending.

Tapping the overview scrim during an app -> overview transition in 3-button nav can replace that state transition's aniamtion, leaving the device in a broken state. The assumption is that the user did not mean to tap the scrim while quickly tapping the overview button. Skipping the startHome request if the overview command queue is not empty.

Flag: not needed
Fixes: 284920213
Test: quickly tapped overview button and quickly tapped scrim; added logs to check error case
Change-Id: I8fea76d810e550e28a61a4528796b358103cb5b3
parent aa4a56aa
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1304,6 +1304,13 @@ public class QuickstepLauncher extends Launcher {
                                : groupTask.mSplitBounds.leftTaskPercent);
    }

    @Override
    public boolean isCommandQueueEmpty() {
        OverviewCommandHelper overviewCommandHelper = mTISBindHelper.getOverviewCommandHelper();
        return super.isCommandQueueEmpty()
                && (overviewCommandHelper == null || overviewCommandHelper.isCommandQueueEmpty());
    }

    private static final class LauncherTaskViewController extends
            TaskViewTouchController<Launcher> {

+5 −0
Original line number Diff line number Diff line
@@ -140,6 +140,11 @@ public class OverviewCommandHelper {
        mPendingCommands.clear();
    }

    @UiThread
    public boolean isCommandQueueEmpty() {
        return mPendingCommands.isEmpty();
    }

    @Nullable
    private TaskView getNextTask(RecentsView view) {
        final TaskView runningTaskView = view.getRunningTaskView();
+7 −0
Original line number Diff line number Diff line
@@ -466,4 +466,11 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> {
            }
        };
    }

    @Override
    public boolean isCommandQueueEmpty() {
        OverviewCommandHelper overviewCommandHelper = mTISBindHelper.getOverviewCommandHelper();
        return super.isCommandQueueEmpty()
                && (overviewCommandHelper == null || overviewCommandHelper.isCommandQueueEmpty());
    }
}
+6 −1
Original line number Diff line number Diff line
@@ -79,11 +79,16 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
    }

    @Override
    public void startHome(boolean animated) {
    protected void handleStartHome(boolean animated) {
        mActivity.startHome();
        AbstractFloatingView.closeAllOpenViews(mActivity, mActivity.isStarted());
    }

    @Override
    public boolean isCommandQueueEmpty() {
        return mActivity.isCommandQueueEmpty();
    }

    /**
     * When starting gesture interaction from home, we add a temporary invisible tile corresponding
     * to the home task. This allows us to handle quick-switch similarly to a quick-switching
+6 −1
Original line number Diff line number Diff line
@@ -81,13 +81,18 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher
    }

    @Override
    public void startHome(boolean animated) {
    protected void handleStartHome(boolean animated) {
        StateManager stateManager = mActivity.getStateManager();
        animated &= stateManager.shouldAnimateStateChange();
        stateManager.goToState(NORMAL, animated);
        AbstractFloatingView.closeAllOpenViews(mActivity, animated);
    }

    @Override
    public boolean isCommandQueueEmpty() {
        return mActivity.isCommandQueueEmpty();
    }

    @Override
    protected void onTaskLaunchAnimationEnd(boolean success) {
        if (success) {
Loading