From 826c012382f5a475d32b5c7ab000f130db3c2d51 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 14 Feb 2024 09:34:56 -0800 Subject: [PATCH 01/17] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: Ibfb41ab8df5f26b127bf9978409e51a412133763 --- quickstep/res/values-ar/strings.xml | 2 +- quickstep/res/values-es/strings.xml | 2 +- quickstep/res/values-et/strings.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/quickstep/res/values-ar/strings.xml b/quickstep/res/values-ar/strings.xml index 6d7effcbb0..714a66ea6f 100644 --- a/quickstep/res/values-ar/strings.xml +++ b/quickstep/res/values-ar/strings.xml @@ -96,7 +96,7 @@ "تقسيم" "انقر على تطبيق آخر لاستخدام وضع تقسيم الشاشة." "الخروج من وضع تقسيم الشاشة" - "اختَر تطبيقًا آخر لاستخدام وضع تقسيم الشاشة." + "اختَر تطبيقًا آخر لاستخدام \"وضع تقسيم الشاشة\"." "لا يسمح التطبيق أو لا تسمح مؤسستك بهذا الإجراء." "هل تريد تخطي الدليل التوجيهي للتنقّل؟" "يمكنك العثور على هذا الدليل التوجيهي لاحقًا في التطبيق \"%1$s\"" diff --git a/quickstep/res/values-es/strings.xml b/quickstep/res/values-es/strings.xml index 4c31d8738b..4bf6147713 100644 --- a/quickstep/res/values-es/strings.xml +++ b/quickstep/res/values-es/strings.xml @@ -96,7 +96,7 @@ "Dividir" "Toca otra aplicación para usar la pantalla dividida" "Salir de la selección de pantalla dividida" - "Elige otra app para usar la pantalla dividida" + "Elige otra app para usar la pantalla dividida." "No puedes hacerlo porque la aplicación o tu organización no lo permiten" "¿Saltar tutorial de navegación?" "Puedes consultarlo en otro momento en la aplicación %1$s" diff --git a/quickstep/res/values-et/strings.xml b/quickstep/res/values-et/strings.xml index 176741a718..49f222b8a5 100644 --- a/quickstep/res/values-et/strings.xml +++ b/quickstep/res/values-et/strings.xml @@ -96,7 +96,7 @@ "Eralda" "Jagatud ekraanikuva kasutamiseks puudutage muud rakendust" "Jagatud ekraanikuva valikust väljumine" - "Valige jagatud ekraanikuva jaoks muu rakendus" + "Valige jagatud ekraanikuva jaoks muu rakendus." "Rakendus või teie organisatsioon on selle toimingu keelanud" "Kas jätta navigeerimise õpetused vahele?" "Leiate selle hiljem rakendusest %1$s" From 2ae543dfd6ca60f73a9a635a9498d06a5b051a5e Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 14 Feb 2024 09:35:42 -0800 Subject: [PATCH 02/17] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I0060fe7f38bba392825c3237c5e81bb68732e83b --- res/values-in/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml index c1d62d4eb3..ed14c8d430 100644 --- a/res/values-in/strings.xml +++ b/res/values-in/strings.xml @@ -86,7 +86,7 @@ "Setelan widget" "Ketuk untuk menyelesaikan penyiapan" "Ini adalah aplikasi sistem dan tidak dapat di-uninstal." - "Sunting Nama" + "Edit Nama" "%1$s dinonaktifkan" "{count,plural, =1{{app_name} memiliki # notifikasi}other{{app_name} memiliki # notifikasi}}" "Halaman %1$d dari %2$d" From 32664125afc153756f3963926d2231ba7ca3eb9f Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Tue, 13 Feb 2024 14:31:34 -0800 Subject: [PATCH 03/17] Create bubbles input consumer before nav bar long press NavHandleLongPressInputConsumer handles long presses on the nav handle and passes the touches on to a delegate if the touch is not a long press. When bubbles are expanded, we create a new input consumer that does nothing and allows bubble input consumer in shell to take over. Change the order how the input consumers are created. Create the bubbles input consumer first, so it can be passed in as a delegate to the nav handle input consumer. And this avoids bubbles overriding the nav handle behavior. Flag: ACONFIG com.android.wm.shell.enable_bubbles_long_press_nav_handle DISABLED Bug: 324910035 Test: manual, expand a bubble, long press on home button for CtS Change-Id: I05c219145c096a567bb0bb5a9cb3a40046b29519 --- .../quickstep/TouchInteractionService.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index b6b7d58e30..6fa7430244 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; @@ -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()) { From d2379d11c7cfe351e925ab796e47ded4b3d1b428 Mon Sep 17 00:00:00 2001 From: bvineeth Date: Wed, 7 Feb 2024 11:47:07 +0000 Subject: [PATCH 04/17] Add CUJ-LAUNCHER_OPEN_ALL_APPS instrumentation from taskbar Added instrumentation when allapps is opened by button click in the taskbar. Starting the slice in the onClickListener of the allApps button and ending it on the end of the animation. Test: checked the trace Fixes: b/270128563 Flag: None Change-Id: I492a4a7af81e0c40dc3d7d415ffc7b16c057b25d --- .../com/android/launcher3/taskbar/TaskbarViewCallbacks.java | 5 +++++ .../taskbar/allapps/TaskbarAllAppsViewController.java | 5 +++++ 2 files changed, 10 insertions(+) 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. */ From 4a9a67816dc39e45ba8779177d5bef05e024db0b Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Thu, 15 Feb 2024 09:58:57 -0800 Subject: [PATCH 05/17] Prevent taskbar reset animation from playing when gesture is in progress. This fixes the bug that appears when you launch an app and immediately swipe up on taskbar. Fixes: 278617335 Test: launch app, immediately swipe up on taskbar Flag: NONE Change-Id: I56eddfae9c81b1ef827622cf0f13ffd26fadd5c3 --- .../taskbar/TaskbarTranslationController.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; } } From 5c6263afc5e37ab20cf65a959de0d4d70b2e87e0 Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Tue, 13 Feb 2024 11:41:41 -0500 Subject: [PATCH 06/17] Fix alt-tab initial focus in overview on phones Flag: LEGACY ENABLE_KEYBOARD_QUICK_SWITCH ENABLED Fixes: 325057678 Test: used alt+tab on a phone from home and from an app Change-Id: I98388fea448fd1932d767c420e232d1451e0bbfe --- .../com/android/quickstep/OverviewCommandHelper.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)"); From 266ca6005dea2dfda03cad0641b4febb7f27d043 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Thu, 15 Feb 2024 10:41:14 -0800 Subject: [PATCH 07/17] Adding screen recording for FallbackRecentsTest.testOverview Bug: 321775748 Test: presubmit Flag: N/A Change-Id: I7dddefcf46afde35d86b9f9271c34d46a257281e --- .../tests/src/com/android/quickstep/FallbackRecentsTest.java | 1 + 1 file changed, 1 insertion(+) 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)); From f32c27f7736df48f3618fa05639c88fee7c795a2 Mon Sep 17 00:00:00 2001 From: Ikram Gabiyev Date: Thu, 15 Feb 2024 11:13:01 -0800 Subject: [PATCH 08/17] Move IPip and IPipAnimationListener to common Move IPip.aidl and IPipAnimationListener.aidl to common.pip package as a part of PiP2 refactoring. Make sure users of these Binder interfaces in Launcher also reference the updated classname and package. The plan is to use these interfaces to implement PiP2 <-> Launcher IPC to facilitate transitions and animations for gesture nav and auto-enter PiP for instance. Note: this CL shouldn't yield any behavioral changes. Flag: NA Bug: 325481148 Test: mp droid Change-Id: I065334f6777cd1489c739d95abf0fab8285860ed --- quickstep/src/com/android/quickstep/SystemUiProxy.java | 4 ++-- .../src/com/android/quickstep/TouchInteractionService.java | 2 +- quickstep/src/com/android/quickstep/views/RecentsView.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index b6b7d58e30..2aad327ff2 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -134,10 +134,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; 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; From 451eebd4503b0eca95e2b23d9aeaf09bfeeb7d1b Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Thu, 15 Feb 2024 12:39:27 -0800 Subject: [PATCH 09/17] Adding logging for for the case whe Launcher activity is not resumed after Back Bug: 322823209 Test: presubmit Flag: N/A Change-Id: I4e9b26ab142f4d69f906eeb6d5ab487babbcbca1 --- src/com/android/launcher3/BaseActivity.java | 6 ++++++ .../com/android/launcher3/testing/shared/TestProtocol.java | 1 + 2 files changed, 7 insertions(+) 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/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java index fe61992513..97da7df675 100644 --- a/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java +++ b/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java @@ -169,6 +169,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"; From 6999ed124dcae9f28dfdad505f9ac016620a0f5c Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Thu, 15 Feb 2024 13:22:27 -0800 Subject: [PATCH 10/17] Adding screen record for for the case when quick switch gesture doesn't do anything Bug: 313464374 Test: presubmit Flag: N/A Change-Id: I08e3f964cc0fbaebe4b077f08145dc54b967f936 --- .../tests/src/com/android/quickstep/TaplTestsQuickstep.java | 1 + 1 file changed, 1 insertion(+) 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); From 26447ddc981d2153969adb018e9d8784530102a6 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Thu, 15 Feb 2024 13:55:42 -0800 Subject: [PATCH 11/17] Notify home is visible when launching a translucent app. To fix the taskbar stash delay when launching an app, ag/18875100 sets the state so that the taskbar stashes immediately after app is launched. Since we cannot know if the app is translucent at that point, we have to check after the animation is started so we can update the launcher visibility state. Bug: 314792981 Flag: ACONFIG ENABLE_HOME_TRANSITION_LISTENER TRUNKFOOD Test: HomeObserverTest Change-Id: Ifc3a6559d7a8c6fda4c08a0fc2d6791da46b38d6 --- .../taskbar/LauncherTaskbarUIController.java | 1 + .../launcher3/taskbar/TaskbarUIController.java | 9 +++++++++ .../src/com/android/quickstep/TaskViewUtils.java | 16 ++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index e1b6494bd7..16246cd109 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/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/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index 8ff43f0122..d10b08f407 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); + } + } }); }); } From 334e9f38e2da61c3bc6003c7f67e3dd32108a868 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Fri, 16 Feb 2024 02:01:20 +0000 Subject: [PATCH 12/17] Revert "Use instrumentation arg to prevent unnecessary delays in unit tests" This reverts commit b5d08b246e875efdb3d8405501f481a6cc12b9f6. Reason for revert: A similar G3 CL was reverted: cl/582384131 Change-Id: If3e3d6f1aacd297ef357d6330ca3e98e857ea71d --- tests/Launcher3Tests.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Launcher3Tests.xml b/tests/Launcher3Tests.xml index 0aed1e1a67..3fff622857 100644 --- a/tests/Launcher3Tests.xml +++ b/tests/Launcher3Tests.xml @@ -46,6 +46,5 @@ From 89f72882cef2094fe306f9355b2294595eb6f5ee Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Tue, 13 Feb 2024 23:12:42 -0800 Subject: [PATCH 13/17] Guard taskbar / navbar unification logic with whether the device is a phone on top of the flag Test: Rerun the tapl tests Bug: 325162802 Change-Id: Iffeeb0a60b634e66bc80e4ba45db816cdc8ba564 --- .../android/launcher3/config/FeatureFlags.java | 15 ++++++++++++++- .../launcher3/testing/TestInformationHandler.java | 6 ++++++ .../launcher3/testing/shared/TestProtocol.java | 2 ++ .../launcher3/tapl/LauncherInstrumentation.java | 8 +++++++- 4 files changed, 29 insertions(+), 2 deletions(-) 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/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/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java index c750c7e4ff..5eae121979 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"; 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) { From b263e2d94a94511434b45042aa2cb5bf4418d861 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Thu, 15 Feb 2024 23:38:55 -0800 Subject: [PATCH 14/17] Update phone gesture nav test in NavButtonLayoutFactoryTest I think the test was written in the first version of NavButtonLayoutFactoryTest where phone gesture nav layouter didn't exist (verified with the revision history), hence updating the logic here Bug: 324989451 Test atest NavButtonLayoutFactoryTest Change-Id: I325a5d47db86add8d094e61b1de923f50a2db309 --- .../navbutton/NavButtonLayoutFactoryTest.kt | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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() { From f45d7f3450273ac767229dc0491f81108b95f1e3 Mon Sep 17 00:00:00 2001 From: Jakob Schneider Date: Fri, 16 Feb 2024 13:02:38 +0000 Subject: [PATCH 15/17] Fix two flag usages that I missed the last time around when I refactored it into the utilities class. Test: N/A Flag: NA Change-Id: If2c0824d7dd076bda68ee7d9c4f48889f4c8f4e1 --- src/com/android/launcher3/model/ItemInstallQueue.java | 5 +++-- src/com/android/launcher3/util/PackageManagerHelper.java | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) 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/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java index 50d8886980..75c727947b 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; @@ -259,6 +257,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); } } From bb13d787f08e52deb53c1184b41dc5b31f10f77f Mon Sep 17 00:00:00 2001 From: fbaron Date: Fri, 16 Feb 2024 09:15:46 -0800 Subject: [PATCH 16/17] Fix import for screenrecord accidentally imported the wrong screenrecord Bug: 322228038 Flag: NONE Test: TaplOpenCloseAllAppsTest#testAllAppsFromHome Change-Id: I80f0b3a9b376144ff4f75f5ce0fb98b1aed5985d --- .../com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 183614ca325efe6fc7e95ded180847b39bd61f1a Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Thu, 15 Feb 2024 18:43:37 -0800 Subject: [PATCH 17/17] Disabling hidden API checks for Launcher3 tests This makes atest config functionally identical to the GCL one that's used to run tests in the lab, and will help eliminating test errors in Launcher3 tests. Bug: 271324404 Test: presubmit Flag: N/A Change-Id: I35003bc7e7edd41c3db9c0ff7562f608a21b886e --- tests/Launcher3Tests.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Launcher3Tests.xml b/tests/Launcher3Tests.xml index 3fff622857..bcbe343913 100644 --- a/tests/Launcher3Tests.xml +++ b/tests/Launcher3Tests.xml @@ -46,5 +46,6 @@