From 55e648f6820eb616ddf449baa88ac087270d40d0 Mon Sep 17 00:00:00 2001 From: Fengjiang Li Date: Tue, 18 Apr 2023 11:16:16 -0700 Subject: [PATCH 1/8] Fix NPE of predictive back in TaskbarAllAppsSlideInView Fix: 278597104 Test: tested predictive back in taskbar all apps view Change-Id: I32e3cba5d26b3d05e9b7af584598bf04e512a684 --- .../allapps/TaskbarAllAppsSlideInView.java | 27 ++++++++++++------- .../launcher3/config/FeatureFlags.java | 2 +- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java index d69769a8a4..f0d28dfd05 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java @@ -71,13 +71,6 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView Date: Mon, 13 Feb 2023 18:09:24 +0000 Subject: [PATCH 2/8] Add custom widget category for Note Taking Test: manual Flag: not needed Fixes: b/261853771 Change-Id: I493fd782cf8569ee9efca5134eefb5652a2bf972 --- .../ic_note_taking_widget_category.xml | 33 +++++++++++++++++++ res/values/strings.xml | 3 ++ res/xml/widget_sections.xml | 6 ++++ 3 files changed, 42 insertions(+) create mode 100644 res/drawable/ic_note_taking_widget_category.xml diff --git a/res/drawable/ic_note_taking_widget_category.xml b/res/drawable/ic_note_taking_widget_category.xml new file mode 100644 index 0000000000..2b5915736f --- /dev/null +++ b/res/drawable/ic_note_taking_widget_category.xml @@ -0,0 +1,33 @@ + + + + + + + + + + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index b54d4f795e..c2eb3735af 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -106,6 +106,9 @@ Conversations + + Note-taking + Useful info at your fingertips diff --git a/res/xml/widget_sections.xml b/res/xml/widget_sections.xml index d755de6f8a..6165bf7051 100644 --- a/res/xml/widget_sections.xml +++ b/res/xml/widget_sections.xml @@ -22,4 +22,10 @@ launcher:sectionTitle="@string/widget_category_conversations"> +
+ +
\ No newline at end of file From 3bb1c1c125f89b80d53615923db8a103202832c3 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Thu, 20 Apr 2023 14:20:36 -0700 Subject: [PATCH 3/8] Prevent null pointer exception by return from setBackToLauncherCallback when mBackToLauncherCallback is null This change is needed because of ag/22360314 Fix: 277964328 Test: Compiles Change-Id: Ib03bbf9d60b2a2b0a8207d3ba2a4c1019cc1b8f7 --- quickstep/src/com/android/quickstep/SystemUiProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 512d47e6c7..fdb30cedf3 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -967,7 +967,7 @@ public class SystemUiProxy implements ISystemUiProxy { IRemoteAnimationRunner runner) { mBackToLauncherCallback = callback; mBackToLauncherRunner = runner; - if (mBackAnimation == null) { + if (mBackAnimation == null || mBackToLauncherCallback == null) { return; } try { From a85b629d1268dd5a9329d1ba09f2dc9a62f7c668 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Mon, 24 Apr 2023 14:39:08 -0700 Subject: [PATCH 4/8] Add link to block directory Flag: not needed Bug: 278771275 Test: ran launcher Change-Id: I6fc37d73a73265520c62c95167fd730095dd81e6 --- src/com/android/launcher3/config/FeatureFlags.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index cdebe440a1..8cfd326ea6 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -35,6 +35,12 @@ import java.util.function.ToIntFunction; /** * Defines a set of flags used to control various launcher behaviors. * + * Please only add flags to your assigned block to prevent merge conflicts. If you do not have + * a block, please update the current empty block and add a new empty block below to prevent + * merge conflicts with the previous block. + * List of blocks can be found: + * here + * *

All the flags should be defined here with appropriate default values. */ public final class FeatureFlags { @@ -74,9 +80,6 @@ public final class FeatureFlags { * Declare a new ToggleableFlag below. Give it a unique key (e.g. "QSB_ON_FIRST_SCREEN"), * and set a default value for the flag. This will be the default value on Debug builds. *

- * Please only add flags to your assigned block to prevent merge conflicts. If you do not have - * a block, please update the current empty block and add a new empty block below to prevent - * merge conflicts with the previous block. */ // TODO(Block 1): Clean up flags public static final BooleanFlag ENABLE_ONE_SEARCH_MOTION = getReleaseFlag(270394223, From c91053e9af9af4d59e08d9d2243a7325573fe798 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Mon, 24 Apr 2023 21:18:23 -0700 Subject: [PATCH 5/8] Move Block 23 flag back into its section * Seems like with the recent atmospheric river this feature flag may have slipped out from it's block. Bug: 278771275 Flag: not needed Change-Id: I3aa8e70207ea29319b8854ff5d995dc61bc41ef2 --- src/com/android/launcher3/config/FeatureFlags.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 8cfd326ea6..511392c437 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -315,6 +315,10 @@ public final class FeatureFlags { "ENABLE_GRID_ONLY_OVERVIEW", DISABLED, "Enable a grid-only overview without a focused task."); + public static final BooleanFlag ENABLE_CURSOR_HOVER_STATES = getDebugFlag(243191650, + "ENABLE_CURSOR_HOVER_STATES", DISABLED, + "Enables cursor hover states for certain elements."); + // TODO(Block 24): Clean up flags public static final BooleanFlag ENABLE_NEW_MIGRATION_LOGIC = getDebugFlag(270393455, "ENABLE_NEW_MIGRATION_LOGIC", ENABLED, @@ -401,10 +405,6 @@ public final class FeatureFlags { // TODO(Block 31): Empty block - public static final BooleanFlag ENABLE_CURSOR_HOVER_STATES = getDebugFlag(243191650, - "ENABLE_CURSOR_HOVER_STATES", DISABLED, - "Enables cursor hover states for certain elements."); - public static class BooleanFlag { private final boolean mCurrentValue; From 1bb594c72b768fc116258cb3d7362fcc0cafe033 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Tue, 18 Apr 2023 18:20:01 -0700 Subject: [PATCH 6/8] Route PredictedAppIcon clicks through launcher * This allows us to intercept launching predicted apps for split-screen if user is in split selection flow * Defaults to existing behavior of ItemClickHandler.INSTANCE if we do not need to intercept the click Bug: 276361926 Flag: ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE Test: Launches as expected when not in split, launches in split when selected as second app to initiate split with Change-Id: Ieb45137ae89da340d314e995f4f6eb1f8b49a42f --- .../com/android/launcher3/uioverrides/PredictedAppIcon.java | 5 +++-- src/com/android/launcher3/folder/FolderIcon.java | 2 +- src/com/android/launcher3/folder/FolderPagedView.java | 2 +- .../android/launcher3/widget/PendingAppWidgetHostView.java | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java index 3990dade70..0eef70e270 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java +++ b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java @@ -402,8 +402,9 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView { PredictedAppIcon icon = (PredictedAppIcon) LayoutInflater.from(parent.getContext()) .inflate(R.layout.predicted_app_icon, parent, false); icon.applyFromWorkspaceItem(info); - icon.setOnClickListener(ItemClickHandler.INSTANCE); - icon.setOnFocusChangeListener(Launcher.getLauncher(parent.getContext()).getFocusHandler()); + Launcher launcher = Launcher.getLauncher(parent.getContext()); + icon.setOnClickListener(launcher.getItemOnClickListener()); + icon.setOnFocusChangeListener(launcher.getFocusHandler()); return icon; } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index 86f4beb6c4..48239ae06d 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -205,7 +205,7 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel lp.topMargin = grid.iconSizePx + grid.iconDrawablePaddingPx; icon.setTag(folderInfo); - icon.setOnClickListener(ItemClickHandler.INSTANCE); + icon.setOnClickListener(activity.getItemOnClickListener()); icon.mInfo = folderInfo; icon.mActivity = activity; icon.mDotRenderer = grid.mDotRendererWorkSpace; diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java index d43731b998..6ff8ece5d7 100644 --- a/src/com/android/launcher3/folder/FolderPagedView.java +++ b/src/com/android/launcher3/folder/FolderPagedView.java @@ -216,7 +216,7 @@ public class FolderPagedView extends PagedView implements Cli final BubbleTextView textView = mViewCache.getView( R.layout.folder_application, getContext(), null); textView.applyFromWorkspaceItem(item); - textView.setOnClickListener(ItemClickHandler.INSTANCE); + textView.setOnClickListener(mFolder.mActivityContext.getItemOnClickListener()); textView.setOnLongClickListener(mFolder); textView.setOnFocusChangeListener(mFocusIndicatorHelper); CellLayoutLayoutParams lp = (CellLayoutLayoutParams) textView.getLayoutParams(); diff --git a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java index 130ee3a70c..1c88c4a466 100644 --- a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java +++ b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java @@ -86,7 +86,7 @@ public class PendingAppWidgetHostView extends LauncherAppWidgetHostView setWillNotDraw(false); super.updateAppWidget(null); - setOnClickListener(ItemClickHandler.INSTANCE); + setOnClickListener(mLauncher.getItemOnClickListener()); if (info.pendingItemInfo == null) { info.pendingItemInfo = new PackageItemInfo(info.providerName.getPackageName(), From 33bcdbbb9db65540beb0f8be4a60f44af9eec70c Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Tue, 25 Apr 2023 11:30:28 -0700 Subject: [PATCH 7/8] Commit to OtherActivityInputConsumer when swiping up in app Fixes: 279634432 Test: swipe up and then immediately down, making sure that the notification shade is not brought down Change-Id: I5ffdab6cef8162d0f0783c5d4a761197952209dd --- .../StatusBarInputConsumer.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/quickstep/inputconsumers/StatusBarInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/StatusBarInputConsumer.java index f3d2a60b15..898aa8640d 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/StatusBarInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/StatusBarInputConsumer.java @@ -33,6 +33,7 @@ public class StatusBarInputConsumer extends DelegateInputConsumer { private final SystemUiProxy mSystemUiProxy; private final float mTouchSlop; private final PointF mDown = new PointF(); + private boolean mHasPassedTouchSlop; public StatusBarInputConsumer(Context context, InputConsumer delegate, InputMonitorCompat inputMonitor) { @@ -53,13 +54,21 @@ public class StatusBarInputConsumer extends DelegateInputConsumer { mDelegate.onMotionEvent(ev); switch (ev.getActionMasked()) { - case ACTION_DOWN -> mDown.set(ev.getX(), ev.getY()); + case ACTION_DOWN -> { + mDown.set(ev.getX(), ev.getY()); + mHasPassedTouchSlop = false; + } case ACTION_MOVE -> { - float displacementY = ev.getY() - mDown.y; - if (displacementY > mTouchSlop) { - setActive(ev); - ev.setAction(ACTION_DOWN); - dispatchTouchEvent(ev); + if (!mHasPassedTouchSlop) { + float displacementY = ev.getY() - mDown.y; + if (Math.abs(displacementY) > mTouchSlop) { + mHasPassedTouchSlop = true; + if (displacementY > 0) { + setActive(ev); + ev.setAction(ACTION_DOWN); + dispatchTouchEvent(ev); + } + } } } } From f03e5f377857c044ad579d9e91b72a58af636444 Mon Sep 17 00:00:00 2001 From: Jordan Silva Date: Mon, 24 Apr 2023 20:26:24 +0100 Subject: [PATCH 8/8] Fix digital wellbeing toast being initialized multiple times Digital Wellbeing toast state was being updated several times together with the app icon unnecessarily. This was causing a recreation of the Digital Wellbeing and replacing the banner attached to the TaskView multiple times, leading to heavy UI thread work and jumpy animations in some cases. Bug: 271428408 Test: manual Change-Id: I1a2a1423924efb0fb3c1e66826e3ab11211dcfb7 --- quickstep/src/com/android/quickstep/views/TaskView.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 42589ced5d..53660b5040 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -581,6 +581,7 @@ public class TaskView extends FrameLayout implements Reusable { mIconView, STAGE_POSITION_UNDEFINED); mSnapshotView.bind(task); setOrientationState(orientedState); + mDigitalWellBeingToast.initialize(mTask); } /** @@ -984,10 +985,7 @@ public class TaskView extends FrameLayout implements Reusable { } if (needsUpdate(changes, FLAG_UPDATE_ICON)) { mIconLoadRequest = iconCache.updateIconInBackground(mTask, - (task) -> { - setIcon(mIconView, task.icon); - mDigitalWellBeingToast.initialize(mTask); - }); + (task) -> setIcon(mIconView, task.icon)); } } else { if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {