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

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

Fix KQS first task focux when there is only one recent task

Flag: LEGACY ENABLE_KEYBOARD_QUICK_SWITCH ENABLED
Fixes: 335257398
Test: TaplTestsKeyboardQuickSwitch#testLaunchSingleRecentTask
Change-Id: Ibf1514394c29c33ea1dde9e3704af231e2d039f2
parent 63bf93cf
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -362,8 +362,9 @@ public class KeyboardQuickSwitchView extends ConstraintLayout {
                                        OPEN_OUTLINE_INTERPOLATOR));
                    }
                });
                animateFocusMove(-1, currentFocusIndexOverride == -1
                        ? Math.min(mContent.getChildCount(), 1) : currentFocusIndexOverride);
                animateFocusMove(-1, Math.min(
                        mContent.getChildCount() - 1,
                        currentFocusIndexOverride == -1 ? 1 : currentFocusIndexOverride));
                displayedContent.setVisibility(VISIBLE);
                setVisibility(VISIBLE);
                requestFocus();
+7 −0
Original line number Diff line number Diff line
@@ -149,6 +149,13 @@ public class TaplTestsKeyboardQuickSwitch extends AbstractQuickStepTest {
        runTest(TestSurface.WIDGETS, TestCase.LAUNCH_OVERVIEW);
    }

    @Test
    public void testLaunchSingleRecentTask() {
        mLauncher.getLaunchedAppState().switchToOverview().dismissAllTasks();
        startAppFast(CALCULATOR_APP_PACKAGE);
        mLauncher.goHome().showQuickSwitchView().launchFocusedAppTask(CALCULATOR_APP_PACKAGE);
    }

    private void runTest(@NonNull TestSurface testSurface, @NonNull TestCase testCase) {
        for (int i = 0; i < testCase.mNumAdditionalRunningTasks; i++) {
            startTestActivity(3 + i);