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

Commit a6b441bd authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Allow pressing home button on recents if command queue not empty

Fixes: 290252373
Test: Go home from overview, works
Flag: None
Change-Id: Ie40eb1891f38b1561eda89ad0f7987cdecd9da16
parent 1e3d799f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1311,9 +1311,9 @@ public class QuickstepLauncher extends Launcher {
                                : groupTask.mSplitBounds.leftTaskPercent);
    }

    public boolean isCommandQueueEmpty() {
    public boolean canStartHomeSafely() {
        OverviewCommandHelper overviewCommandHelper = mTISBindHelper.getOverviewCommandHelper();
        return overviewCommandHelper == null || overviewCommandHelper.isCommandQueueEmpty();
        return overviewCommandHelper == null || overviewCommandHelper.canStartHomeSafely();
    }

    private static final class LauncherTaskViewController extends
+2 −2
Original line number Diff line number Diff line
@@ -141,8 +141,8 @@ public class OverviewCommandHelper {
    }

    @UiThread
    public boolean isCommandQueueEmpty() {
        return mPendingCommands.isEmpty();
    public boolean canStartHomeSafely() {
        return mPendingCommands.isEmpty() || mPendingCommands.get(0).type == TYPE_HOME;
    }

    @Nullable
+2 −2
Original line number Diff line number Diff line
@@ -469,8 +469,8 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> {
        };
    }

    public boolean isCommandQueueEmpty() {
    public boolean canStartHomeSafely() {
        OverviewCommandHelper overviewCommandHelper = mTISBindHelper.getOverviewCommandHelper();
        return overviewCommandHelper == null || overviewCommandHelper.isCommandQueueEmpty();
        return overviewCommandHelper == null || overviewCommandHelper.canStartHomeSafely();
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -86,8 +86,8 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
    }

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

    /**
+2 −2
Original line number Diff line number Diff line
@@ -90,8 +90,8 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher
    }

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

    @Override
Loading