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

Commit 00711e68 authored by Fengjiang Li's avatar Fengjiang Li Committed by Android (Google) Code Review
Browse files

Merge "Enable predictive back in TAPL tests" into main

parents a835a2dc e90f098d
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -39,8 +39,8 @@ import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
import static com.android.launcher3.config.FeatureFlags.enableSplitContextually;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_INTERRUPTED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_HOME;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_INTERRUPTED;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition;
import static com.android.launcher3.popup.SystemShortcut.APP_INFO;
@@ -105,6 +105,7 @@ import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Flags;
import com.android.launcher3.HomeTransitionController;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.LauncherState;
@@ -665,6 +666,14 @@ public class QuickstepLauncher extends Launcher {
        View.setTracedRequestLayoutClassClass(TRACE_RELAYOUT_CLASS);
    }

    @Override
    protected boolean initDeviceProfile(InvariantDeviceProfile idp) {
        final boolean ret = super.initDeviceProfile(idp);
        mDeviceProfile.isPredictiveBackSwipe =
                getApplicationInfo().isOnBackInvokedCallbackEnabled();
        return ret;
    }

    @Override
    public void startSplitSelection(SplitSelectSource splitSelectSource) {
        RecentsView recentsView = getOverviewPanel();
+0 −2
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import androidx.test.runner.AndroidJUnit4;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.Until;

import com.android.launcher3.Flags;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.tapl.LaunchedAppState;
@@ -421,7 +420,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
                READ_DEVICE_CONFIG_PERMISSION);
        // Debug if we need to goHome to prevent wrong previous state b/315525621
        mLauncher.goHome();
        assumeFalse(Flags.enablePredictiveBackGesture());
        mLauncher.getWorkspace().switchToAllApps().pressBackToWorkspace();
        waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);

+0 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.quickstep;
import static com.android.quickstep.NavigationModeSwitchRule.Mode.ZERO_BUTTON;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;

import android.app.Instrumentation;
@@ -28,7 +27,6 @@ import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import com.android.launcher3.Flags;
import com.android.launcher3.tapl.LauncherInstrumentation.TrackpadGestureType;
import com.android.launcher3.tapl.Workspace;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
@@ -69,7 +67,6 @@ public class TaplTestsTrackpad extends AbstractQuickStepTest {
    @NavigationModeSwitch(mode = ZERO_BUTTON)
    public void pressBack() throws Exception {
        assumeTrue(mLauncher.isTablet());
        assumeFalse(Flags.enablePredictiveBackGesture());
        Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();

        try {
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ public class DeviceProfile {
    public final boolean transposeLayoutWithOrientation;
    public final boolean isMultiDisplay;
    public final boolean isTwoPanels;
    public boolean isPredictiveBackSwipe;
    public final boolean isQsbInline;

    // Device properties in current orientation
+5 −2
Original line number Diff line number Diff line
@@ -19,9 +19,9 @@ import static com.android.launcher3.Flags.enableGridOnlyOverview;
import static com.android.launcher3.allapps.AllAppsStore.DEFER_UPDATES_TEST;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
import static com.android.launcher3.config.FeatureFlags.FOLDABLE_SINGLE_PAGE;
import static com.android.launcher3.config.FeatureFlags.enableAppPairs;
import static com.android.launcher3.config.FeatureFlags.enableSplitContextually;
import static com.android.launcher3.testing.shared.TestProtocol.TEST_INFO_RESPONSE_FIELD;
import static com.android.launcher3.config.FeatureFlags.enableAppPairs;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;

import android.app.Activity;
@@ -183,7 +183,10 @@ public class TestInformationHandler implements ResourceBasedOverride {
            case TestProtocol.REQUEST_IS_TABLET:
                response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.isTablet);
                return response;

            case TestProtocol.REQUEST_IS_PREDICTIVE_BACK_SWIPE_ENABLED:
                response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD,
                        mDeviceProfile.isPredictiveBackSwipe);
                return response;
            case TestProtocol.REQUEST_ENABLE_TASKBAR_NAVBAR_UNIFICATION:
                response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD,
                        ENABLE_TASKBAR_NAVBAR_UNIFICATION);
Loading