From 08f724635d761908ceeab545200b73595d7b2ec7 Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Thu, 8 Dec 2022 15:36:43 -0800 Subject: [PATCH 1/6] Re-enable AddConfigWidgetTest Bug: 261485458 Test: atest AddConfigWidgetTest Change-Id: I6bb209e16000458a0faaada6bcc4f5bec2e5a3e5 --- .../com/android/launcher3/ui/widget/AddConfigWidgetTest.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java index 3f4a1c128e..2c9785c93d 100644 --- a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java +++ b/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java @@ -37,7 +37,6 @@ import com.android.launcher3.util.rule.ShellCommandRule; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -65,7 +64,6 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest { mAppWidgetManager = AppWidgetManager.getInstance(mTargetContext); } - @Ignore @Test @PortraitLandscape public void testWidgetConfig() throws Throwable { From ae4a9ac0d4aa3c11d4856644816a16476b73a5e3 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Thu, 29 Dec 2022 12:21:13 +0800 Subject: [PATCH 2/6] [ShellTransit] Stabilize QuickSwitch test since Launcher can resumed. QuickSwitch can resume Launcher activity due to transient launch when shell transition is enabled, waiting for the Launcher leave resume stage to make the test stable. Bug: 263907455 Test: atest TaplTestsQuickstep#testQuickSwitchToPreviousAppForTablet Change-Id: I2e6e0511cba51f4634ccf3da454e4be1dd93ffd1 --- .../android/quickstep/TaplTestsQuickstep.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index 9a2fcc02d9..9f34775761 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -262,6 +262,19 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { return launchedAppState; } + private void quickSwitchToPreviousAppAndAssert(boolean toRight) { + final LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); + if (toRight) { + launchedAppState.quickSwitchToPreviousApp(); + } else { + launchedAppState.quickSwitchToPreviousAppSwipeLeft(); + } + + // While enable shell transition, Launcher can be resumed due to transient launch. + waitForLauncherCondition("Launcher shouldn't stay in resume forever", + this::isInLaunchedApp, 3000 /* timeout */); + } + @Test @PortraitLandscape public void testAllAppsFromHome() throws Exception { @@ -288,13 +301,11 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { startTestActivity(3); startTestActivity(4); - LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); - launchedAppState.quickSwitchToPreviousApp(); + quickSwitchToPreviousAppAndAssert(true /* toRight */); assertTrue("The first app we should have quick switched to is not running", isTestActivityRunning(3)); - launchedAppState = getAndAssertLaunchedApp(); - launchedAppState.quickSwitchToPreviousApp(); + quickSwitchToPreviousAppAndAssert(true /* toRight */); if (mLauncher.getNavigationModel() == NavigationModel.THREE_BUTTON) { // 3-button mode toggles between 2 apps, rather than going back further. assertTrue("Second quick switch should have returned to the first app.", @@ -303,12 +314,12 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { assertTrue("The second app we should have quick switched to is not running", isTestActivityRunning(2)); } - launchedAppState = getAndAssertLaunchedApp(); - launchedAppState.quickSwitchToPreviousAppSwipeLeft(); + + quickSwitchToPreviousAppAndAssert(false /* toRight */); assertTrue("The 2nd app we should have quick switched to is not running", isTestActivityRunning(3)); - launchedAppState = getAndAssertLaunchedApp(); + final LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); launchedAppState.switchToOverview(); } @@ -327,8 +338,10 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { launchedAppState.assertTaskbarHidden(); // Quick-switch to the test app with swiping to right. - launchedAppState.quickSwitchToPreviousApp(); + quickSwitchToPreviousAppAndAssert(true /* toRight */); + assertTrue("The first app we should have quick switched to is not running", + isTestActivityRunning(2)); // Expect task bar visible when the launched app was the test activity. launchedAppState = getAndAssertLaunchedApp(); launchedAppState.assertTaskbarVisible(); From d8a07fa030aea4732dbbef28727f24bc7dd32637 Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Tue, 13 Dec 2022 02:05:35 -0800 Subject: [PATCH 3/6] Fix NPE from getting swipe pip to home animator finish transation after the surface has been released Fixes: 243154747 Test: programmatically added delay to finish transation later Change-Id: Ia667372678f2224406147f5659c5fc6f61f270ad --- .../android/quickstep/AbsSwipeUpHandler.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 3d8ffc418a..09ddba3a2a 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -323,6 +323,9 @@ public abstract class AbsSwipeUpHandler, // May be set to false when mIsTransientTaskbar is true. private boolean mCanSlowSwipeGoHome = true; + @Nullable + private RemoteAnimationTargets.ReleaseCheck mSwipePipToHomeReleaseCheck = null; + public AbsSwipeUpHandler(Context context, RecentsAnimationDeviceState deviceState, TaskAnimationManager taskAnimationManager, GestureState gestureState, long touchTimeMs, boolean continuingLastGesture, @@ -867,6 +870,9 @@ public abstract class AbsSwipeUpHandler, mRemoteTargetHandles = mTargetGluer.assignTargetsForSplitScreen(mContext, targets); mRecentsAnimationController = controller; mRecentsAnimationTargets = targets; + mSwipePipToHomeReleaseCheck = new RemoteAnimationTargets.ReleaseCheck(); + mSwipePipToHomeReleaseCheck.setCanRelease(true); + mRecentsAnimationTargets.addReleaseCheck(mSwipePipToHomeReleaseCheck); // Only initialize the device profile, if it has not been initialized before, as in some // configurations targets.homeContentInsets may not be correct. @@ -1416,9 +1422,16 @@ public abstract class AbsSwipeUpHandler, mSwipePipToHomeAnimator = createWindowAnimationToPip( homeAnimFactory, runningTaskTarget, start); mSwipePipToHomeAnimators[0] = mSwipePipToHomeAnimator; + if (mSwipePipToHomeReleaseCheck != null) { + mSwipePipToHomeReleaseCheck.setCanRelease(false); + } windowAnim = mSwipePipToHomeAnimators; } else { mSwipePipToHomeAnimator = null; + if (mSwipePipToHomeReleaseCheck != null) { + mSwipePipToHomeReleaseCheck.setCanRelease(true); + mSwipePipToHomeReleaseCheck = null; + } windowAnim = createWindowAnimationToHome(start, homeAnimFactory); windowAnim[0].addAnimatorListener(new AnimationSuccessListener() { @@ -1940,6 +1953,10 @@ public abstract class AbsSwipeUpHandler, finishRecentsControllerToHome( () -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED)); } + if (mSwipePipToHomeReleaseCheck != null) { + mSwipePipToHomeReleaseCheck.setCanRelease(true); + mSwipePipToHomeReleaseCheck = null; + } doLogGesture(HOME, mRecentsView == null ? null : mRecentsView.getCurrentPageTaskView()); } From 9d38a3fd102a49cfd954876b57c75e391a09782e Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Tue, 27 Dec 2022 14:17:57 -0800 Subject: [PATCH 4/6] Add logging to work mode switch Add logging to the work button on work profile, logging when button is extended and collapsed bug: 263817965 test: presubmit Change-Id: I3194d0a1567a9ee995497391350ed5be4b08c3db --- .../launcher3/allapps/BaseAllAppsContainerView.java | 3 ++- src/com/android/launcher3/allapps/WorkModeSwitch.java | 8 ++++++++ .../android/launcher3/allapps/WorkProfileManager.java | 11 ++++++----- .../android/launcher3/logging/StatsLogManager.java | 8 +++++++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java index ca08164a05..00e89bacc5 100644 --- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java @@ -163,7 +163,8 @@ public abstract class BaseAllAppsContainerView mAllApps; private final Predicate mMatcher; + private final StatsLogManager mStatsLogManager; private WorkModeSwitch mWorkModeSwitch; @@ -88,11 +89,13 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP private SharedPreferences mPreferences; public WorkProfileManager( - UserManager userManager, BaseAllAppsContainerView allApps, SharedPreferences prefs) { + UserManager userManager, BaseAllAppsContainerView allApps, SharedPreferences prefs, + StatsLogManager statsLogManager) { mUserManager = userManager; mAllApps = allApps; mPreferences = prefs; mMatcher = mAllApps.mPersonalMatcher.negate(); + mStatsLogManager = statsLogManager; } /** @@ -227,9 +230,7 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP private void onWorkFabClicked(View view) { if (Utilities.ATLEAST_P && mCurrentState == STATE_ENABLED && mWorkModeSwitch.isEnabled()) { - ActivityContext activityContext = ActivityContext.lookupContext( - mWorkModeSwitch.getContext()); - activityContext.getStatsLogManager().logger().log(LAUNCHER_TURN_OFF_WORK_APPS_TAP); + mStatsLogManager.logger().log(LAUNCHER_TURN_OFF_WORK_APPS_TAP); setWorkProfileEnabled(false); } } diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java index 24d8c9dc5e..2159c6b68f 100644 --- a/src/com/android/launcher3/logging/StatsLogManager.java +++ b/src/com/android/launcher3/logging/StatsLogManager.java @@ -624,7 +624,13 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_RIGHT_BOTTOM(1232), @UiEvent(doc = "User has invoked split to left half with a keyboard shortcut.") - LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP(1233) + LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP(1233), + + @UiEvent(doc = "User has collapsed the work FAB button by swiping down") + LAUNCHER_WORK_FAB_BUTTON_COLLAPSE(1276), + + @UiEvent(doc = "User has collapsed the work FAB button by swiping up") + LAUNCHER_WORK_FAB_BUTTON_EXTEND(1277), ; // ADD MORE From 3c2ee27a0141ff1cd1c9bcfbb43e361bde55ae80 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 5 Jan 2023 14:52:01 -0800 Subject: [PATCH 5/6] Fixing work tab is not updated when work-mode changes Bug: 263399769 Test: Verified on device Change-Id: I94d8f20bc70f2299d11d539d4821ba7e13253522 --- .../allapps/AlphabeticalAppsList.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java index fc1b830aed..29767bf465 100644 --- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java +++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java @@ -239,23 +239,24 @@ public class AlphabeticalAppsList implement mAdapterItems.addAll(mSearchResults); } else { int position = 0; + boolean addApps = true; if (mWorkProviderManager != null) { position += mWorkProviderManager.addWorkItems(mAdapterItems); - if (!mWorkProviderManager.shouldShowWorkApps()) { - return; - } + addApps = mWorkProviderManager.shouldShowWorkApps(); } - String lastSectionName = null; - for (AppInfo info : mApps) { - mAdapterItems.add(AdapterItem.asApp(info)); + if (addApps) { + String lastSectionName = null; + for (AppInfo info : mApps) { + mAdapterItems.add(AdapterItem.asApp(info)); - String sectionName = info.sectionName; - // Create a new section if the section names do not match - if (!sectionName.equals(lastSectionName)) { - lastSectionName = sectionName; - mFastScrollerSections.add(new FastScrollSectionInfo(sectionName, position)); + String sectionName = info.sectionName; + // Create a new section if the section names do not match + if (!sectionName.equals(lastSectionName)) { + lastSectionName = sectionName; + mFastScrollerSections.add(new FastScrollSectionInfo(sectionName, position)); + } + position++; } - position++; } } mAccessibilityResultsCount = (int) mAdapterItems.stream() From 6f5ae3635dfb0001484782d4b649fa2c4d132277 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Thu, 5 Jan 2023 17:41:08 -0800 Subject: [PATCH 6/6] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I75ef387d8a3b8da1239b8ca39372a75a77435acd --- quickstep/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/res/values-de/strings.xml b/quickstep/res/values-de/strings.xml index 86ea26461f..c7664be036 100644 --- a/quickstep/res/values-de/strings.xml +++ b/quickstep/res/values-de/strings.xml @@ -78,7 +78,7 @@ "Fertig!" "Nach oben wischen, um den Startbildschirm aufzurufen" "Startbildschirmtaste drücken, um zum Startbildschirm zu gehen" - "Du kannst dein Gerät (%1$s) jetzt verwenden" + "Du kannst dein %1$s jetzt verwenden" "Gerät" "Einstellungen der Systemsteuerung" "Teilen"