From f641813483e40bc4b8e9bca25d83bdb987c0997a Mon Sep 17 00:00:00 2001 From: Saumya Prakash Date: Mon, 27 Mar 2023 19:56:35 +0000 Subject: [PATCH 1/8] Add extra error checking for Home Gesture Tutorial Add an error message for when a user swipes horizontally from the middle of the screen. Fix: 275386244 Test: Manual Change-Id: If4d0dd412c3d1625da18f9c068e5fd7b281548c5 --- .../quickstep/interaction/HomeGestureTutorialController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java index 99d417e3b4..73a08c3165 100644 --- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java @@ -92,6 +92,7 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll case BACK_COMPLETED_FROM_RIGHT: case BACK_CANCELLED_FROM_LEFT: case BACK_CANCELLED_FROM_RIGHT: + case BACK_NOT_STARTED_TOO_FAR_FROM_EDGE: showFeedback(R.string.home_gesture_feedback_swipe_too_far_from_edge); break; } From f96827b33146d535b94798e7885bd024c33a37e5 Mon Sep 17 00:00:00 2001 From: Randy Pfohl Date: Mon, 13 Mar 2023 23:21:56 +0000 Subject: [PATCH 2/8] checking if outline provider is null to handle rare NPE test: verified that a null value wouldn't cause a crash, and would still show the well being toasts correctly. defaulting a value could cause abnormal behavior so I have created a task to follow up with to figure out why this value is being set to null. bug: 236918951 Change-Id: I9d4282273cb0bc5b6b095dbd082dd1ef79add0dc --- .../com/android/quickstep/views/DigitalWellBeingToast.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java index af80d5f51d..7cd6756362 100644 --- a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java +++ b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java @@ -326,7 +326,11 @@ public final class DigitalWellBeingToast { } private void setBannerOutline() { - mOldBannerOutlineProvider = mBanner.getOutlineProvider(); + // TODO(b\273367585) to investigate why mBanner.getOutlineProvider() can be null + mOldBannerOutlineProvider = mBanner.getOutlineProvider() != null + ? mBanner.getOutlineProvider() + : ViewOutlineProvider.BACKGROUND; + mBanner.setOutlineProvider(new ViewOutlineProvider() { @Override public void getOutline(View view, Outline outline) { From dfc94fc05f3a7117d0a87c4aaeadb871724e55dc Mon Sep 17 00:00:00 2001 From: fbaron Date: Mon, 27 Mar 2023 17:51:06 -0700 Subject: [PATCH 3/8] Scroll to top when new header is selected in two pane widget picker Bug: 275441368 Test: Select a header and scroll, then select a different header and verify that it is scrolled to the top Change-Id: Ie11d074759e5336ee1bbdec000ab266cf43c2c31 --- .../launcher3/widget/picker/WidgetsTwoPaneSheet.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java index de7497a1a4..2199473e82 100644 --- a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java +++ b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java @@ -23,8 +23,8 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewOutlineProvider; -import android.widget.FrameLayout; import android.widget.LinearLayout; +import android.widget.ScrollView; import androidx.annotation.NonNull; @@ -52,7 +52,7 @@ public class WidgetsTwoPaneSheet extends WidgetsFullSheet { private WidgetsListHeader mSuggestedWidgetsHeader; private LinearLayout mRightPane; - private FrameLayout mRightPaneScrollView; + private ScrollView mRightPaneScrollView; private WidgetsListTableViewHolderBinder mWidgetsListTableViewHolderBinder; private final ViewOutlineProvider mViewOutlineProviderRightPane = new ViewOutlineProvider() { @@ -156,6 +156,7 @@ public class WidgetsTwoPaneSheet extends WidgetsFullSheet { resetExpandedHeaders(); mRightPane.removeAllViews(); mRightPane.addView(mRecommendedWidgetsTable); + mRightPaneScrollView.setScrollY(0); }); mSuggestedWidgetsContainer.addView(mSuggestedWidgetsHeader); } @@ -249,6 +250,7 @@ public class WidgetsTwoPaneSheet extends WidgetsFullSheet { }; mRightPane.removeAllViews(); mRightPane.addView(widgetsRowViewHolder.itemView); + mRightPaneScrollView.setScrollY(0); } }; } From 9cc48f3e960536e0876c3774e1af1a9e8e1a1190 Mon Sep 17 00:00:00 2001 From: Jeremy Sim Date: Tue, 28 Mar 2023 09:43:49 -0700 Subject: [PATCH 4/8] Create flag for new App Pairs feature This patch creates a new Launcher flag for the upcoming App Pairs feature. Flag: ENABLE_APP_PAIRS Bug: 274189428 Test: Not needed Change-Id: I84cfb3742a60bd5633d71bc68e7506ac0c67e55f --- src/com/android/launcher3/config/FeatureFlags.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index b4fe748d1a..2972489dc1 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -404,6 +404,11 @@ public final class FeatureFlags { "ENABLE_APP_CLONING_CHANGES_IN_LAUNCHER", false, "Removes clone apps from the work profile tab."); + public static final BooleanFlag ENABLE_APP_PAIRS = getDebugFlag(274189428, + "ENABLE_APP_PAIRS", false, + "Enables the ability to create and save app pairs on the Home screen for easy" + + " split screen launching."); + public static class BooleanFlag { private final boolean mCurrentValue; From 13a6b228a58909b874246846b7a74ef20624b0da Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 28 Mar 2023 12:46:17 -0700 Subject: [PATCH 5/8] Updating PinShortcutRequestActivityInfo to provide pinRequest lazily Bug: 275407282 Test: Verified on device Change-Id: I81867ada454219b44663b58b942329422fb81196 --- .../PinShortcutRequestActivityInfo.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java b/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java index 6b215229fd..dd74125573 100644 --- a/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java +++ b/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java @@ -39,6 +39,8 @@ import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.pm.PinRequestHelper; import com.android.launcher3.pm.ShortcutConfigActivityInfo; +import java.util.function.Supplier; + /** * Extension of ShortcutConfigActivityInfo to be used in the confirmation prompt for pin item * request. @@ -50,15 +52,19 @@ public class PinShortcutRequestActivityInfo extends ShortcutConfigActivityInfo { // actual existing class. private static final String STUB_COMPONENT_CLASS = "pinned-shortcut"; - private final PinItemRequest mRequest; + private final Supplier mRequestSupplier; private final ShortcutInfo mInfo; private final Context mContext; public PinShortcutRequestActivityInfo(PinItemRequest request, Context context) { - super(new ComponentName(request.getShortcutInfo().getPackage(), STUB_COMPONENT_CLASS), - request.getShortcutInfo().getUserHandle()); - mRequest = request; - mInfo = request.getShortcutInfo(); + this(request.getShortcutInfo(), () -> request, context); + } + + public PinShortcutRequestActivityInfo( + ShortcutInfo si, Supplier requestSupplier, Context context) { + super(new ComponentName(si.getPackage(), STUB_COMPONENT_CLASS), si.getUserHandle()); + mRequestSupplier = requestSupplier; + mInfo = si; mContext = context; } @@ -91,7 +97,7 @@ public class PinShortcutRequestActivityInfo extends ShortcutConfigActivityInfo { true /* isToState */); // Delay the actual accept() call until the drop animation is complete. return PinRequestHelper.createWorkspaceItemFromPinItemRequest( - mContext, mRequest, duration); + mContext, mRequestSupplier.get(), duration); } @Override From c691dcba5ad9b454c71b879c45456c3a9ea00888 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Tue, 28 Mar 2023 17:52:20 +0000 Subject: [PATCH 6/8] Don't stash immediately when drag was canceled Instead, keep the taskbar open for the normal timeout. Test: Drag an app from taskbar and drop back in taskbar, ensure taskbar stays open until 5 second timeout; Drag an app from taskbar and drop into split screen, ensure taskbar stashes immediately Flag: ENABLE_TRANSIENT_TASKBAR true Fixes: 275019813 Change-Id: I06ca0eccbfe313dbae8f6d96c7c09bb659f6a27b --- .../launcher3/taskbar/TaskbarDragController.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java index 6c9ab0cf02..66a903b8bd 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java @@ -457,9 +457,12 @@ public class TaskbarDragController extends DragController im mControllers.taskbarAutohideSuspendController.updateFlag( TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING, false); mActivity.onDragEnd(); - // Note, this must be done last to ensure no AutohideSuspendFlags are active, as that - // will prevent us from stashing until the timeout. - mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(true); + if (mReturnAnimator == null) { + // Upon successful drag, immediately stash taskbar. + // Note, this must be done last to ensure no AutohideSuspendFlags are active, as + // that will prevent us from stashing until the timeout. + mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(true); + } } } @@ -493,8 +496,9 @@ public class TaskbarDragController extends DragController im callOnDragEnd(); dragView.remove(); dragView.clearAnimation(); + // Do this after callOnDragEnd(), because we use mReturnAnimator != null to + // imply the drag was canceled rather than successful. mReturnAnimator = null; - } }); mReturnAnimator.start(); @@ -556,6 +560,8 @@ public class TaskbarDragController extends DragController im syncGroup.add(viewRoot, null /* runnable */); syncGroup.addTransaction(transaction); syncGroup.markSyncReady(); + // Do this after maybeOnDragEnd(), because we use mReturnAnimator != null to imply + // the drag was canceled rather than successful. mReturnAnimator = null; } }); From e6d86e20aa27084a2fd88ea5b244bb242bb2b1cf Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Tue, 28 Mar 2023 22:04:46 -0700 Subject: [PATCH 7/8] Consolidate WorkProfileTest "@After" methods * There were two separate methods, which can run in any order. Consolidate to reduce variability Bug: 243688989 Change-Id: Ic924aa8a5d75505aecf6c830c63a85a0d2028d83 --- tests/src/com/android/launcher3/ui/WorkProfileTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/WorkProfileTest.java b/tests/src/com/android/launcher3/ui/WorkProfileTest.java index c22f93dca3..199653b613 100644 --- a/tests/src/com/android/launcher3/ui/WorkProfileTest.java +++ b/tests/src/com/android/launcher3/ui/WorkProfileTest.java @@ -36,6 +36,7 @@ import com.android.launcher3.allapps.WorkEduCard; import com.android.launcher3.allapps.WorkPausedCard; import com.android.launcher3.allapps.WorkProfileManager; import com.android.launcher3.tapl.LauncherInstrumentation; +import com.android.launcher3.testing.shared.TestProtocol; import org.junit.After; import org.junit.Before; @@ -90,17 +91,14 @@ public class WorkProfileTest extends AbstractLauncherUiTest { @After public void removeWorkProfile() throws Exception { - mDevice.executeShellCommand("pm remove-user " + mProfileUserId); - } - - @After - public void resumeAppStoreUpdate() { + Log.d(TestProtocol.WORK_TAB_MISSING, "WorkProfileTest teardown"); executeOnLauncher(launcher -> { if (launcher == null || launcher.getAppsView() == null) { return; } launcher.getAppsView().getAppsStore().disableDeferUpdates(DEFER_UPDATES_TEST); }); + mDevice.executeShellCommand("pm remove-user " + mProfileUserId); } private void waitForWorkTabSetup() { From 0263a679f23c9972f0b96adbfaaa8114c2b88fac Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 29 Mar 2023 19:11:03 +0000 Subject: [PATCH 8/8] Revert "Simplifying some page indicator dots attributes so that it can" This reverts commit a5ead45967f204fd938846d0d2fa3fa244857708. Reason for revert: b/274169859 Change-Id: Id214694ae4f61cd70796c6f7e932c1fdef82d746 --- quickstep/res/layout/taskbar_edu.xml | 3 +- .../taskbar/TaskbarEduPagedView.java | 4 +- res/drawable/page_indicator.xml | 6 + res/layout/page_indicator_dots.xml | 8 +- res/layout/user_folder_icon_normalized.xml | 3 +- res/values-night-v31/colors.xml | 2 - res/values-night/colors.xml | 2 - res/values-v31/colors.xml | 3 +- res/values/attrs.xml | 7 +- res/values/colors.xml | 3 +- res/values/styles.xml | 2 + src/com/android/launcher3/Launcher.java | 5 + .../WorkspaceStateTransitionAnimation.java | 4 +- .../launcher3/folder/FolderPagedView.java | 4 +- .../LauncherDotsPageIndicator.java | 197 ------------------ .../pageindicators/PageIndicator.java | 11 +- .../pageindicators/PageIndicatorDots.java | 167 +++++++++++++-- 17 files changed, 176 insertions(+), 255 deletions(-) create mode 100644 res/drawable/page_indicator.xml delete mode 100644 src/com/android/launcher3/pageindicators/LauncherDotsPageIndicator.java diff --git a/quickstep/res/layout/taskbar_edu.xml b/quickstep/res/layout/taskbar_edu.xml index f3856ba69e..d7daea31cd 100644 --- a/quickstep/res/layout/taskbar_edu.xml +++ b/quickstep/res/layout/taskbar_edu.xml @@ -55,7 +55,7 @@ style="@style/TaskbarEdu.Button.Close" android:textColor="?android:attr/textColorPrimary"/> -