From a44d255c8fe2f3cf0a8ee62fc6ddf4c8329b49e6 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Tue, 20 Sep 2022 17:41:13 -0500 Subject: [PATCH 01/11] Fix ReorderWidgets by removing faulty 4x4 cases Fix: 242323136 Test: atest ReorderWidgets (the device has to be cf_x86_64_phone-userdebug) Change-Id: Ic545409ecc20420be6c7377513c704822dbaf75e --- .../testcases/MoveOutReorderCase.java | 20 +------------------ .../celllayout/testcases/PushReorderCase.java | 20 +------------------ 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/tests/src/com/android/launcher3/celllayout/testcases/MoveOutReorderCase.java b/tests/src/com/android/launcher3/celllayout/testcases/MoveOutReorderCase.java index a222d3d551..047d3422df 100644 --- a/tests/src/com/android/launcher3/celllayout/testcases/MoveOutReorderCase.java +++ b/tests/src/com/android/launcher3/celllayout/testcases/MoveOutReorderCase.java @@ -63,25 +63,7 @@ public class MoveOutReorderCase { MOVE_TO_6x5, END_BOARD_STR_6x5); - /** 4x4 Test - **/ - private static final String START_BOARD_STR_4x4 = "" - + "xxxx\n" - + "34-m\n" - + "3511\n" - + "3211"; - private static final Point MOVE_TO_4x4 = new Point(1, 2); - private static final String END_BOARD_STR_4x4 = "" - + "xxxx\n" - + "345-\n" - + "3m11\n" - + "3211"; - private static final ReorderTestCase TEST_CASE_4x4 = new ReorderTestCase(START_BOARD_STR_4x4, - MOVE_TO_4x4, - END_BOARD_STR_4x4); - public static final Map TEST_BY_GRID_SIZE = Map.of(new Point(5, 5), TEST_CASE_5x5, - new Point(6, 5), TEST_CASE_6x5, - new Point(4, 4), TEST_CASE_4x4); + new Point(6, 5), TEST_CASE_6x5); } diff --git a/tests/src/com/android/launcher3/celllayout/testcases/PushReorderCase.java b/tests/src/com/android/launcher3/celllayout/testcases/PushReorderCase.java index e16ff42a8b..38c9aee0fd 100644 --- a/tests/src/com/android/launcher3/celllayout/testcases/PushReorderCase.java +++ b/tests/src/com/android/launcher3/celllayout/testcases/PushReorderCase.java @@ -64,25 +64,7 @@ public class PushReorderCase { MOVE_TO_6x5, END_BOARD_STR_6x5); - /** 4x4 Test - **/ - private static final String START_BOARD_STR_4x4 = "" - + "xxxx\n" - + "222m\n" - + "-111\n" - + "----"; - private static final Point MOVE_TO_4x4 = new Point(2, 1); - private static final String END_BOARD_STR_4x4 = "" - + "xxxx\n" - + "--m-\n" - + "222-\n" - + "-111"; - private static final ReorderTestCase TEST_CASE_4x4 = new ReorderTestCase(START_BOARD_STR_4x4, - MOVE_TO_4x4, - END_BOARD_STR_4x4); - public static final Map TEST_BY_GRID_SIZE = Map.of(new Point(5, 5), TEST_CASE_5x5, - new Point(6, 5), TEST_CASE_6x5, - new Point(4, 4), TEST_CASE_4x4); + new Point(6, 5), TEST_CASE_6x5); } From 7fd7e51fa2d94b6f1b2616383de64973cab35b32 Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Mon, 3 Oct 2022 17:46:03 -0700 Subject: [PATCH 02/11] Include additional error log around widget removal As observed in b/248291728, widgets are disappeared after OTA update, this CL includes additional logging to reveal more information. Bug: 248291728 Test: manual Change-Id: I5cf968efc358c3315e5e6ecc4861d5bc888569f1 --- src/com/android/launcher3/LauncherProvider.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java index a20ff8c06f..58e85fea7e 100644 --- a/src/com/android/launcher3/LauncherProvider.java +++ b/src/com/android/launcher3/LauncherProvider.java @@ -85,6 +85,7 @@ import java.util.Arrays; import java.util.Locale; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; +import java.util.stream.Collectors; public class LauncherProvider extends ContentProvider { private static final String TAG = "LauncherProvider"; @@ -944,16 +945,28 @@ public class LauncherProvider extends ContentProvider { final IntSet validWidgets = IntSet.wrap(LauncherDbUtils.queryIntArray(false, db, Favorites.TABLE_NAME, Favorites.APPWIDGET_ID, "itemType=" + Favorites.ITEM_TYPE_APPWIDGET, null, null)); + boolean isAnyWidgetRemoved = false; for (int widgetId : allWidgets) { if (!validWidgets.contains(widgetId)) { try { FileLog.d(TAG, "Deleting invalid widget " + widgetId); host.deleteAppWidgetId(widgetId); + isAnyWidgetRemoved = true; } catch (RuntimeException e) { // Ignore } } } + if (isAnyWidgetRemoved) { + final String allWidgetsIds = Arrays.stream(allWidgets).mapToObj(String::valueOf) + .collect(Collectors.joining(",", "[", "]")); + final String validWidgetsIds = Arrays.stream( + validWidgets.getArray().toArray()).mapToObj(String::valueOf) + .collect(Collectors.joining(",", "[", "]")); + FileLog.d(TAG, "One or more widgets was removed. db_path=" + db.getPath() + + " allWidgetsIds=" + allWidgetsIds + + ", validWidgetsIds=" + validWidgetsIds); + } } /** From e5a49f4b48c0ae1403ecdd793164cefe78c389c7 Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Mon, 3 Oct 2022 14:47:07 -0700 Subject: [PATCH 03/11] Hide FloatingHeaderView while in Search state. This prevents touches on the profile buttons (which were already hidden due to the header view having alpha 0, but touches were still registered). Fix: 248338523 Test: Manually tap where the work profile button is before and after this change. Before: switches to work profile. Afer: does nothing in 0 state; otherwise launches item at that position. Change-Id: Ie30661146d25740000d7a9cbe79234ac15347253 --- src/com/android/launcher3/allapps/BaseAllAppsContainerView.java | 2 ++ .../android/launcher3/allapps/SearchTransitionController.java | 1 + 2 files changed, 3 insertions(+) diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java index f08254204e..c717310659 100644 --- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java @@ -532,9 +532,11 @@ public abstract class BaseAllAppsContainerView Date: Tue, 4 Oct 2022 10:29:49 +0000 Subject: [PATCH 04/11] Remove stage concept from split screen APIs Since split screen has transferred from stage-based model to app-pair model. Update to remove the stage concept from split screen APIs, so the caller won't need to deal with stage concept. Bug: 250875492 Test: atest WMShellFlickerTests Test: manual check start tasks or start intent/shortcut with task flow Change-Id: I36bfb54f3f690cfafd18ba31ab23f5745ead6d97 --- .../com/android/quickstep/SystemUiProxy.java | 36 +++++++++---------- .../util/SplitSelectStateController.java | 28 ++++++--------- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 3b2df315b1..7186de702b 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -549,15 +549,15 @@ public class SystemUiProxy implements ISystemUiProxy { } /** Start multiple tasks in split-screen simultaneously. */ - public void startTasks(int mainTaskId, Bundle mainOptions, int sideTaskId, Bundle sideOptions, - @SplitConfigurationOptions.StagePosition int sidePosition, float splitRatio, + public void startTasks(int taskId1, Bundle options1, int taskId2, Bundle options2, + @SplitConfigurationOptions.StagePosition int splitPosition, float splitRatio, RemoteTransitionCompat remoteTransition, InstanceId instanceId) { if (mSystemUiProxy != null) { try { - mSplitScreen.startTasks(mainTaskId, mainOptions, sideTaskId, sideOptions, - sidePosition, splitRatio, remoteTransition.getTransition(), instanceId); + mSplitScreen.startTasks(taskId1, options1, taskId2, options2, splitPosition, + splitRatio, remoteTransition.getTransition(), instanceId); } catch (RemoteException e) { - Log.w(TAG, "Failed call startTask"); + Log.w(TAG, "Failed call startTasks"); } } } @@ -565,13 +565,13 @@ public class SystemUiProxy implements ISystemUiProxy { /** * Start multiple tasks in split-screen simultaneously. */ - public void startTasksWithLegacyTransition(int mainTaskId, Bundle mainOptions, int sideTaskId, - Bundle sideOptions, @SplitConfigurationOptions.StagePosition int sidePosition, + public void startTasksWithLegacyTransition(int taskId1, Bundle options1, int taskId2, + Bundle options2, @SplitConfigurationOptions.StagePosition int splitPosition, float splitRatio, RemoteAnimationAdapter adapter, InstanceId instanceId) { if (mSystemUiProxy != null) { try { - mSplitScreen.startTasksWithLegacyTransition(mainTaskId, mainOptions, sideTaskId, - sideOptions, sidePosition, splitRatio, adapter, instanceId); + mSplitScreen.startTasksWithLegacyTransition(taskId1, options1, taskId2, options2, + splitPosition, splitRatio, adapter, instanceId); } catch (RemoteException e) { Log.w(TAG, "Failed call startTasksWithLegacyTransition"); } @@ -579,28 +579,26 @@ public class SystemUiProxy implements ISystemUiProxy { } public void startIntentAndTaskWithLegacyTransition(PendingIntent pendingIntent, - Intent fillInIntent, int taskId, Bundle mainOptions, Bundle sideOptions, - @SplitConfigurationOptions.StagePosition int sidePosition, float splitRatio, + Intent fillInIntent, Bundle options1, int taskId, Bundle options2, + @SplitConfigurationOptions.StagePosition int splitPosition, float splitRatio, RemoteAnimationAdapter adapter, InstanceId instanceId) { if (mSystemUiProxy != null) { try { mSplitScreen.startIntentAndTaskWithLegacyTransition(pendingIntent, fillInIntent, - taskId, mainOptions, sideOptions, sidePosition, splitRatio, adapter, - instanceId); + options1, taskId, options2, splitPosition, splitRatio, adapter, instanceId); } catch (RemoteException e) { Log.w(TAG, "Failed call startIntentAndTaskWithLegacyTransition"); } } } - public void startShortcutAndTaskWithLegacyTransition(ShortcutInfo shortcutInfo, int taskId, - Bundle mainOptions, Bundle sideOptions, - @SplitConfigurationOptions.StagePosition int sidePosition, float splitRatio, - RemoteAnimationAdapter adapter, InstanceId instanceId) { + public void startShortcutAndTaskWithLegacyTransition(ShortcutInfo shortcutInfo, Bundle options1, + int taskId, Bundle options2, @SplitConfigurationOptions.StagePosition int splitPosition, + float splitRatio, RemoteAnimationAdapter adapter, InstanceId instanceId) { if (mSystemUiProxy != null) { try { - mSplitScreen.startShortcutAndTaskWithLegacyTransition(shortcutInfo, taskId, - mainOptions, sideOptions, sidePosition, splitRatio, adapter, instanceId); + mSplitScreen.startShortcutAndTaskWithLegacyTransition(shortcutInfo, options1, + taskId, options2, splitPosition, splitRatio, adapter, instanceId); } catch (RemoteException e) { Log.w(TAG, "Failed call startShortcutAndTaskWithLegacyTransition"); } diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index efbe783125..19709d80b8 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -22,8 +22,6 @@ import static android.app.PendingIntent.FLAG_MUTABLE; import static com.android.launcher3.Utilities.postAsyncCallback; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.SplitConfigurationOptions.DEFAULT_SPLIT_RATIO; -import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT; -import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT; import android.annotation.NonNull; import android.app.ActivityOptions; @@ -216,16 +214,12 @@ public class SplitSelectStateController { @Nullable InstanceId shellInstanceId) { TestLogging.recordEvent( TestProtocol.SEQUENCE_MAIN, "launchSplitTasks"); - // Assume initial task is for top/left part of screen - final int[] taskIds = stagePosition == STAGE_POSITION_TOP_OR_LEFT - ? new int[]{taskId1, taskId2} - : new int[]{taskId2, taskId1}; if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { RemoteSplitLaunchTransitionRunner animationRunner = new RemoteSplitLaunchTransitionRunner(taskId1, taskPendingIntent, taskId2, callback); - mSystemUiProxy.startTasks(taskIds[0], null /* mainOptions */, taskIds[1], - null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT, splitRatio, + mSystemUiProxy.startTasks(taskId1, null /* options1 */, taskId2, + null /* options2 */, stagePosition, splitRatio, new RemoteTransitionCompat(animationRunner, MAIN_EXECUTOR, ActivityThread.currentActivityThread().getApplicationThread()), shellInstanceId); @@ -239,24 +233,24 @@ public class SplitSelectStateController { 300, 150, ActivityThread.currentActivityThread().getApplicationThread()); - ActivityOptions mainOpts = ActivityOptions.makeBasic(); + ActivityOptions options1 = ActivityOptions.makeBasic(); if (freezeTaskList) { - mainOpts.setFreezeRecentTasksReordering(); + options1.setFreezeRecentTasksReordering(); } if (taskPendingIntent == null) { - mSystemUiProxy.startTasksWithLegacyTransition(taskIds[0], mainOpts.toBundle(), - taskIds[1], null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT, - splitRatio, adapter, shellInstanceId); + mSystemUiProxy.startTasksWithLegacyTransition(taskId1, options1.toBundle(), + taskId2, null /* options2 */, stagePosition, splitRatio, adapter, + shellInstanceId); } else { final ShortcutInfo shortcutInfo = getShortcutInfo(mInitialTaskIntent, taskPendingIntent.getCreatorUserHandle()); if (shortcutInfo != null) { - mSystemUiProxy.startShortcutAndTaskWithLegacyTransition(shortcutInfo, taskId2, - mainOpts.toBundle(), null /* sideOptions */, stagePosition, splitRatio, - adapter, shellInstanceId); + mSystemUiProxy.startShortcutAndTaskWithLegacyTransition(shortcutInfo, + options1.toBundle(), taskId2, null /* options2 */, stagePosition, + splitRatio, adapter, shellInstanceId); } else { mSystemUiProxy.startIntentAndTaskWithLegacyTransition(taskPendingIntent, - fillInIntent, taskId2, mainOpts.toBundle(), null /* sideOptions */, + fillInIntent, options1.toBundle(), taskId2, null /* options2 */, stagePosition, splitRatio, adapter, shellInstanceId); } } From 3d39bfcda7ea6011994da019a5e9e06b3dda3413 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Tue, 4 Oct 2022 14:41:26 +0000 Subject: [PATCH 05/11] Support starts a pair of intent/shortcut and task to split Add startIntentAndTask and startShortcutAndTask APIs to support starts a pair of intent/shortcut and task to split with shell-transition. Fix: 250875492 Test: atest WMShellFlickerTests Test: manual check start tasks or start intent/shortcut with task flow with shell-transition enabled Change-Id: Ibce60f3a10e2bbc99ef17185f45680dc23ef5f48 --- .../com/android/quickstep/SystemUiProxy.java | 28 ++++++++++++++ .../com/android/quickstep/TaskViewUtils.java | 7 ++-- .../util/SplitSelectStateController.java | 38 +++++++++++++------ 3 files changed, 58 insertions(+), 15 deletions(-) diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 7186de702b..a07feff8d1 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -562,6 +562,34 @@ public class SystemUiProxy implements ISystemUiProxy { } } + public void startIntentAndTask(PendingIntent pendingIntent, Intent fillInIntent, + Bundle options1, int taskId, Bundle options2, + @SplitConfigurationOptions.StagePosition int splitPosition, float splitRatio, + RemoteTransitionCompat remoteTransition, InstanceId instanceId) { + if (mSystemUiProxy != null) { + try { + mSplitScreen.startIntentAndTask(pendingIntent, fillInIntent, options1, + taskId, options2, splitPosition, splitRatio, + remoteTransition.getTransition(), instanceId); + } catch (RemoteException e) { + Log.w(TAG, "Failed call startIntentAndTask"); + } + } + } + + public void startShortcutAndTask(ShortcutInfo shortcutInfo, Bundle options1, int taskId, + Bundle options2, @SplitConfigurationOptions.StagePosition int splitPosition, + float splitRatio, RemoteTransitionCompat remoteTransition, InstanceId instanceId) { + if (mSystemUiProxy != null) { + try { + mSplitScreen.startShortcutAndTask(shortcutInfo, options1, taskId, options2, + splitPosition, splitRatio, remoteTransition.getTransition(), instanceId); + } catch (RemoteException e) { + Log.w(TAG, "Failed call startShortcutAndTask"); + } + } + } + /** * Start multiple tasks in split-screen simultaneously. */ diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index a96524e186..73e9a28438 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -15,7 +15,6 @@ */ package com.android.quickstep; -import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.TRANSIT_TO_FRONT; @@ -426,8 +425,10 @@ public final class TaskViewUtils { TransitionInfo.Change splitRoot2 = null; for (int i = 0; i < transitionInfo.getChanges().size(); ++i) { final TransitionInfo.Change change = transitionInfo.getChanges().get(i); - final int taskId = change.getTaskInfo() != null ? change.getTaskInfo().taskId : -1; + if (change.getTaskInfo() == null) continue; + final int taskId = change.getTaskInfo().taskId; final int mode = change.getMode(); + // Find the target tasks' root tasks since those are the split stages that need to // be animated (the tasks themselves are children and thus inherit animation). if (taskId == initialTaskId || taskId == secondTaskId) { @@ -440,7 +441,7 @@ public final class TaskViewUtils { + "root of " + taskId + " is already visible or has broken hierarchy."); } } - if (taskId == initialTaskId && initialTaskId != INVALID_TASK_ID) { + if (taskId == initialTaskId) { splitRoot1 = transitionInfo.getChange(change.getParent()); } if (taskId == secondTaskId) { diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index 19709d80b8..f07f9903c2 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -214,18 +214,36 @@ public class SplitSelectStateController { @Nullable InstanceId shellInstanceId) { TestLogging.recordEvent( TestProtocol.SEQUENCE_MAIN, "launchSplitTasks"); + final ActivityOptions options1 = ActivityOptions.makeBasic(); + if (freezeTaskList) { + options1.setFreezeRecentTasksReordering(); + } if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { - RemoteSplitLaunchTransitionRunner animationRunner = + final RemoteSplitLaunchTransitionRunner animationRunner = new RemoteSplitLaunchTransitionRunner(taskId1, taskPendingIntent, taskId2, callback); - mSystemUiProxy.startTasks(taskId1, null /* options1 */, taskId2, - null /* options2 */, stagePosition, splitRatio, - new RemoteTransitionCompat(animationRunner, MAIN_EXECUTOR, - ActivityThread.currentActivityThread().getApplicationThread()), - shellInstanceId); - // TODO(b/237635859): handle intent/shortcut + task with shell transition + final RemoteTransitionCompat remoteTransition = new RemoteTransitionCompat( + animationRunner, MAIN_EXECUTOR, + ActivityThread.currentActivityThread().getApplicationThread()); + if (taskPendingIntent == null) { + mSystemUiProxy.startTasks(taskId1, options1.toBundle(), taskId2, + null /* options2 */, stagePosition, splitRatio, remoteTransition, + shellInstanceId); + } else { + final ShortcutInfo shortcutInfo = getShortcutInfo(mInitialTaskIntent, + taskPendingIntent.getCreatorUserHandle()); + if (shortcutInfo != null) { + mSystemUiProxy.startShortcutAndTask(shortcutInfo, + options1.toBundle(), taskId2, null /* options2 */, stagePosition, + splitRatio, remoteTransition, shellInstanceId); + } else { + mSystemUiProxy.startIntentAndTask(taskPendingIntent, + fillInIntent, options1.toBundle(), taskId2, null /* options2 */, + stagePosition, splitRatio, remoteTransition, shellInstanceId); + } + } } else { - RemoteSplitLaunchAnimationRunner animationRunner = + final RemoteSplitLaunchAnimationRunner animationRunner = new RemoteSplitLaunchAnimationRunner(taskId1, taskPendingIntent, taskId2, callback); final RemoteAnimationAdapter adapter = new RemoteAnimationAdapter( @@ -233,10 +251,6 @@ public class SplitSelectStateController { 300, 150, ActivityThread.currentActivityThread().getApplicationThread()); - ActivityOptions options1 = ActivityOptions.makeBasic(); - if (freezeTaskList) { - options1.setFreezeRecentTasksReordering(); - } if (taskPendingIntent == null) { mSystemUiProxy.startTasksWithLegacyTransition(taskId1, options1.toBundle(), taskId2, null /* options2 */, stagePosition, splitRatio, adapter, From 0d3c3d8fc551cab0fad8a47375898bcbf5acd3cf Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Wed, 5 Oct 2022 00:57:09 -0700 Subject: [PATCH 06/11] Differentiate between app row and shortcut icons. This is a simplified version of ag/20118087. It fixes the bug with rows of shortcuts being in the search results (e.g. Gmail and WhatsApp conversations), but it will not handle cases where there are multiple rows of app icons. Currently I do not know of any cases where that would happen. Test: Manual with and without inject_web_top (which moves app row) for WhatsApp and Gmail with AiAi fishfood. Bug: 239927522 Change-Id: Ie9c62c0ee81086801942328c8770f37d5bf622c3 --- .../launcher3/allapps/SearchTransitionController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/SearchTransitionController.java b/src/com/android/launcher3/allapps/SearchTransitionController.java index a1f5bc696f..11ceb0a55c 100644 --- a/src/com/android/launcher3/allapps/SearchTransitionController.java +++ b/src/com/android/launcher3/allapps/SearchTransitionController.java @@ -20,6 +20,7 @@ import static android.view.View.VISIBLE; import static androidx.recyclerview.widget.RecyclerView.NO_POSITION; +import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; @@ -38,6 +39,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.Utilities; +import com.android.launcher3.model.data.ItemInfo; /** Coordinates the transition between Search and A-Z in All Apps. */ public class SearchTransitionController { @@ -186,7 +188,9 @@ public class SearchTransitionController { top = searchResultView.getTop(); } - if (searchResultView instanceof BubbleTextView) { + if (searchResultView instanceof BubbleTextView + && searchResultView.getTag() instanceof ItemInfo + && ((ItemInfo) searchResultView.getTag()).itemType == ITEM_TYPE_APPLICATION) { // The first app icon will set appRowHeight, which will also contribute to // totalHeight. Additional app icons should remove the appRowHeight to remain in // the same row as the first app. @@ -196,6 +200,8 @@ public class SearchTransitionController { totalHeight += appRowHeight; } // Don't scale/fade app row. + searchResultView.setScaleY(1); + searchResultView.setAlpha(1); continue; } From 24b9554086b85766974e875fd1e592ff093ddf59 Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Tue, 9 Aug 2022 18:06:58 +0100 Subject: [PATCH 07/11] Add logging to help debug flake when swiping home to overview. Bug: 238461210 Bug: 246283207 Test: TaplTestsQuickstep#testSwitchToOverview Change-Id: I8ee9af4f4a331c43761ba3738e12acb376ababc2 (cherry picked from commit 1edba8b0a6026b04c667343608b5309b5be3248d) Merged-In: I8ee9af4f4a331c43761ba3738e12acb376ababc2 --- .../uioverrides/RecentsViewStateController.java | 9 +++++++++ .../src/com/android/quickstep/views/RecentsView.java | 7 +++++++ src/com/android/launcher3/PagedView.java | 7 +++++++ 3 files changed, 23 insertions(+) diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java index 910b99b36a..3fe2e59471 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java @@ -31,11 +31,13 @@ import android.animation.AnimatorSet; import android.annotation.TargetApi; import android.os.Build; import android.util.FloatProperty; +import android.util.Log; import android.util.Pair; import androidx.annotation.NonNull; import com.android.launcher3.LauncherState; +import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatorListeners; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.PropertySetter; @@ -88,6 +90,13 @@ public final class RecentsViewStateController extends // While animating into recents, update the visible task data as needed builder.addOnFrameCallback(() -> mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL)); mRecentsView.updateEmptyMessage(); + // TODO(b/238461210): Remove logging once root cause of flake detected. + if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { + Log.d("b/238461210", "RecentsView#setStateWithAnimationInternal getCurrentPage(): " + + mRecentsView.getCurrentPage() + + ", getScrollForPage(getCurrentPage())): " + + mRecentsView.getScrollForPage(mRecentsView.getCurrentPage())); + } } else { builder.addListener( AnimatorListeners.forSuccessCallback(mRecentsView::resetTaskVisuals)); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 68b80c26f6..5b4415a440 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1505,6 +1505,13 @@ public abstract class RecentsView !settlingOnNewTask -> " + + "previousCurrentPage: " + previousCurrentPage + + ", getScrollForPage(previousCurrentPage): " + + getScrollForPage(previousCurrentPage)); + } setCurrentPage(previousCurrentPage); } diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 68c54c7667..377843cb3b 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -772,6 +772,13 @@ public abstract class PagedView extends ViewGrou } if (mScroller.isFinished() && pageScrollChanged) { + // TODO(b/238461210): Remove logging once root cause of flake detected. + if (Utilities.IS_RUNNING_IN_TEST_HARNESS && !(this instanceof Workspace)) { + Log.d("b/238461210", this.getClass().getSimpleName() + "#onLayout() -> " + + "if(mScroller.isFinished() && pageScrollChanged) -> getNextPage(): " + + getNextPage() + ", getScrollForPage(getNextPage()): " + + getScrollForPage(getNextPage())); + } setCurrentPage(getNextPage()); } onPageScrollsInitialized(); From 2b17c4b9d081d2da975617b3fe057b06554e17c6 Mon Sep 17 00:00:00 2001 From: Holly Sun Date: Mon, 19 Sep 2022 10:24:43 -0700 Subject: [PATCH 08/11] Quick launch v2. Set auto-append text in selected text mode. Clicking enter key launches the app. Delete the selected text to remove auto-append text and highlight. Clicking enter key sends raw query to search. Test: manual Bug: 210661150 Change-Id: Iee8e716b81a2dde64e60462fd33d4a6eb4abcf01 --- .../launcher3/allapps/search/AllAppsSearchBarController.java | 5 ++++- src/com/android/launcher3/config/FeatureFlags.java | 4 ++++ src/com/android/launcher3/util/LogConfig.java | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java index 886460e5c7..4c461aa5d4 100644 --- a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java +++ b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java @@ -84,7 +84,10 @@ public class AllAppsSearchBarController mTextConversions = extractTextConversions(s); } - private static String[] extractTextConversions(CharSequence text) { + /** + * Extract text conversions from composing text and send them for search. + */ + public static String[] extractTextConversions(CharSequence text) { if (text instanceof SpannableStringBuilder) { SpannableStringBuilder spanned = (SpannableStringBuilder) text; SuggestionSpan[] suggestionSpans = diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index a2d9dd400c..882d6a6323 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -91,6 +91,10 @@ public final class FeatureFlags { getDebugFlag("ENABLE_FLOATING_SEARCH_BAR", false, "Keep All Apps search bar at the bottom (but above keyboard if open)"); + public static final BooleanFlag ENABLE_QUICK_LAUNCH_V2 = new DeviceFlag( + "ENABLE_QUICK_LAUNCH_V2", false, "Use quick launch v2 " + + "behavior. Quick search and quick launch v1 would be unavailable if this is enabled"); + public static final BooleanFlag ENABLE_HIDE_HEADER = new DeviceFlag("ENABLE_HIDE_HEADER", true, "Hide header on keyboard before typing in all apps"); diff --git a/src/com/android/launcher3/util/LogConfig.java b/src/com/android/launcher3/util/LogConfig.java index ee1d1ff361..5abf95c000 100644 --- a/src/com/android/launcher3/util/LogConfig.java +++ b/src/com/android/launcher3/util/LogConfig.java @@ -50,4 +50,9 @@ public class LogConfig { * When turned on, we enable web suggest appSearch related logging. */ public static final String WEB_APP_SEARCH_LOGGING = "WebAppSearchLogging"; + + /** + * When turned on, we enable quick launch v2 related logging. + */ + public static final String QUICK_LAUNCH_V2 = "QuickLaunchV2"; } From 73ab56a355e41566333b9d3a4f47ac63c67f1f32 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 26 Sep 2022 21:24:23 +0000 Subject: [PATCH 09/11] Update constants used for resolving shell services Bug: 238217847 Test: atest WMShellUnitTests Change-Id: I0bf0d258fb9c6c9e7d6ce2a17bd120fe7a45ad9f Merged-In: I0bf0d258fb9c6c9e7d6ce2a17bd120fe7a45ad9f --- .../quickstep/TouchInteractionService.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 1999701f61..148866fdcc 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -26,19 +26,19 @@ import static com.android.quickstep.GestureState.DEFAULT_STATE; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_DOWN; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_UP; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_RECENT_TASKS; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_BACK_ANIMATION; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_DESKTOP_MODE; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_FLOATING_TASKS; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_ONE_HANDED; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_PIP; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_SHELL_TRANSITIONS; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_SPLIT_SCREEN; -import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_STARTING_WINDOW; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY; 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_TRACING_ENABLED; +import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_BACK_ANIMATION; +import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_DESKTOP_MODE; +import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_FLOATING_TASKS; +import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_ONE_HANDED; +import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_PIP; +import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_RECENT_TASKS; +import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_SHELL_TRANSITIONS; +import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_SPLIT_SCREEN; +import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_STARTING_WINDOW; import android.annotation.TargetApi; import android.app.PendingIntent; @@ -183,7 +183,7 @@ public class TouchInteractionService extends Service ISysuiUnlockAnimationController.Stub.asInterface( bundle.getBinder(KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER)); IRecentTasks recentTasks = IRecentTasks.Stub.asInterface( - bundle.getBinder(KEY_EXTRA_RECENT_TASKS)); + bundle.getBinder(KEY_EXTRA_SHELL_RECENT_TASKS)); IBackAnimation backAnimation = IBackAnimation.Stub.asInterface( bundle.getBinder(KEY_EXTRA_SHELL_BACK_ANIMATION)); IDesktopMode desktopMode = IDesktopMode.Stub.asInterface( From a1d24cb85e38276b52ed169c080d4e771f2af761 Mon Sep 17 00:00:00 2001 From: Jeremy Sim Date: Thu, 6 Oct 2022 16:23:20 -0700 Subject: [PATCH 10/11] Use correct interpolator for tablet split confirm This patch makes it so that the split-to-confirm animation on tablets uses the EMPHASIZED interpolator instead of the (incorrect) LINEAR interpolator. Fixes: 241126570 Test: Manual Change-Id: Ic3c91d439a79a492da7f32bdcd56b954edf6c947 --- .../quickstep/util/PhoneSplitToConfirmTimings.java | 8 -------- .../android/quickstep/util/SplitToConfirmTimings.java | 10 ++++++---- .../quickstep/util/TabletSplitToConfirmTimings.java | 8 -------- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/PhoneSplitToConfirmTimings.java b/quickstep/src/com/android/quickstep/util/PhoneSplitToConfirmTimings.java index 9e7351a2de..3d9e09ee81 100644 --- a/quickstep/src/com/android/quickstep/util/PhoneSplitToConfirmTimings.java +++ b/quickstep/src/com/android/quickstep/util/PhoneSplitToConfirmTimings.java @@ -16,10 +16,6 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; - -import android.view.animation.Interpolator; - /** * Timings for the OverviewSplitSelect > confirmed animation on phones. */ @@ -33,8 +29,4 @@ public class PhoneSplitToConfirmTimings public int getStagedRectSlideEnd() { return 333; } public int getDuration() { return PHONE_CONFIRM_DURATION; } - public Interpolator getStagedRectXInterpolator() { return EMPHASIZED; } - public Interpolator getStagedRectYInterpolator() { return EMPHASIZED; } - public Interpolator getStagedRectScaleXInterpolator() { return EMPHASIZED; } - public Interpolator getStagedRectScaleYInterpolator() { return EMPHASIZED; } } diff --git a/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java b/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java index 3026e98aa9..f5b00cf42b 100644 --- a/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java +++ b/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java @@ -16,6 +16,8 @@ package com.android.quickstep.util; +import static com.android.launcher3.anim.Interpolators.EMPHASIZED; + import android.view.animation.Interpolator; /** @@ -33,12 +35,12 @@ abstract class SplitToConfirmTimings implements SplitAnimationTimings { // Common timings public int getInstructionsFadeStart() { return 0; } public int getInstructionsFadeEnd() { return 67; } + public Interpolator getStagedRectXInterpolator() { return EMPHASIZED; } + public Interpolator getStagedRectYInterpolator() { return EMPHASIZED; } + public Interpolator getStagedRectScaleXInterpolator() { return EMPHASIZED; } + public Interpolator getStagedRectScaleYInterpolator() { return EMPHASIZED; } abstract public int getDuration(); - abstract public Interpolator getStagedRectXInterpolator(); - abstract public Interpolator getStagedRectYInterpolator(); - abstract public Interpolator getStagedRectScaleXInterpolator(); - abstract public Interpolator getStagedRectScaleYInterpolator(); public float getInstructionsFadeStartOffset() { return (float) getInstructionsFadeStart() / getDuration(); diff --git a/quickstep/src/com/android/quickstep/util/TabletSplitToConfirmTimings.java b/quickstep/src/com/android/quickstep/util/TabletSplitToConfirmTimings.java index 3ea8466148..580cc99d4e 100644 --- a/quickstep/src/com/android/quickstep/util/TabletSplitToConfirmTimings.java +++ b/quickstep/src/com/android/quickstep/util/TabletSplitToConfirmTimings.java @@ -16,10 +16,6 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.LINEAR; - -import android.view.animation.Interpolator; - /** * Timings for the OverviewSplitSelect > confirmed animation on tablets. */ @@ -33,8 +29,4 @@ public class TabletSplitToConfirmTimings public int getStagedRectSlideEnd() { return 383; } public int getDuration() { return TABLET_CONFIRM_DURATION; } - public Interpolator getStagedRectXInterpolator() { return LINEAR; } - public Interpolator getStagedRectYInterpolator() { return LINEAR; } - public Interpolator getStagedRectScaleXInterpolator() { return LINEAR; } - public Interpolator getStagedRectScaleYInterpolator() { return LINEAR; } } From 696fbd66bd281215166258b2de007c14a1cecbfa Mon Sep 17 00:00:00 2001 From: Jeremy Sim Date: Wed, 5 Oct 2022 16:26:04 -0700 Subject: [PATCH 11/11] Fix bug with DWB banners causing Action Bar to vanish This patch fixes a bug where entering Overview with 3+ DWB banners active would cause the Actions Bar to disappear, rendering it unusable. The bug occurred because while the Actions Bar was animating itself in, the entry animation of the DWB banners caused a competing animation to be fired, which attempted to set the Actions Bar alpha back to 0 in a race-conditiony situation. Fixed by using setAutoCancel() on the Actions View alpha animator, which auto-cancels a running animation when another animation is called on the same target, preventing race conditions. Outstanding issue: 251277899 Fixes: 241163178 Test: Manual Change-Id: I4edb5678b4aad5612cd5ef58141d8e22bf8587f0 --- quickstep/src/com/android/quickstep/views/RecentsView.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index d9a4be8c7e..e344bee176 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1878,6 +1878,8 @@ public abstract class RecentsView