Merge "Remove duplicated widget host view reinflation on screen rotation" into main
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 2a1f39f..232c441 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -322,6 +322,7 @@
<!-- Taskbar -->
<dimen name="taskbar_size">@*android:dimen/taskbar_frame_height</dimen>
+ <dimen name="taskbar_phone_size">@*android:dimen/navigation_bar_frame_height</dimen>
<dimen name="taskbar_ime_size">48dp</dimen>
<dimen name="taskbar_icon_min_touch_size">48dp</dimen>
<!-- Note that this applies to both sides of all icons, so visible space is double this. -->
diff --git a/quickstep/res/values/override.xml b/quickstep/res/values/override.xml
index df32626..29779a7 100644
--- a/quickstep/res/values/override.xml
+++ b/quickstep/res/values/override.xml
@@ -35,4 +35,6 @@
<string name="assist_state_manager_class" translatable="false"></string>
+ <string name="launcher_restore_event_logger_class" translatable="false">com.android.quickstep.LauncherRestoreEventLoggerImpl</string>
+
</resources>
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index b4754c6..159a6ef 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -204,6 +204,11 @@
}
@Override
+ public void onStateTransitionCompletedAfterSwipeToHome(LauncherState state) {
+ mTaskbarLauncherStateController.onStateTransitionCompletedAfterSwipeToHome(state);
+ }
+
+ @Override
public void refreshResumedState() {
onLauncherVisibilityChanged(mLauncher.hasBeenResumed());
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
index c4255bf..da1f766 100644
--- a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
@@ -108,7 +108,7 @@
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
Resources resources = mActivity.getResources();
if (isPhoneGestureNavMode(mActivity.getDeviceProfile())) {
- mTaskbarSize = resources.getDimensionPixelSize(R.dimen.taskbar_size);
+ mTaskbarSize = resources.getDimensionPixelSize(R.dimen.taskbar_phone_size);
mStashedHandleWidth =
resources.getDimensionPixelSize(R.dimen.taskbar_stashed_small_screen);
} else {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 38ee4ac..4290948 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -885,7 +885,7 @@
if (ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone) {
return isThreeButtonNav() ?
- resources.getDimensionPixelSize(R.dimen.taskbar_size) :
+ resources.getDimensionPixelSize(R.dimen.taskbar_phone_size) :
resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size);
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index 9a37bcb..057b71b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -205,13 +205,6 @@
public void onStateTransitionComplete(LauncherState finalState) {
mLauncherState = finalState;
updateStateForFlag(FLAG_LAUNCHER_IN_STATE_TRANSITION, false);
- // TODO(b/279514548) Cleans up bad state that can occur when user interacts with
- // taskbar on top of transparent activity.
- if (!FeatureFlags.enableHomeTransitionListener()
- && finalState == LauncherState.NORMAL
- && mLauncher.hasBeenResumed()) {
- updateStateForFlag(FLAG_VISIBLE, true);
- }
applyState();
boolean disallowLongClick =
FeatureFlags.enableSplitContextually()
@@ -223,6 +216,21 @@
}
};
+ /**
+ * Callback for when launcher state transition completes after user swipes to home.
+ * @param finalState The final state of the transition.
+ */
+ public void onStateTransitionCompletedAfterSwipeToHome(LauncherState finalState) {
+ // TODO(b/279514548) Cleans up bad state that can occur when user interacts with
+ // taskbar on top of transparent activity.
+ if (!FeatureFlags.enableHomeTransitionListener()
+ && (finalState == LauncherState.NORMAL)
+ && mLauncher.hasBeenResumed()) {
+ updateStateForFlag(FLAG_VISIBLE, true);
+ applyState();
+ }
+ }
+
/** Initializes the controller instance, and applies the initial state immediately. */
public void init(TaskbarControllers controllers, QuickstepLauncher launcher,
int sysuiStateFlags) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java
index 1224b3f..d09f74c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java
@@ -86,4 +86,8 @@
public void setTaskbarWasPinned(boolean taskbarWasPinned) {
mTaskbarWasPinned = taskbarWasPinned;
}
+
+ // To track if taskbar was stashed / unstashed between configuration changes (which recreates
+ // the task bar).
+ public Boolean taskbarWasStashedAuto = true;
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index c74ddcb..9aaa80f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -21,6 +21,7 @@
import static com.android.app.animation.Interpolators.FINAL_FRAME;
import static com.android.app.animation.Interpolators.INSTANT;
import static com.android.app.animation.Interpolators.LINEAR;
+import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_HIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_SHOW;
import static com.android.launcher3.taskbar.TaskbarKeyguardController.MASK_ANY_SYSUI_LOCKED;
@@ -256,7 +257,8 @@
mAccessibilityManager = mActivity.getSystemService(AccessibilityManager.class);
if (isPhoneMode()) {
- mUnstashedHeight = mActivity.getResources().getDimensionPixelSize(R.dimen.taskbar_size);
+ mUnstashedHeight = mActivity.getResources().getDimensionPixelSize(
+ R.dimen.taskbar_phone_size);
mStashedHeight = mActivity.getResources().getDimensionPixelSize(
R.dimen.taskbar_stashed_size);
} else {
@@ -306,8 +308,12 @@
boolean isTransientTaskbar = DisplayController.isTransientTaskbar(mActivity);
boolean isInSetup = !mActivity.isUserSetupComplete() || setupUIVisible;
- updateStateForFlag(FLAG_STASHED_IN_APP_AUTO,
- isTransientTaskbar && !mTaskbarSharedState.getTaskbarWasPinned());
+ boolean isStashedInAppAuto =
+ isTransientTaskbar && !mTaskbarSharedState.getTaskbarWasPinned();
+ if (ENABLE_TASKBAR_NAVBAR_UNIFICATION) {
+ isStashedInAppAuto = isStashedInAppAuto && mTaskbarSharedState.taskbarWasStashedAuto;
+ }
+ updateStateForFlag(FLAG_STASHED_IN_APP_AUTO, isStashedInAppAuto);
updateStateForFlag(FLAG_STASHED_IN_APP_SETUP, isInSetup);
updateStateForFlag(FLAG_IN_SETUP, isInSetup);
updateStateForFlag(FLAG_STASHED_SMALL_SCREEN, isPhoneMode()
@@ -316,7 +322,8 @@
// us that we're paused until a bit later. This avoids flickering upon recreating taskbar.
updateStateForFlag(FLAG_IN_APP, true);
applyState(/* duration = */ 0);
- if (mTaskbarSharedState.getTaskbarWasPinned()) {
+ if (mTaskbarSharedState.getTaskbarWasPinned()
+ || !mTaskbarSharedState.taskbarWasStashedAuto) {
tryStartTaskbarTimeout();
}
notifyStashChange(/* visible */ false, /* stashed */ isStashedInApp());
@@ -491,6 +498,7 @@
}
if (hasAnyFlag(FLAG_STASHED_IN_APP_AUTO) != stash) {
+ mTaskbarSharedState.taskbarWasStashedAuto = stash;
updateStateForFlag(FLAG_STASHED_IN_APP_AUTO, stash);
applyState();
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
index a29a25c..df2a43b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
@@ -30,6 +30,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.ItemInfoWithIcon;
@@ -330,6 +331,14 @@
}
/**
+ * Callback for when launcher state transition completes after user swipes to home.
+ * @param finalState The final state of the transition.
+ */
+ public void onStateTransitionCompletedAfterSwipeToHome(LauncherState finalState) {
+ // Overridden
+ }
+
+ /**
* Refreshes the resumed state of this ui controller.
*/
public void refreshResumedState() {}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 14ab471..c0cbd45 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -192,7 +192,7 @@
mControllers = controllers;
mTaskbarView.init(new TaskbarViewCallbacks());
mTaskbarView.getLayoutParams().height = isPhoneMode(mActivity.getDeviceProfile())
- ? mActivity.getResources().getDimensionPixelSize(R.dimen.taskbar_size)
+ ? mActivity.getResources().getDimensionPixelSize(R.dimen.taskbar_phone_size)
: mActivity.getDeviceProfile().taskbarHeight;
mTaskbarIconScaleForStash.updateValue(1f);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index 14e258b..9438e00 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -707,6 +707,13 @@
}
@Override
+ public void onStateTransitionCompletedAfterSwipeToHome(LauncherState finalState) {
+ if (mTaskbarUIController != null) {
+ mTaskbarUIController.onStateTransitionCompletedAfterSwipeToHome(finalState);
+ }
+ }
+
+ @Override
protected void onResume() {
super.onResume();
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
index f6cd30a..82a9c05 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
@@ -45,6 +45,7 @@
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.touch.SingleAxisSwipeDetector;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.TouchController;
@@ -194,7 +195,20 @@
recentsView.switchToScreenshot(null,
() -> recentsView.finishRecentsAnimation(true /* toRecents */, null));
if (mStartState.overviewUi) {
- new OverviewToHomeAnim(mLauncher, () -> onSwipeInteractionCompleted(mEndState),
+ Runnable onReachedHome = () -> {
+ StateManager.StateListener<LauncherState> listener =
+ new StateManager.StateListener<>() {
+ @Override
+ public void onStateTransitionComplete(LauncherState finalState) {
+ mLauncher.onStateTransitionCompletedAfterSwipeToHome(
+ finalState);
+ mLauncher.getStateManager().removeStateListener(this);
+ }
+ };
+ mLauncher.getStateManager().addStateListener(listener);
+ onSwipeInteractionCompleted(mEndState);
+ };
+ new OverviewToHomeAnim(mLauncher, onReachedHome,
FeatureFlags.enableSplitContextually()
? mCancelSplitRunnable
: null)
diff --git a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
index 9e58160..7c24ba8 100644
--- a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
+++ b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
@@ -23,6 +23,8 @@
import static com.android.launcher3.BaseActivity.INVISIBLE_ALL;
import static com.android.launcher3.BaseActivity.INVISIBLE_BY_PENDING_FLAGS;
import static com.android.launcher3.BaseActivity.PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION;
+import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING;
+import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -52,6 +54,7 @@
import com.android.internal.view.AppearanceRegion;
import com.android.launcher3.AbstractFloatingView;
+import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -294,8 +297,12 @@
mBackTarget = appTarget;
mInitialTouchPos.set(backEvent.getTouchX(), backEvent.getTouchY());
- // TODO(b/218916755): Offset start rectangle in multiwindow mode.
mStartRect.set(appTarget.windowConfiguration.getMaxBounds());
+ if (mLauncher.getDeviceProfile().isTaskbarPresent && enableTaskbarPinning()
+ && LauncherPrefs.get(mLauncher).get(TASKBAR_PINNING)) {
+ int insetBottom = mStartRect.bottom - appTarget.contentInsets.bottom;
+ mStartRect.set(mStartRect.left, mStartRect.top, mStartRect.right, insetBottom);
+ }
mCurrentRect.set(mStartRect);
addScrimLayer();
mTransaction.apply();
diff --git a/quickstep/src/com/android/quickstep/LauncherRestoreEventLoggerImpl.kt b/quickstep/src/com/android/quickstep/LauncherRestoreEventLoggerImpl.kt
new file mode 100644
index 0000000..645ecf4
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/LauncherRestoreEventLoggerImpl.kt
@@ -0,0 +1,136 @@
+package com.android.quickstep
+
+import android.app.backup.BackupManager
+import android.app.backup.BackupRestoreEventLogger
+import android.app.backup.BackupRestoreEventLogger.BackupRestoreDataType
+import android.app.backup.BackupRestoreEventLogger.BackupRestoreError
+import android.content.Context
+import com.android.launcher3.Flags
+import com.android.launcher3.LauncherSettings.Favorites
+import com.android.launcher3.backuprestore.LauncherRestoreEventLogger
+
+/**
+ * Concrete implementation for wrapper to log Restore event metrics for both success and failure to
+ * restore Launcher workspace from a backup. This implementation accesses SystemApis so is only
+ * available to QuickStep/NexusLauncher.
+ */
+class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEventLogger() {
+ companion object {
+ const val TAG = "LauncherRestoreEventLoggerImpl"
+
+ // Generic type for any possible workspace items, when specific type is not known.
+ @BackupRestoreDataType private const val DATA_TYPE_LAUNCHER_ITEM = "launcher_item"
+ // Specific workspace item types, based off of Favorites Table.
+ @BackupRestoreDataType private const val DATA_TYPE_APPLICATION = "application"
+ @BackupRestoreDataType private const val DATA_TYPE_FOLDER = "folder"
+ @BackupRestoreDataType private const val DATA_TYPE_APPWIDGET = "widget"
+ @BackupRestoreDataType private const val DATA_TYPE_CUSTOM_APPWIDGET = "custom_widget"
+ @BackupRestoreDataType private const val DATA_TYPE_DEEP_SHORTCUT = "deep_shortcut"
+ @BackupRestoreDataType private const val DATA_TYPE_APP_PAIR = "app_pair"
+ }
+
+ private val backupManager: BackupManager = BackupManager(context)
+ private val restoreEventLogger: BackupRestoreEventLogger = backupManager.delayedRestoreLogger
+
+ /**
+ * For logging when multiple items of a given data type failed to restore.
+ *
+ * @param dataType The data type that was not restored.
+ * @param count the number of data items that were not restored.
+ * @param error error type for why the data was not restored.
+ */
+ override fun logLauncherItemsRestoreFailed(
+ @BackupRestoreDataType dataType: String,
+ count: Int,
+ @BackupRestoreError error: String?
+ ) {
+ if (Flags.enableLauncherBrMetrics()) {
+ restoreEventLogger.logItemsRestoreFailed(dataType, count, error)
+ }
+ }
+
+ /**
+ * For logging when multiple items of a given data type were successfully restored.
+ *
+ * @param dataType The data type that was restored.
+ * @param count the number of data items restored.
+ */
+ override fun logLauncherItemsRestored(@BackupRestoreDataType dataType: String, count: Int) {
+ if (Flags.enableLauncherBrMetrics()) {
+ restoreEventLogger.logItemsRestored(dataType, count)
+ }
+ }
+
+ /**
+ * Helper to log successfully restoring a single item from the Favorites table.
+ *
+ * @param favoritesId The id of the item type from [Favorites] that was restored.
+ */
+ override fun logSingleFavoritesItemRestored(favoritesId: Int) {
+ if (Flags.enableLauncherBrMetrics()) {
+ restoreEventLogger.logItemsRestored(favoritesIdToDataType(favoritesId), 1)
+ }
+ }
+
+ /**
+ * Helper to log a failure to restore a single item from the Favorites table.
+ *
+ * @param favoritesId The id of the item type from [Favorites] that was not restored.
+ * @param error error type for why the data was not restored.
+ */
+ override fun logSingleFavoritesItemRestoreFailed(
+ favoritesId: Int,
+ @BackupRestoreError error: String?
+ ) {
+ if (Flags.enableLauncherBrMetrics()) {
+ restoreEventLogger.logItemsRestoreFailed(favoritesIdToDataType(favoritesId), 1, error)
+ }
+ }
+
+ /**
+ * Helper to log a failure to restore items from the Favorites table.
+ *
+ * @param favoritesId The id of the item type from [Favorites] that was not restored.
+ * @param count number of items that failed to restore.
+ * @param error error type for why the data was not restored.
+ */
+ override fun logFavoritesItemsRestoreFailed(
+ favoritesId: Int,
+ count: Int,
+ @BackupRestoreError error: String?
+ ) {
+ if (Flags.enableLauncherBrMetrics()) {
+ restoreEventLogger.logItemsRestoreFailed(
+ favoritesIdToDataType(favoritesId),
+ count,
+ error
+ )
+ }
+ }
+
+ /**
+ * Uses the current [restoreEventLogger] to report its results to the [backupManager]. Use when
+ * done restoring items for Launcher.
+ */
+ override fun reportLauncherRestoreResults() {
+ if (Flags.enableLauncherBrMetrics()) {
+ backupManager.reportDelayedRestoreResult(restoreEventLogger)
+ }
+ }
+
+ /**
+ * Helper method to convert item types from [Favorites] to B&R data types for logging. Also to
+ * avoid direct usage of @BackupRestoreDataType which is protected under @SystemApi.
+ */
+ @BackupRestoreDataType
+ private fun favoritesIdToDataType(favoritesId: Int): String =
+ when (favoritesId) {
+ Favorites.ITEM_TYPE_APPLICATION -> DATA_TYPE_APPLICATION
+ Favorites.ITEM_TYPE_FOLDER -> DATA_TYPE_FOLDER
+ Favorites.ITEM_TYPE_APPWIDGET -> DATA_TYPE_APPWIDGET
+ Favorites.ITEM_TYPE_CUSTOM_APPWIDGET -> DATA_TYPE_CUSTOM_APPWIDGET
+ Favorites.ITEM_TYPE_DEEP_SHORTCUT -> DATA_TYPE_DEEP_SHORTCUT
+ Favorites.ITEM_TYPE_APP_PAIR -> DATA_TYPE_APP_PAIR
+ else -> DATA_TYPE_LAUNCHER_ITEM
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java
index 69c15a5..c91ee81 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java
@@ -25,6 +25,7 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.app.Activity;
+import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Insets;
@@ -86,6 +87,8 @@
private boolean mIsFoldable;
private boolean mOnAttachedToWindowPendingCreate;
+ @Nullable private Runnable mOnAttachedOnGlobalLayoutCallback = null;
+
public static TutorialFragment newInstance(
TutorialType tutorialType, boolean gestureComplete, boolean fromTutorialMenu) {
TutorialFragment fragment = getFragmentForTutorialType(tutorialType, fromTutorialMenu);
@@ -349,13 +352,27 @@
new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
- changeController(mTutorialType);
+ runOnAttached(() -> changeController(mTutorialType));
mRootView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
});
}
}
+ private void runOnAttached(Runnable callback) {
+ mOnAttachedOnGlobalLayoutCallback = callback;
+ if (getContext() != null) {
+ onAttached();
+ }
+ }
+
+ private void onAttached() {
+ if (mOnAttachedOnGlobalLayoutCallback != null) {
+ mOnAttachedOnGlobalLayoutCallback.run();
+ mOnAttachedOnGlobalLayoutCallback = null;
+ }
+ }
+
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (mTutorialController != null && !isGestureComplete()) {
@@ -378,6 +395,12 @@
}
@Override
+ public void onAttach(@NonNull Context context) {
+ super.onAttach(context);
+ onAttached();
+ }
+
+ @Override
void onAttachedToWindow() {
if (mEdgeBackGestureHandler == null) {
mOnAttachedToWindowPendingCreate = true;
diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
index 5d8e53e..baaa062 100644
--- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
+++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
@@ -427,9 +427,16 @@
// conflict with layers that WM core positions (ie. the input consumers). For shell
// transitions, the animation leashes are reparented to an animation container so we
// can bump layers as needed.
- builder.setLayer(mDrawsBelowRecents
- ? Integer.MIN_VALUE + app.prefixOrderIndex
- : ENABLE_SHELL_TRANSITIONS ? Integer.MAX_VALUE : 0);
+ if (ENABLE_SHELL_TRANSITIONS) {
+ builder.setLayer(mDrawsBelowRecents
+ ? Integer.MIN_VALUE + app.prefixOrderIndex
+ // 1000 is an arbitrary number to give room for multiple layers.
+ : Integer.MAX_VALUE - 1000 + app.prefixOrderIndex);
+ } else {
+ builder.setLayer(mDrawsBelowRecents
+ ? Integer.MIN_VALUE + app.prefixOrderIndex
+ : 0);
+ }
}
}
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index b42f055..66a880b 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -1035,9 +1035,6 @@
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
- if (!recentsView.showAsGrid()) {
- return;
- }
recentsView.runActionOnRemoteHandles(
(Consumer<RemoteTargetHandle>) remoteTargetHandle ->
remoteTargetHandle
diff --git a/res/layout/widgets_two_pane_sheet_foldable.xml b/res/layout/widgets_two_pane_sheet_foldable.xml
deleted file mode 100644
index 93c0c70..0000000
--- a/res/layout/widgets_two_pane_sheet_foldable.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2023 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<com.android.launcher3.widget.picker.WidgetsTwoPaneSheet
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:orientation="vertical"
- android:theme="?attr/widgetsTheme">
-
- <androidx.constraintlayout.widget.ConstraintLayout
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:focusable="true"
- android:importantForAccessibility="no">
-
- <View
- android:id="@+id/collapse_handle"
- android:gravity="center_horizontal"
- android:layout_width="@dimen/bottom_sheet_handle_width"
- android:layout_height="@dimen/bottom_sheet_handle_height"
- android:layout_marginTop="@dimen/bottom_sheet_handle_margin"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- android:background="@drawable/widget_picker_collapse_handle"/>
-
- <TextView
- android:id="@+id/title"
- android:gravity="center_horizontal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="24dp"
- android:paddingHorizontal="@dimen/widget_list_horizontal_margin_two_pane"
- android:text="@string/widget_button_text"
- app:layout_constraintTop_toBottomOf="@id/collapse_handle"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- android:textColor="?attr/widgetPickerTitleColor"
- android:textSize="24sp" />
-
- <FrameLayout
- android:id="@+id/recycler_view_container"
- android:layout_width="0dp"
- android:layout_height="0dp"
- app:layout_constraintTop_toBottomOf="@id/title"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintWidth_percent="0.33"
- app:layout_constraintWidth_min="254dp"
- app:layout_constraintWidth_max="395dp">
- <TextView
- android:id="@+id/fast_scroller_popup"
- style="@style/FastScrollerPopup"
- android:layout_marginEnd="@dimen/fastscroll_popup_margin" />
-
- <!-- Fast scroller popup -->
- <com.android.launcher3.views.RecyclerViewFastScroller
- android:id="@+id/fast_scroller"
- android:layout_width="@dimen/fastscroll_width"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/fastscroll_end_margin" />
-
- <com.android.launcher3.widget.picker.WidgetsRecyclerView
- android:id="@+id/search_widgets_list_view"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:clipToPadding="false"
- android:paddingHorizontal="@dimen/widget_list_horizontal_margin_two_pane"
- android:visibility="gone" />
- </FrameLayout>
-
- <FrameLayout
- android:id="@+id/right_pane_container"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:layout_marginEnd="@dimen/widget_list_horizontal_margin_two_pane"
- android:paddingTop="@dimen/widget_list_horizontal_margin_two_pane"
- app:layout_constraintTop_toBottomOf="@id/title"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@id/recycler_view_container"
- app:layout_constraintEnd_toEndOf="parent">
- <TextView
- android:id="@+id/no_widgets_text"
- style="@style/PrimaryHeadline"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="center"
- android:textSize="18sp"
- android:visibility="gone"
- tools:text="No widgets available" />
- <ScrollView
- android:id="@+id/right_pane_scroll_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:fillViewport="true">
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:clipToOutline="true"
- android:paddingBottom="36dp"
- android:background="@drawable/widgets_surface_background"
- android:id="@+id/right_pane">
- <com.android.launcher3.widget.picker.WidgetsRecommendationTableLayout
- android:id="@+id/recommended_widget_table"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingHorizontal=
- "@dimen/widget_list_horizontal_margin_two_pane"
- android:visibility="gone" />
- </LinearLayout>
- </ScrollView>
- </FrameLayout>
- </androidx.constraintlayout.widget.ConstraintLayout>
-</com.android.launcher3.widget.picker.WidgetsTwoPaneSheet>
diff --git a/res/values/config.xml b/res/values/config.xml
index 154312a..2980635 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -86,6 +86,7 @@
<string name="widget_holder_factory_class" translatable="false"></string>
<string name="taskbar_search_session_controller_class" translatable="false"></string>
<string name="taskbar_model_callbacks_factory_class" translatable="false"></string>
+ <string name="launcher_restore_event_logger_class" translatable="false"></string>
<!-- View ID to use for QSB widget -->
<item type="id" name="qsb_widget" />
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 8cb6c71..0a57127 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -367,6 +367,7 @@
<!-- Taskbar related (placeholders to compile in Launcher3 without Quickstep) -->
<dimen name="taskbar_size">0dp</dimen>
+ <dimen name="taskbar_phone_size">@*android:dimen/navigation_bar_frame_height</dimen>
<dimen name="taskbar_stashed_size">0dp</dimen>
<dimen name="qsb_widget_height">0dp</dimen>
<dimen name="qsb_shadow_height">0dp</dimen>
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index e2e528c..91da7e6 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -175,6 +175,7 @@
@ViewDebug.ExportedProperty(category = "launcher")
private DotInfo mDotInfo;
private DotRenderer mDotRenderer;
+ private Locale mCurrentLocale;
@ViewDebug.ExportedProperty(category = "launcher", deepExport = true)
protected DotRenderer.DrawParams mDotParams;
private Animator mDotScaleAnim;
@@ -250,6 +251,7 @@
mDotParams = new DotRenderer.DrawParams();
+ mCurrentLocale = context.getResources().getConfiguration().locale;
setEllipsize(TruncateAt.END);
setAccessibilityDelegate(mActivity.getAccessibilityDelegate());
setTextAlpha(1f);
@@ -411,10 +413,12 @@
* Only if actual text can be displayed in two line, the {@code true} value will be effective.
*/
protected boolean shouldUseTwoLine() {
- return ((FeatureFlags.enableTwolineAllapps())
- && (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW))
- || (FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get()
- && mDisplay == DISPLAY_SEARCH_RESULT);
+ return (FeatureFlags.enableTwolineAllapps() && isCurrentLanguageEnglish())
+ && (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW);
+ }
+
+ protected boolean isCurrentLanguageEnglish() {
+ return mCurrentLocale.equals(Locale.US);
}
@UiThread
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index b6e8ec3..1ca7da9 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -356,7 +356,7 @@
final Resources res = context.getResources();
mMetrics = res.getDisplayMetrics();
- mIconSizeSteps = mIsResponsiveGrid ? new IconSizeSteps(res) : null;
+ mIconSizeSteps = new IconSizeSteps(res);
// Determine sizes.
widthPx = windowBounds.bounds.width();
@@ -1486,6 +1486,17 @@
folderCellWidthPx = roundPxValueFromFloat(folderCellWidthPx * scale);
folderCellHeightPx = roundPxValueFromFloat(folderCellHeightPx * scale);
}
+ // Recalculating padding and cell height
+ folderChildDrawablePaddingPx = getNormalizedFolderChildDrawablePaddingPx(textHeight);
+
+ CellContentDimensions cellContentDimensions = new CellContentDimensions(
+ folderChildIconSizePx,
+ folderChildDrawablePaddingPx,
+ folderChildTextSizePx);
+ cellContentDimensions.resizeToFitCellHeight(folderCellHeightPx, mIconSizeSteps);
+ folderChildIconSizePx = cellContentDimensions.getIconSizePx();
+ folderChildDrawablePaddingPx = cellContentDimensions.getIconDrawablePaddingPx();
+ folderChildTextSizePx = cellContentDimensions.getIconTextSizePx();
folderContentPaddingTop = roundPxValueFromFloat(folderContentPaddingTop * scale);
folderCellLayoutBorderSpacePx = new Point(
@@ -1493,10 +1504,7 @@
roundPxValueFromFloat(folderCellLayoutBorderSpacePx.y * scale)
);
folderFooterHeightPx = roundPxValueFromFloat(folderFooterHeightPx * scale);
-
folderContentPaddingLeftRight = folderCellLayoutBorderSpacePx.x;
-
- folderChildDrawablePaddingPx = getNormalizedFolderChildDrawablePaddingPx(textHeight);
} else {
int cellPaddingX = (int) (res.getDimensionPixelSize(R.dimen.folder_cell_x_padding)
* scale);
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 5adfd43..e41a8a5 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2905,6 +2905,14 @@
// Overridden; move this into ActivityContext if necessary for Taskbar
}
+ /**
+ * Callback for when launcher state transition completes after user swipes to home.
+ * @param finalState The final state of the transition.
+ */
+ public void onStateTransitionCompletedAfterSwipeToHome(LauncherState finalState) {
+ // Overridden
+ }
+
@Override
public void returnToHomescreen() {
super.returnToHomescreen();
diff --git a/src/com/android/launcher3/backuprestore/LauncherRestoreEventLogger.kt b/src/com/android/launcher3/backuprestore/LauncherRestoreEventLogger.kt
new file mode 100644
index 0000000..16b1854
--- /dev/null
+++ b/src/com/android/launcher3/backuprestore/LauncherRestoreEventLogger.kt
@@ -0,0 +1,84 @@
+package com.android.launcher3.backuprestore
+
+import android.content.Context
+import com.android.launcher3.LauncherSettings.Favorites
+import com.android.launcher3.R
+import com.android.launcher3.util.ResourceBasedOverride
+
+/**
+ * Wrapper for logging Restore event metrics for both success and failure to restore the Launcher
+ * workspace from a backup.
+ */
+open class LauncherRestoreEventLogger : ResourceBasedOverride {
+
+ companion object {
+ const val TAG = "LauncherRestoreEventLogger"
+
+ fun newInstance(context: Context?): LauncherRestoreEventLogger {
+ return ResourceBasedOverride.Overrides.getObject(
+ LauncherRestoreEventLogger::class.java,
+ context,
+ R.string.launcher_restore_event_logger_class
+ )
+ }
+ }
+
+ /**
+ * For logging when multiple items of a given data type failed to restore.
+ *
+ * @param dataType The data type that was not restored.
+ * @param count the number of data items that were not restored.
+ * @param error error type for why the data was not restored.
+ */
+ open fun logLauncherItemsRestoreFailed(dataType: String, count: Int, error: String?) {
+ // no-op
+ }
+
+ /**
+ * For logging when multiple items of a given data type were successfully restored.
+ *
+ * @param dataType The data type that was restored.
+ * @param count the number of data items restored.
+ */
+ open fun logLauncherItemsRestored(dataType: String, count: Int) {
+ // no-op
+ }
+
+ /**
+ * Helper to log successfully restoring a single item from the Favorites table.
+ *
+ * @param favoritesId The id of the item type from [Favorites] that was restored.
+ */
+ open fun logSingleFavoritesItemRestored(favoritesId: Int) {
+ // no-op
+ }
+
+ /**
+ * Helper to log a failure to restore a single item from the Favorites table.
+ *
+ * @param favoritesId The id of the item type from [Favorites] that was not restored.
+ * @param error error type for why the data was not restored.
+ */
+ open fun logSingleFavoritesItemRestoreFailed(favoritesId: Int, error: String?) {
+ // no-op
+ }
+
+ /**
+ * Helper to log a failure to restore items from the Favorites table.
+ *
+ * @param favoritesId The id of the item type from [Favorites] that was not restored.
+ * @param count number of items that failed to restore.
+ * @param error error type for why the data was not restored.
+ */
+ open fun logFavoritesItemsRestoreFailed(favoritesId: Int, count: Int, error: String?) {
+ // no-op
+ }
+
+ /**
+ * Uses the current [restoreEventLogger] to report its results to the [backupManager]. Use when
+ * done restoring items for Launcher.
+ */
+ open fun reportLauncherRestoreResults() {
+ // no-op
+ }
+}
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 2f62840..e1816cb 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -308,7 +308,7 @@
"Long press of nav handle is instantly triggered if deep press is detected.");
public static final IntFlag LPNH_HAPTIC_HINT_DELAY =
- getIntFlag(309972570, "LPNH_HAPTIC_HINT_ITERATIONS", 0,
+ getIntFlag(309972570, "LPNH_HAPTIC_HINT_DELAY", 0,
"Delay before haptic hint starts.");
// TODO(Block 17): Clean up flags
diff --git a/src/com/android/launcher3/util/DimensionUtils.kt b/src/com/android/launcher3/util/DimensionUtils.kt
index 0eb0e08..63e919a 100644
--- a/src/com/android/launcher3/util/DimensionUtils.kt
+++ b/src/com/android/launcher3/util/DimensionUtils.kt
@@ -51,12 +51,12 @@
// Taskbar on phone, portrait
if (!deviceProfile.isLandscape) {
p.x = ViewGroup.LayoutParams.MATCH_PARENT
- p.y = res.getDimensionPixelSize(R.dimen.taskbar_size)
+ p.y = res.getDimensionPixelSize(R.dimen.taskbar_phone_size)
return p
}
// Taskbar on phone, landscape
- p.x = res.getDimensionPixelSize(R.dimen.taskbar_size)
+ p.x = res.getDimensionPixelSize(R.dimen.taskbar_phone_size)
p.y = ViewGroup.LayoutParams.MATCH_PARENT
return p
}
diff --git a/src/com/android/launcher3/util/VibratorWrapper.java b/src/com/android/launcher3/util/VibratorWrapper.java
index f283fb6..4f20bbc 100644
--- a/src/com/android/launcher3/util/VibratorWrapper.java
+++ b/src/com/android/launcher3/util/VibratorWrapper.java
@@ -62,7 +62,7 @@
public static final VibrationEffect EFFECT_CLICK =
createPredefined(VibrationEffect.EFFECT_CLICK);
- private static final float LOW_TICK_SCALE = 0.7f;
+ private static final float LOW_TICK_SCALE = 0.9f;
private static final float DRAG_TEXTURE_SCALE = 0.03f;
private static final float DRAG_COMMIT_SCALE = 0.5f;
private static final float DRAG_BUMP_SCALE = 0.4f;
diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
index 583ef1a..e9a590b 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
@@ -163,7 +163,7 @@
private boolean mIsInSearchMode;
private boolean mIsNoWidgetsViewNeeded;
@Px private int mMaxSpanPerRow;
- private DeviceProfile mDeviceProfile;
+ protected DeviceProfile mDeviceProfile;
protected TextView mNoWidgetsView;
protected StickyHeaderLayout mSearchScrollView;
@@ -690,12 +690,7 @@
// Enables two pane picker for unfolded foldables if the flag is on.
|| (activity.getDeviceProfile().isTwoPanels && enableUnfoldedTwoPanePicker());
- if (isTwoPane && activity.getDeviceProfile().isTwoPanels) {
- return R.layout.widgets_two_pane_sheet_foldable;
- } else if (isTwoPane) {
- return R.layout.widgets_two_pane_sheet;
- }
- return R.layout.widgets_full_sheet;
+ return isTwoPane ? R.layout.widgets_two_pane_sheet : R.layout.widgets_full_sheet;
}
@Override
diff --git a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java
index d85737b..c3ab08c 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.widget.picker;
+import static com.android.launcher3.Flags.enableUnfoldedTwoPanePicker;
+
import android.content.Context;
import android.graphics.Outline;
import android.os.Process;
@@ -23,12 +25,15 @@
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;
+import androidx.annotation.Px;
import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
import com.android.launcher3.model.data.PackageItemInfo;
import com.android.launcher3.recyclerview.ViewHolderBinder;
import com.android.launcher3.util.PackageUserKey;
@@ -46,6 +51,8 @@
private static final int PERSONAL_TAB = 0;
private static final int WORK_TAB = 1;
+ private static final int MINIMUM_WIDTH_LEFT_PANE_FOLDABLE_DP = 268;
+ private static final int MAXIMUM_WIDTH_LEFT_PANE_FOLDABLE_DP = 395;
private static final String SUGGESTIONS_PACKAGE_NAME = "widgets_list_suggestions_entry";
private LinearLayout mSuggestedWidgetsContainer;
@@ -117,6 +124,29 @@
}
@Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+ if (changed && mDeviceProfile.isTwoPanels && enableUnfoldedTwoPanePicker()) {
+ LinearLayout layout = mContent.findViewById(R.id.linear_layout_container);
+ FrameLayout leftPane = layout.findViewById(R.id.recycler_view_container);
+ LinearLayout.LayoutParams layoutParams = (LayoutParams) leftPane.getLayoutParams();
+ // Width is 1/3 of the sheet unless it's less than min width or max width
+ int leftPaneWidth = layout.getMeasuredWidth() / 3;
+ @Px int minLeftPaneWidthPx = Utilities.dpToPx(MINIMUM_WIDTH_LEFT_PANE_FOLDABLE_DP);
+ @Px int maxLeftPaneWidthPx = Utilities.dpToPx(MAXIMUM_WIDTH_LEFT_PANE_FOLDABLE_DP);
+ if (leftPaneWidth < minLeftPaneWidthPx) {
+ layoutParams.width = minLeftPaneWidthPx;
+ } else if (leftPaneWidth > maxLeftPaneWidthPx) {
+ layoutParams.width = maxLeftPaneWidthPx;
+ } else {
+ layoutParams.width = 0;
+ }
+ layoutParams.weight = layoutParams.width == 0 ? 0.33F : 0;
+ leftPane.setLayoutParams(layoutParams);
+ }
+ }
+
+ @Override
public void onRecommendedWidgetsBound() {
super.onRecommendedWidgetsBound();
diff --git a/tests/src/com/android/launcher3/dragging/TaplUninstallRemove.java b/tests/src/com/android/launcher3/dragging/TaplUninstallRemove.java
index ed34307..568fc9f 100644
--- a/tests/src/com/android/launcher3/dragging/TaplUninstallRemove.java
+++ b/tests/src/com/android/launcher3/dragging/TaplUninstallRemove.java
@@ -166,9 +166,11 @@
mLauncher.getWorkspace().verifyWorkspaceAppIconIsGone(
DUMMY_APP_NAME + " was expected to disappear after uninstall.", DUMMY_APP_NAME);
- Map<String, Point> finalPositions =
- mLauncher.getWorkspace().getWorkspaceIconsPositions();
- assertThat(finalPositions).doesNotContainKey(DUMMY_APP_NAME);
+ if (!TestStabilityRule.isPresubmit()) { // b/315847371
+ Map<String, Point> finalPositions =
+ mLauncher.getWorkspace().getWorkspaceIconsPositions();
+ assertThat(finalPositions).doesNotContainKey(DUMMY_APP_NAME);
+ }
} finally {
TestUtil.uninstallDummyApp();
}