diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index 37e53091db..50e8d0edc7 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -176,6 +176,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController { /** * Should be called from onResume() and onPause(), and animates the Taskbar accordingly. */ + @Override public void onLauncherVisibilityChanged(boolean isVisible) { onLauncherVisibilityChanged(isVisible, false /* fromInit */); } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java index 916b1e6c43..144c0c25c8 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java @@ -53,6 +53,7 @@ public class TaskbarTranslationController implements TaskbarControllers.Loggable private boolean mHasSprungOnceThisGesture; private @Nullable ValueAnimator mSpringBounce; + private boolean mGestureInProgress; private boolean mGestureEnded; private boolean mAnimationToHomeRunning; @@ -155,7 +156,12 @@ public class TaskbarTranslationController implements TaskbarControllers.Loggable /** * Returns an animation to reset the taskbar translation to {@code 0}. */ - public ObjectAnimator createAnimToResetTranslation(long duration) { + public ValueAnimator createAnimToResetTranslation(long duration) { + if (mGestureInProgress) { + // Return an empty animator as the translation will reset itself after gesture ends. + return ValueAnimator.ofFloat(0).setDuration(duration); + } + ObjectAnimator animator = mTranslationYForSwipe.animateToValue(0); animator.setInterpolator(Interpolators.LINEAR); animator.setDuration(duration); @@ -192,6 +198,7 @@ public class TaskbarTranslationController implements TaskbarControllers.Loggable mAnimationToHomeRunning = false; cancelSpringIfExists(); reset(); + mGestureInProgress = true; } /** * Called when there is movement to move the taskbar. @@ -215,6 +222,7 @@ public class TaskbarTranslationController implements TaskbarControllers.Loggable mGestureEnded = true; startSpring(); } + mGestureInProgress = false; } } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java index bb2ac738c3..8a26054a66 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java @@ -358,4 +358,13 @@ public class TaskbarUIController { /** Adjusts the hotseat for the bubble bar. */ public void adjustHotseatForBubbleBar(boolean isBubbleBarVisible) {} + + /** + * Adjusts the taskbar based on the visibility of the launcher. + * @param isVisible True if launcher is visible, false otherwise. + */ + public void onLauncherVisibilityChanged(boolean isVisible) { + mControllers.taskbarStashController.updateStateForFlag(FLAG_IN_APP, !isVisible); + mControllers.taskbarStashController.applyState(); + } } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java index 486e53c818..c841cac3ca 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java @@ -23,6 +23,9 @@ import android.view.InputDevice; import android.view.MotionEvent; import android.view.View; +import com.android.internal.jank.Cuj; +import com.android.systemui.shared.system.InteractionJankMonitorWrapper; + /** * Callbacks for {@link TaskbarView} to interact with its controller. */ @@ -45,6 +48,8 @@ public class TaskbarViewCallbacks { public View.OnClickListener getAllAppsButtonClickListener() { return v -> { + InteractionJankMonitorWrapper.begin(v, Cuj.CUJ_LAUNCHER_OPEN_ALL_APPS, + /* tag= */ "TASKBAR_BUTTON"); mActivity.getStatsLogManager().logger().log(LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP); mControllers.taskbarAllAppsController.toggle(); }; diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsViewController.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsViewController.java index b1c515177b..ba4fa45e6c 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsViewController.java @@ -20,6 +20,7 @@ import static com.android.launcher3.util.OnboardingPrefs.ALL_APPS_VISITED_COUNT; import androidx.annotation.Nullable; +import com.android.internal.jank.Cuj; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.allapps.AllAppsTransitionListener; import com.android.launcher3.anim.PendingAnimation; @@ -31,6 +32,7 @@ import com.android.launcher3.taskbar.TaskbarStashController; import com.android.launcher3.taskbar.overlay.TaskbarOverlayContext; import com.android.launcher3.taskbar.overlay.TaskbarOverlayController; import com.android.launcher3.util.DisplayController; +import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import java.util.Optional; @@ -136,6 +138,9 @@ final class TaskbarAllAppsViewController { && mAppsView.getSearchUiManager().getEditText() != null) { mAppsView.getSearchUiManager().getEditText().requestFocus(); } + if (toAllApps) { + InteractionJankMonitorWrapper.end(Cuj.CUJ_LAUNCHER_OPEN_ALL_APPS); + } } /** Invoked on back press, returning {@code true} if the search session handled it. */ diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java index e448a14e1e..febfc3ad73 100644 --- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java @@ -218,9 +218,13 @@ public class OverviewCommandHelper { return true; } } - if (cmd.type == TYPE_KEYBOARD_INPUT && allowQuickSwitch) { - uiController.openQuickSwitchView(); - return true; + if (cmd.type == TYPE_KEYBOARD_INPUT) { + if (allowQuickSwitch) { + uiController.openQuickSwitchView(); + return true; + } else { + mKeyboardTaskFocusIndex = 0; + } } if (cmd.type == TYPE_HOME) { ActiveGestureLog.INSTANCE.addLog("OverviewCommandHelper.executeCommand(TYPE_HOME)"); diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 52f9d8d8ec..72f67fc544 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -82,13 +82,13 @@ import com.android.systemui.unfold.progress.IUnfoldTransitionListener; import com.android.wm.shell.back.IBackAnimation; import com.android.wm.shell.bubbles.IBubbles; import com.android.wm.shell.bubbles.IBubblesListener; +import com.android.wm.shell.common.pip.IPip; +import com.android.wm.shell.common.pip.IPipAnimationListener; import com.android.wm.shell.common.split.SplitScreenConstants.PersistentSnapPosition; import com.android.wm.shell.desktopmode.IDesktopMode; import com.android.wm.shell.desktopmode.IDesktopTaskListener; import com.android.wm.shell.draganddrop.IDragAndDrop; import com.android.wm.shell.onehanded.IOneHanded; -import com.android.wm.shell.pip.IPip; -import com.android.wm.shell.pip.IPipAnimationListener; import com.android.wm.shell.recents.IRecentTasks; import com.android.wm.shell.recents.IRecentTasksListener; import com.android.wm.shell.splitscreen.ISplitScreen; diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index c2cd11cb68..dc8ba849cf 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -68,6 +68,7 @@ import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.statehandlers.DepthController; import com.android.launcher3.statemanager.StateManager; +import com.android.launcher3.taskbar.TaskbarUIController; import com.android.launcher3.util.DisplayController; import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle; import com.android.quickstep.util.MultiValueUpdateListener; @@ -643,6 +644,21 @@ public final class TaskViewUtils { recentsView.post(() -> { stateManager.moveToRestState(); stateManager.reapplyState(); + + // We may have notified launcher is not visible so that taskbar can + // stash immediately. Now that the animation is over, we can update + // that launcher is still visible. + TaskbarUIController controller = recentsView.getSizeStrategy() + .getTaskbarController(); + if (controller != null) { + boolean launcherVisible = true; + for (RemoteAnimationTarget target : appTargets) { + launcherVisible &= target.isTranslucent; + } + if (launcherVisible) { + controller.onLauncherVisibilityChanged(true); + } + } }); }); } diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index b6b7d58e30..f9486bd6a8 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -47,6 +47,7 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNF import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; +import static com.android.wm.shell.Flags.enableBubblesLongPressNavHandle; import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_BACK_ANIMATION; import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_BUBBLES; import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_DESKTOP_MODE; @@ -134,10 +135,10 @@ import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationContro import com.android.systemui.unfold.progress.IUnfoldAnimation; import com.android.wm.shell.back.IBackAnimation; import com.android.wm.shell.bubbles.IBubbles; +import com.android.wm.shell.common.pip.IPip; import com.android.wm.shell.desktopmode.IDesktopMode; import com.android.wm.shell.draganddrop.IDragAndDrop; import com.android.wm.shell.onehanded.IOneHanded; -import com.android.wm.shell.pip.IPip; import com.android.wm.shell.recents.IRecentTasks; import com.android.wm.shell.splitscreen.ISplitScreen; import com.android.wm.shell.startingsurface.IStartingWindow; @@ -1006,6 +1007,17 @@ public class TouchInteractionService extends Service { mOverviewCommandHelper); } } + if (enableBubblesLongPressNavHandle()) { + // Create bubbles input consumer before NavHandleLongPressInputConsumer. + // This allows for nav handle to fall back to bubbles. + if (mDeviceState.isBubblesExpanded()) { + reasonString = newCompoundString(reasonPrefix) + .append(SUBSTRING_PREFIX) + .append("bubbles expanded, trying to use default input consumer"); + // Bubbles can handle home gesture itself. + base = getDefaultInputConsumer(reasonString); + } + } NavHandle navHandle = tac != null ? tac.getNavHandle() : SystemUiProxy.INSTANCE.get(this); @@ -1023,12 +1035,15 @@ public class TouchInteractionService extends Service { mDeviceState, navHandle); } - if (mDeviceState.isBubblesExpanded()) { - reasonString = newCompoundString(reasonPrefix) - .append(SUBSTRING_PREFIX) - .append("bubbles expanded, trying to use default input consumer"); - // Bubbles can handle home gesture itself. - base = getDefaultInputConsumer(reasonString); + if (!enableBubblesLongPressNavHandle()) { + // Continue overriding nav handle input consumer with bubbles + if (mDeviceState.isBubblesExpanded()) { + reasonString = newCompoundString(reasonPrefix) + .append(SUBSTRING_PREFIX) + .append("bubbles expanded, trying to use default input consumer"); + // Bubbles can handle home gesture itself. + base = getDefaultInputConsumer(reasonString); + } } if (mDeviceState.isSystemUiDialogShowing()) { diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index f6afaf0043..79dfa19e36 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -214,7 +214,7 @@ import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import com.android.systemui.shared.system.PackageManagerWrapper; import com.android.systemui.shared.system.TaskStackChangeListener; import com.android.systemui.shared.system.TaskStackChangeListeners; -import com.android.wm.shell.pip.IPipAnimationListener; +import com.android.wm.shell.common.pip.IPipAnimationListener; import java.util.ArrayList; import java.util.Arrays; diff --git a/quickstep/tests/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactoryTest.kt b/quickstep/tests/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactoryTest.kt index 02a49a3b91..c327166b77 100644 --- a/quickstep/tests/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactoryTest.kt +++ b/quickstep/tests/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactoryTest.kt @@ -171,17 +171,19 @@ class NavButtonLayoutFactoryTest { assert(layoutter is PhoneSeascapeNavLayoutter) } - @Test(expected = IllegalStateException::class) - fun noValidLayoutForPhoneGestureNav() { + @Test + fun getTaskbarPhoneGestureNavLayoutter() { assumeTrue(ENABLE_TASKBAR_NAVBAR_UNIFICATION) mockDeviceProfile.isTaskbarPresent = false - getLayoutter( - isKidsMode = false, - isInSetup = false, - isThreeButtonNav = false, - phoneMode = true, - surfaceRotation = surfaceRotation - ) + val layoutter: NavButtonLayoutFactory.NavButtonLayoutter = + getLayoutter( + isKidsMode = false, + isInSetup = false, + isThreeButtonNav = false, + phoneMode = true, + surfaceRotation = surfaceRotation + ) + assert(layoutter is PhoneGestureLayoutter) } private fun setDeviceProfileLandscape() { diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java index 39d6f03663..213f58fa8b 100644 --- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java +++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java @@ -252,6 +252,7 @@ public class FallbackRecentsTest { // b/143488140 //@NavigationModeSwitch @Test + @ScreenRecordRule.ScreenRecord // b/321775748 public void testOverview() { startAppFast(getAppPackageName()); startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index 360d1a7cef..cbb48949d1 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -304,6 +304,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @NavigationModeSwitch @PortraitLandscape + @ScreenRecord // b/313464374 public void testQuickSwitchFromApp() throws Exception { startTestActivity(2); startTestActivity(3); diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java index 1049314016..acfc5e40ca 100644 --- a/src/com/android/launcher3/BaseActivity.java +++ b/src/com/android/launcher3/BaseActivity.java @@ -16,6 +16,8 @@ package com.android.launcher3; +import static com.android.launcher3.testing.shared.TestProtocol.ACTIVITY_NOT_RESUMED_AFTER_BACK; +import static com.android.launcher3.testing.shared.TestProtocol.sDebugTracing; import static com.android.launcher3.util.FlagDebugUtils.appendFlag; import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange; import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK; @@ -308,6 +310,9 @@ public abstract class BaseActivity extends Activity implements ActivityContext { * Sets the activity to appear as paused. */ public void setPaused() { + if (sDebugTracing) { + Log.d(ACTIVITY_NOT_RESUMED_AFTER_BACK, "Activity setPaused: " + this, new Throwable()); + } removeActivityFlags(ACTIVITY_STATE_RESUMED | ACTIVITY_STATE_DEFERRED_RESUMED); } @@ -315,6 +320,7 @@ public abstract class BaseActivity extends Activity implements ActivityContext { * Sets the activity to appear as resumed. */ public void setResumed() { + if (sDebugTracing) Log.d(ACTIVITY_NOT_RESUMED_AFTER_BACK, "Activity setResumed: " + this); addActivityFlags(ACTIVITY_STATE_RESUMED | ACTIVITY_STATE_USER_ACTIVE); removeActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE); } diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index e2902e9fe1..072a96ce6e 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -31,6 +31,7 @@ import static com.android.launcher3.uioverrides.flags.FlagsFactory.getDebugFlag; import static com.android.launcher3.uioverrides.flags.FlagsFactory.getReleaseFlag; import static com.android.wm.shell.Flags.enableTaskbarNavbarUnification; +import android.content.res.Resources; import android.view.ViewConfiguration; import androidx.annotation.VisibleForTesting; @@ -222,7 +223,19 @@ public final class FeatureFlags { TEAMFOOD, "Sends a notification whenever launcher encounters an uncaught exception."); public static final boolean ENABLE_TASKBAR_NAVBAR_UNIFICATION = - enableTaskbarNavbarUnification(); + enableTaskbarNavbarUnification() && !isPhone(); + + private static boolean isPhone() { + final boolean isPhone; + int foldedDeviceStatesId = Resources.getSystem().getIdentifier( + "config_foldedDeviceStates", "array", "android"); + if (foldedDeviceStatesId != 0) { + isPhone = Resources.getSystem().getIntArray(foldedDeviceStatesId).length == 0; + } else { + isPhone = true; + } + return isPhone; + } // Aconfig migration complete for ENABLE_TASKBAR_NO_RECREATION. public static final BooleanFlag ENABLE_TASKBAR_NO_RECREATION = getDebugFlag(299193589, diff --git a/src/com/android/launcher3/model/ItemInstallQueue.java b/src/com/android/launcher3/model/ItemInstallQueue.java index 59f453a21c..d35087980a 100644 --- a/src/com/android/launcher3/model/ItemInstallQueue.java +++ b/src/com/android/launcher3/model/ItemInstallQueue.java @@ -18,7 +18,6 @@ package com.android.launcher3.model; import static android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_ID; -import static com.android.launcher3.Flags.enableSupportForArchiving; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT; @@ -45,6 +44,7 @@ import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherSettings.Favorites; +import com.android.launcher3.Utilities; import com.android.launcher3.logging.FileLog; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.LauncherAppWidgetInfo; @@ -300,7 +300,8 @@ public class ItemInstallQueue { } else { lai = laiList.get(0); si.intent = makeLaunchIntent(lai); - if (enableSupportForArchiving() && lai.getActivityInfo().isArchived) { + if (Utilities.enableSupportForArchiving() + && lai.getActivityInfo().isArchived) { si.runtimeStatusFlags |= FLAG_ARCHIVED; } } diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index 1623ad8e6a..1231cd7041 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java @@ -17,6 +17,7 @@ package com.android.launcher3.testing; 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.enableSplitContextually; import static com.android.launcher3.testing.shared.TestProtocol.TEST_INFO_RESPONSE_FIELD; @@ -182,6 +183,11 @@ public class TestInformationHandler implements ResourceBasedOverride { response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.isTablet); return response; + case TestProtocol.REQUEST_ENABLE_TASKBAR_NAVBAR_UNIFICATION: + response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, + ENABLE_TASKBAR_NAVBAR_UNIFICATION); + return response; + case TestProtocol.REQUEST_NUM_ALL_APPS_COLUMNS: response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.numShownAllAppsColumns); diff --git a/src/com/android/launcher3/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java index 92288e157d..11d8e970f0 100644 --- a/src/com/android/launcher3/util/PackageManagerHelper.java +++ b/src/com/android/launcher3/util/PackageManagerHelper.java @@ -16,8 +16,6 @@ package com.android.launcher3.util; -import static com.android.launcher3.Flags.enableSupportForArchiving; - import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; @@ -276,6 +274,6 @@ public class PackageManagerHelper { @SuppressWarnings("NewApi") private boolean isPackageInstalledOrArchived(ApplicationInfo info) { return (info.flags & ApplicationInfo.FLAG_INSTALLED) != 0 || ( - enableSupportForArchiving() && info.isArchived); + Utilities.enableSupportForArchiving() && info.isArchived); } } diff --git a/tests/Launcher3Tests.xml b/tests/Launcher3Tests.xml index 0aed1e1a67..bcbe343913 100644 --- a/tests/Launcher3Tests.xml +++ b/tests/Launcher3Tests.xml @@ -46,6 +46,6 @@ diff --git a/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java index fe61992513..4e1e9c826c 100644 --- a/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java +++ b/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java @@ -119,6 +119,8 @@ public final class TestProtocol { public static final String REQUEST_CLEAR_DATA = "clear-data"; public static final String REQUEST_HOTSEAT_ICON_NAMES = "get-hotseat-icon-names"; public static final String REQUEST_IS_TABLET = "is-tablet"; + public static final String REQUEST_ENABLE_TASKBAR_NAVBAR_UNIFICATION = + "enable-taskbar-navbar-unification"; public static final String REQUEST_NUM_ALL_APPS_COLUMNS = "num-all-apps-columns"; public static final String REQUEST_IS_TWO_PANELS = "is-two-panel"; public static final String REQUEST_CELL_LAYOUT_BOARDER_HEIGHT = "cell-layout-boarder-height"; @@ -169,6 +171,7 @@ public final class TestProtocol { public static final String ICON_MISSING = "b/282963545"; public static final String OVERVIEW_OVER_HOME = "b/279059025"; public static final String UIOBJECT_STALE_ELEMENT = "b/319501259"; + public static final String ACTIVITY_NOT_RESUMED_AFTER_BACK = "b/322823209"; public static final String REQUEST_EMULATE_DISPLAY = "emulate-display"; public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display"; diff --git a/tests/multivalentTests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/multivalentTests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index e17994caf5..326802f540 100644 --- a/tests/multivalentTests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/multivalentTests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -405,6 +405,11 @@ public final class LauncherInstrumentation { .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD); } + public boolean isTaskbarNavbarUnificationEnabled() { + return getTestInfo(TestProtocol.REQUEST_ENABLE_TASKBAR_NAVBAR_UNIFICATION) + .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD); + } + public boolean isTwoPanels() { return getTestInfo(TestProtocol.REQUEST_IS_TWO_PANELS) .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD); @@ -845,7 +850,8 @@ public final class LauncherInstrumentation { } private String getNavigationButtonResPackage() { - return isTablet() ? getLauncherPackageName() : SYSTEMUI_PACKAGE; + return isTablet() || isTaskbarNavbarUnificationEnabled() + ? getLauncherPackageName() : SYSTEMUI_PACKAGE; } UiObject2 verifyContainerType(ContainerType containerType) { diff --git a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java index 0f23165ebf..848ae820f0 100644 --- a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java +++ b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java @@ -25,7 +25,6 @@ import static org.junit.Assume.assumeTrue; import android.content.Intent; import android.platform.test.annotations.PlatinumTest; -import android.platform.test.rule.ScreenRecordRule; import androidx.test.filters.FlakyTest; import androidx.test.platform.app.InstrumentationRegistry; @@ -35,6 +34,7 @@ import com.android.launcher3.LauncherState; import com.android.launcher3.tapl.AllApps; import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; +import com.android.launcher3.util.rule.ScreenRecordRule; import org.junit.Before; import org.junit.Test;