diff --git a/aconfig/launcher_overview.aconfig b/aconfig/launcher_overview.aconfig
index d27a2143e1..4ffffd2693 100644
--- a/aconfig/launcher_overview.aconfig
+++ b/aconfig/launcher_overview.aconfig
@@ -120,3 +120,10 @@ flag {
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ name: "enable_refactor_digital_wellbeing_toast"
+ namespace: "launcher_overview"
+ description: "Enables rewritten version of digital wellbeing toast in overview."
+ bug: "404838605"
+}
diff --git a/quickstep/res/layout/task.xml b/quickstep/res/layout/task.xml
index 3aac1b63f9..1df80aeff2 100644
--- a/quickstep/res/layout/task.xml
+++ b/quickstep/res/layout/task.xml
@@ -52,6 +52,9 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
-
+
\ No newline at end of file
diff --git a/quickstep/res/layout/task_grouped.xml b/quickstep/res/layout/task_grouped.xml
index 3e6f5eda69..fe6ada98df 100644
--- a/quickstep/res/layout/task_grouped.xml
+++ b/quickstep/res/layout/task_grouped.xml
@@ -81,9 +81,15 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
-
+
-
+
\ No newline at end of file
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java
index 76489e0fa1..63d98d64a5 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java
@@ -26,6 +26,7 @@ import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLA
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.graphics.Rect;
+import android.text.TextUtils;
import android.view.ContextThemeWrapper;
import android.view.MotionEvent;
import android.view.View;
@@ -50,7 +51,6 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
private final TaskbarView mTaskbarView;
private final View mHoverView;
private final ArrowTipView mHoverToolTipView;
- private final String mToolTipText;
private final int mYOffset;
public TaskbarHoverToolTipController(TaskbarActivityContext activity, TaskbarView taskbarView,
@@ -59,17 +59,6 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
mTaskbarView = taskbarView;
mHoverView = hoverView;
- if (mHoverView instanceof BubbleTextView) {
- mToolTipText = ((BubbleTextView) mHoverView).getText().toString();
- } else if (mHoverView instanceof FolderIcon
- && ((FolderIcon) mHoverView).mInfo.title != null) {
- mToolTipText = ((FolderIcon) mHoverView).mInfo.title.toString();
- } else if (mHoverView instanceof AppPairIcon) {
- mToolTipText = ((AppPairIcon) mHoverView).getTitleTextView().getText().toString();
- } else {
- mToolTipText = null;
- }
-
ContextThemeWrapper arrowContextWrapper = new ContextThemeWrapper(mActivity,
R.style.ArrowTipTaskbarStyle);
mHoverToolTipView = new ArrowTipView(arrowContextWrapper, /* isPointingUp = */ false,
@@ -111,9 +100,15 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
}
private void maybeRevealHoverToolTip() {
- if (mHoverView == null || mToolTipText == null) {
+ if (mHoverView == null) {
return;
}
+
+ final String toolTipText = getToolTipText();
+ if (TextUtils.isEmpty(toolTipText)) {
+ return;
+ }
+
// Do not show tooltip if taskbar icons are transitioning to hotseat.
if (mActivity.isIconAlignedWithHotseat()) {
return;
@@ -128,7 +123,19 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
}
Rect iconViewBounds = Utilities.getViewBounds(mHoverView);
- mHoverToolTipView.showAtLocation(mToolTipText, iconViewBounds.centerX(),
+ mHoverToolTipView.showAtLocation(toolTipText, iconViewBounds.centerX(),
mTaskbarView.getTop() - mYOffset, /* shouldAutoClose= */ false);
}
+
+ private String getToolTipText() {
+ if (mHoverView instanceof BubbleTextView btv) {
+ return btv.getText().toString();
+ } else if (mHoverView instanceof FolderIcon icon && icon.mInfo.title != null) {
+ return icon.mInfo.title.toString();
+ } else if (mHoverView instanceof AppPairIcon icon) {
+ return icon.getTitleTextView().getText().toString();
+ } else {
+ return null;
+ }
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
index f3cbdb5a2a..e8f7a00637 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
@@ -559,8 +559,7 @@ public class TaskbarManager implements DisplayDecorationListener {
*/
private void showTaskbarFromBroadcast(Intent intent) {
debugPrimaryTaskbar("destroyTaskbarForDisplay");
- // TODO: make this code displayId specific
- TaskbarActivityContext taskbar = getTaskbarForDisplay(getDefaultDisplayId());
+ TaskbarActivityContext taskbar = getTaskbarForDisplay(getFocusedDisplayId());
if (ACTION_SHOW_TASKBAR.equals(intent.getAction()) && taskbar != null) {
taskbar.showTaskbarFromBroadcast();
}
@@ -580,7 +579,7 @@ public class TaskbarManager implements DisplayDecorationListener {
* Toggles All Apps for Taskbar or Launcher depending on the current state.
*/
public void toggleAllAppsSearch() {
- TaskbarActivityContext taskbar = getTaskbarForDisplay(getDefaultDisplayId());
+ TaskbarActivityContext taskbar = getTaskbarForDisplay(getFocusedDisplayId());
if (taskbar == null) {
// Home All Apps should be toggled from this class, because the controllers are not
// initialized when Taskbar is disabled (i.e. TaskbarActivityContext is null).
@@ -1682,6 +1681,10 @@ public class TaskbarManager implements DisplayDecorationListener {
return mPrimaryDisplayId;
}
+ private int getFocusedDisplayId() {
+ return SystemUiProxy.INSTANCE.get(mBaseContext).getFocusState().getFocusedDisplayId();
+ }
+
/**
* Logs debug information about the TaskbarManager for primary display.
* @param debugReason A string describing the reason for the debug log.
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index b2989cd81a..a5cc124724 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -736,7 +736,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
if (taskIcon != null) {
taskIcon = taskIcon.getConstantState().newDrawable().mutate();
}
- btv.applyIconAndLabel(taskIcon, task.titleDescription);
+ btv.applyIconAndLabel(taskIcon, task.title, task.titleDescription);
btv.setTag(singleTask);
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index 69966cc596..41be44d66b 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -177,6 +177,8 @@ import com.android.quickstep.RecentsModel;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
import com.android.quickstep.TouchInteractionService.TISBinder;
+import com.android.quickstep.fallback.window.RecentsDisplayModel;
+import com.android.quickstep.fallback.window.RecentsWindowManager;
import com.android.quickstep.util.ActiveGestureProtoLogProxy;
import com.android.quickstep.util.AsyncClockEventDelegate;
import com.android.quickstep.util.LauncherUnfoldAnimationController;
@@ -862,6 +864,13 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
if (overviewCommandHelper != null) {
overviewCommandHelper.clearPendingCommands();
}
+ RecentsDisplayModel recentsDisplayModel = RecentsDisplayModel.getINSTANCE().get(this);
+ recentsDisplayModel.getActiveDisplayResources().forEach(resource -> {
+ RecentsWindowManager recentsWindowManager = resource.getRecentsWindowManager();
+ if (recentsWindowManager != null) {
+ recentsWindowManager.onNewIntent();
+ }
+ });
}
public QuickstepTransitionManager getAppTransitionManager() {
diff --git a/quickstep/src/com/android/quickstep/InputConsumerUtils.kt b/quickstep/src/com/android/quickstep/InputConsumerUtils.kt
index 89b5b291c6..af96a8b3b6 100644
--- a/quickstep/src/com/android/quickstep/InputConsumerUtils.kt
+++ b/quickstep/src/com/android/quickstep/InputConsumerUtils.kt
@@ -23,6 +23,7 @@ import com.android.launcher3.statemanager.BaseState
import com.android.launcher3.statemanager.StatefulContainer
import com.android.launcher3.taskbar.TaskbarManager
import com.android.launcher3.util.LockedUserState.Companion.get
+import com.android.quickstep.fallback.window.RecentsWindowFlags
import com.android.quickstep.inputconsumers.AccessibilityInputConsumer
import com.android.quickstep.inputconsumers.AssistantInputConsumer
import com.android.quickstep.inputconsumers.BubbleBarInputConsumer
@@ -631,6 +632,7 @@ object InputConsumerUtils {
inputEventReceiver,
gestureState,
event,
+ runningTask.isHomeTask,
)
}
}
@@ -790,13 +792,16 @@ object InputConsumerUtils {
inputEventReceiver: InputChannelCompat.InputEventReceiver,
gestureState: GestureState,
event: MotionEvent,
+ isHomeTask: Boolean,
): InputConsumer where T : RecentsViewContainer, T : StatefulContainer {
val shouldDefer =
(!overviewComponentObserver.isHomeAndOverviewSame ||
gestureState
.getContainerInterface()
.deferStartingActivity(deviceState, event))
- val disableHorizontalSwipe = deviceState.isInExclusionRegion(event)
+ val disableHorizontalSwipe =
+ deviceState.isInExclusionRegion(event) &&
+ (!RecentsWindowFlags.enableOverviewInWindow || !isHomeTask)
return OtherActivityInputConsumer(
/* base= */ context,
deviceState,
diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
index e9f70242cd..b6046810ba 100644
--- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
+++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
@@ -206,7 +206,7 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
@Override
protected WindowInsets getWindowInsets() {
RecentsViewContainer container = getRecentsViewContainer();
- WindowInsets insets = container == null
+ WindowInsets insets = container == null || container.getRootView() == null
? null : container.getRootView().getRootWindowInsets();
return insets == null ? super.getWindowInsets() : insets;
}
diff --git a/quickstep/src/com/android/quickstep/TaskIconCache.kt b/quickstep/src/com/android/quickstep/TaskIconCache.kt
index f0b9b7be5c..7d428a4704 100644
--- a/quickstep/src/com/android/quickstep/TaskIconCache.kt
+++ b/quickstep/src/com/android/quickstep/TaskIconCache.kt
@@ -85,9 +85,9 @@ class TaskIconCache(
// TODO(b/387496731): Add ensureActive() calls if they show performance benefit
override suspend fun getIcon(task: Task): TaskCacheEntry {
- task.icon?.let {
+ task.icon?.let { icon ->
// Nothing to load, the icon is already loaded
- return TaskCacheEntry(it, task.titleDescription ?: "", task.title)
+ return TaskCacheEntry(icon, task.titleDescription ?: "", task.title ?: "")
}
val entry = getCacheEntry(task)
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
index dc1cdde4bc..be9b4a1fc5 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
@@ -23,6 +23,7 @@ import static com.android.quickstep.fallback.RecentsState.DEFAULT;
import static com.android.quickstep.fallback.RecentsState.MODAL_TASK;
import static com.android.quickstep.fallback.RecentsState.OVERVIEW_SPLIT_SELECT;
+import android.animation.Animator;
import android.animation.AnimatorSet;
import android.content.Context;
import android.util.AttributeSet;
@@ -136,17 +137,22 @@ public class FallbackRecentsView setCurrentTask(-1));
- AnimatorPlaybackController controller = pa.createPlaybackController();
+ pendingAnimation.addEndListener(e -> setCurrentTask(-1));
+ AnimatorPlaybackController controller = pendingAnimation.createPlaybackController();
controller.dispatchOnStart();
- animatorSet.play(controller.getAnimationPlayer());
+ Animator homeDismissAnimator = controller.getAnimationPlayer();
+ if (animatorSet != null) {
+ animatorSet.play(homeDismissAnimator);
+ } else {
+ homeDismissAnimator.setDuration(0).start();
+ }
}
}
}
diff --git a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt
index bc08af2da6..fe387fdc64 100644
--- a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt
+++ b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt
@@ -297,6 +297,10 @@ class RecentsWindowManager(context: Context, wallpaperColorHints: Int) :
stateManager.moveToRestState()
}
+ fun onNewIntent() {
+ cleanupRecentsWindow()
+ }
+
private fun cleanupRecentsWindow() {
RecentsWindowProtoLogProxy.logCleanup(isShowing())
if (isShowing()) {
diff --git a/quickstep/src/com/android/quickstep/recents/ui/viewmodel/TaskViewModel.kt b/quickstep/src/com/android/quickstep/recents/ui/viewmodel/TaskViewModel.kt
index fac0c0a0bb..9f762e724c 100644
--- a/quickstep/src/com/android/quickstep/recents/ui/viewmodel/TaskViewModel.kt
+++ b/quickstep/src/com/android/quickstep/recents/ui/viewmodel/TaskViewModel.kt
@@ -34,6 +34,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOn
@@ -91,6 +92,16 @@ class TaskViewModel(
val state: Flow =
combine(taskData, isLiveTile, overlayEnabled, isCentralTask, ::mapToTaskTile)
.distinctUntilChanged()
+ .debounce { state ->
+ // Debouncing only when thumbnails are not present gives the best results.
+ // This is because thumbnail loading is a decent predictor of there being no more
+ // emissions to come as they are typically the last emission for a TaskView.
+ if (state.tasks.any { (it as? TaskData.Data)?.thumbnailData?.thumbnail == null }) {
+ DEBOUNCE_DELAY_MS
+ } else {
+ 0
+ }
+ }
.flowOn(dispatcherProvider.background)
fun bind(vararg taskId: TaskId) {
@@ -150,5 +161,6 @@ class TaskViewModel(
private companion object {
const val TAG = "TaskViewModel"
+ const val DEBOUNCE_DELAY_MS = 16L
}
}
diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt b/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt
index 8b124555f1..273fc77e70 100644
--- a/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt
+++ b/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt
@@ -179,7 +179,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu
?.inflate()
}
- private fun positionTaskWindows() {
+ private fun positionTaskWindows(updateLayout: Boolean = false) {
if (taskContainers.isEmpty()) {
return
}
@@ -197,33 +197,33 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu
val scaleWidth = taskViewWidth / screenWidth.toFloat()
val scaleHeight = taskViewHeight / screenHeight.toFloat()
- taskContainers.forEach {
- val taskId = it.task.key.id
- val fullscreenTaskPosition =
- fullscreenTaskPositions.firstOrNull { it.taskId == taskId } ?: return
- val overviewTaskPosition =
+ taskContainers.forEach { taskContainer ->
+ val taskId = taskContainer.task.key.id
+ val fullscreenTaskBounds =
+ fullscreenTaskPositions.firstOrNull { it.taskId == taskId }?.bounds ?: return
+ val overviewTaskBounds =
if (enableDesktopExplodedView()) {
viewModel!!
.organizedDesktopTaskPositions
.firstOrNull { it.taskId == taskId }
- ?.let { organizedPosition ->
- TEMP_OVERVIEW_TASK_POSITION.apply {
- lerpRect(
- fullscreenTaskPosition.bounds,
- organizedPosition.bounds,
- explodeProgress,
- )
- }
- } ?: fullscreenTaskPosition.bounds
+ ?.bounds ?: fullscreenTaskBounds
} else {
- fullscreenTaskPosition.bounds
+ fullscreenTaskBounds
+ }
+ val currentTaskBounds =
+ if (enableDesktopExplodedView()) {
+ TEMP_OVERVIEW_TASK_POSITION.apply {
+ lerpRect(fullscreenTaskBounds, overviewTaskBounds, explodeProgress)
+ }
+ } else {
+ fullscreenTaskBounds
}
if (enableDesktopExplodedView()) {
getRemoteTargetHandle(taskId)?.let { remoteTargetHandle ->
val fromRect =
TEMP_FROM_RECTF.apply {
- set(fullscreenTaskPosition.bounds)
+ set(fullscreenTaskBounds)
scale(scaleWidth)
offset(
lastComputedTaskSize.left.toFloat(),
@@ -232,7 +232,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu
}
val toRect =
TEMP_TO_RECTF.apply {
- set(overviewTaskPosition)
+ set(currentTaskBounds)
scale(scaleWidth)
offset(
lastComputedTaskSize.left.toFloat(),
@@ -246,41 +246,30 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu
}
}
- val taskLeft = overviewTaskPosition.left * scaleWidth
- val taskTop = overviewTaskPosition.top * scaleHeight
- val taskWidth = overviewTaskPosition.width() * scaleWidth
- val taskHeight = overviewTaskPosition.height() * scaleHeight
- // TODO(b/394660950): Revisit the choice to update the layout when explodeProgress == 1.
- // To run the explode animation in reverse, it may be simpler to use translation/scale
- // for all cases where the progress is non-zero.
- if (explodeProgress == 0.0f || explodeProgress == 1.0f) {
- // Reset scaling and translation that may have been applied during animation.
- it.snapshotView.apply {
- scaleX = 1.0f
- scaleY = 1.0f
- translationX = 0.0f
- translationY = 0.0f
- }
-
+ val overviewTaskLeft = overviewTaskBounds.left * scaleWidth
+ val overviewTaskTop = overviewTaskBounds.top * scaleHeight
+ val overviewTaskWidth = overviewTaskBounds.width() * scaleWidth
+ val overviewTaskHeight = overviewTaskBounds.height() * scaleHeight
+ if (updateLayout) {
// Position the task to the same position as it would be on the desktop
- it.snapshotView.updateLayoutParams {
+ taskContainer.snapshotView.updateLayoutParams {
gravity = Gravity.LEFT or Gravity.TOP
- width = taskWidth.toInt()
- height = taskHeight.toInt()
- leftMargin = taskLeft.toInt()
- topMargin = taskTop.toInt()
+ width = overviewTaskWidth.toInt()
+ height = overviewTaskHeight.toInt()
+ leftMargin = overviewTaskLeft.toInt()
+ topMargin = overviewTaskTop.toInt()
}
if (
enableDesktopRecentsTransitionsCornersBugfix() && enableRefactorTaskThumbnail()
) {
- it.thumbnailView.outlineBounds =
- if (intersects(overviewTaskPosition, screenRect))
- Rect(overviewTaskPosition).apply {
+ taskContainer.thumbnailView.outlineBounds =
+ if (intersects(overviewTaskBounds, screenRect))
+ Rect(overviewTaskBounds).apply {
intersectUnchecked(screenRect)
// Offset to 0,0 to transform into TaskThumbnailView's coordinate
// system.
- offset(-overviewTaskPosition.left, -overviewTaskPosition.top)
+ offset(-overviewTaskBounds.left, -overviewTaskBounds.top)
left = (left * scaleWidth).roundToInt()
top = (top * scaleHeight).roundToInt()
right = (right * scaleWidth).roundToInt()
@@ -288,17 +277,21 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu
}
else null
}
- } else {
- // During the animation, apply translation and scale such that the view is
- // transformed to where we want, without triggering layout.
- it.snapshotView.apply {
- pivotX = 0.0f
- pivotY = 0.0f
- translationX = taskLeft - left
- translationY = taskTop - top
- scaleX = taskWidth / width.toFloat()
- scaleY = taskHeight / height.toFloat()
- }
+ }
+
+ val currentTaskLeft = currentTaskBounds.left * scaleWidth
+ val currentTaskTop = currentTaskBounds.top * scaleHeight
+ val currentTaskWidth = currentTaskBounds.width() * scaleWidth
+ val currentTaskHeight = currentTaskBounds.height() * scaleHeight
+ // During the animation, apply translation and scale such that the view is transformed
+ // to where we want, without triggering layout.
+ taskContainer.snapshotView.apply {
+ pivotX = 0.0f
+ pivotY = 0.0f
+ translationX = currentTaskLeft - overviewTaskLeft
+ translationY = currentTaskTop - overviewTaskTop
+ scaleX = currentTaskWidth / overviewTaskWidth
+ scaleY = currentTaskHeight / overviewTaskHeight
}
}
}
@@ -509,7 +502,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu
if (enableDesktopExplodedView()) {
viewModel?.organizeDesktopTasks(desktopSize, fullscreenTaskPositions)
}
- positionTaskWindows()
+ positionTaskWindows(updateLayout = true)
}
companion object {
diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt b/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt
index faa9e2893b..8086f3d1f1 100644
--- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt
+++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt
@@ -109,6 +109,9 @@ class GroupedTaskView @JvmOverloads constructor(context: Context, attrs: Attribu
else R.layout.icon_view
}
?.inflate()
+ findViewById(R.id.bottomRight_digital_wellbeing_toast)
+ ?.apply { layoutResource = R.layout.digital_wellbeing_toast }
+ ?.inflate()
}
override fun onRecycle() {
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 3e4b953b5b..53b1301f8f 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -2771,6 +2771,7 @@ public abstract class RecentsView<
}
if (enableRefactorTaskThumbnail()) {
mRecentsViewModel.onReset();
+ getTaskViews().forEach(TaskView::cancelJobs);
}
}
diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.kt b/quickstep/src/com/android/quickstep/views/TaskMenuView.kt
index f7cb7bef78..c0b0e9a817 100644
--- a/quickstep/src/com/android/quickstep/views/TaskMenuView.kt
+++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.kt
@@ -429,6 +429,7 @@ constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int = 0) :
var additionalTranslationX = 0f
if (
+ taskView.pagedOrientationHandler.isLayoutNaturalToLauncher &&
taskContainer.stagePosition == SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT
) {
// Animate menu and icon when split task would display off the side of the screen.
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.kt b/quickstep/src/com/android/quickstep/views/TaskView.kt
index fa3fd91615..c52b26bb6f 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.kt
+++ b/quickstep/src/com/android/quickstep/views/TaskView.kt
@@ -780,6 +780,10 @@ constructor(
else R.layout.icon_view
}
?.inflate()
+
+ findViewById(R.id.digital_wellbeing_toast)
+ ?.apply { layoutResource = R.layout.digital_wellbeing_toast }
+ ?.inflate()
}
override fun onAttachedToWindow() =
@@ -888,17 +892,21 @@ constructor(
return thumbnailPosition
}
- override fun onDetachedFromWindow() =
- traceSection("TaskView.onDetachedFromWindow") {
- super.onDetachedFromWindow()
- if (enableRefactorTaskThumbnail()) {
- // The jobs are being cancelled in the background thread. So we make a copy of the
- // list to prevent cleaning a new job that might be added to this list during
- // onAttach or another moment in the lifecycle.
- val coroutineJobsToCancel = coroutineJobs.toList()
- coroutineJobs.clear()
+ override fun onDetachedFromWindow() {
+ super.onDetachedFromWindow()
+ cancelJobs()
+ }
+
+ fun cancelJobs() =
+ traceSection("TaskView.cancelJobs") {
+ // The jobs are being cancelled in the background thread. So we make a copy of the
+ // list to prevent cleaning a new job that might be added to this list during
+ // onAttach or another moment in the lifecycle.
+ val coroutineJobsToCancel = coroutineJobs.toList()
+ coroutineJobs.clear()
+ if (coroutineJobsToCancel.isNotEmpty()) {
coroutineScope.launch(dispatcherProvider.background) {
- traceSection("TaskView.onDetachedFromWindow.cancellingJobs") {
+ traceSection("TaskView.cancelJobs.cancellingJobs") {
coroutineJobsToCancel.forEach {
it.cancel("TaskView detaching from window")
}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.kt
index d2b9fcf2c5..529174a253 100644
--- a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.kt
@@ -147,6 +147,15 @@ class TaskbarHoverToolTipControllerTest {
assertThat(isHoverToolTipOpen).isFalse()
}
+ @Test
+ fun onHover_emptyTitle_noTooltip() {
+ runOnMainSync {
+ iconView.text = ""
+ iconView.dispatchGenericMotionEvent(HOVER_ENTER)
+ }
+ assertThat(isHoverToolTipOpen).isFalse()
+ }
+
companion object {
private val HOVER_EXIT = MotionEvent.obtain(0, 0, ACTION_HOVER_EXIT, 0f, 0f, 0)
private val HOVER_ENTER = MotionEvent.obtain(0, 0, ACTION_HOVER_ENTER, 0f, 0f, 0)
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index b207d4ac8f..fc60bec151 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -31,6 +31,7 @@ import static org.junit.Assume.assumeTrue;
import android.content.Intent;
import android.content.res.Configuration;
+import android.platform.test.annotations.EnableFlags;
import androidx.annotation.NonNull;
import androidx.test.filters.LargeTest;
@@ -39,6 +40,7 @@ import androidx.test.runner.AndroidJUnit4;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.Until;
+import com.android.launcher3.Flags;
import com.android.launcher3.LauncherState;
import com.android.launcher3.tapl.BaseOverview;
import com.android.launcher3.tapl.LaunchedAppState;
@@ -65,6 +67,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.Comparator;
+import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -560,20 +563,21 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test
@PortraitLandscape
+ @EnableFlags(value = Flags.FLAG_ENABLE_GRID_ONLY_OVERVIEW)
public void testDismissBottomRow() throws Exception {
assumeTrue(mLauncher.isTablet());
mLauncher.goHome().switchToOverview().dismissAllTasks();
startTestAppsWithCheck();
+
Overview overview = mLauncher.goHome().switchToOverview();
assertIsInState("Launcher internal state didn't switch to Overview",
ExpectedState.OVERVIEW);
final Integer numTasks = getFromRecentsView(RecentsView::getTaskViewCount);
- OverviewTask bottomTask = overview.getCurrentTasksForTablet().stream().max(
- Comparator.comparingInt(OverviewTask::getTaskCenterY)).get();
- assertNotNull("bottomTask null", bottomTask);
-
- bottomTask.dismiss();
+ Optional bottomTask = overview.getCurrentTasksForTablet().stream().max(
+ Comparator.comparingInt(OverviewTask::getTaskCenterY));
+ assertTrue("bottomTask null", bottomTask.isPresent());
+ bottomTask.get().dismiss();
runOnRecentsView(recentsView -> assertEquals(
"Dismissing a bottomTask didn't remove 1 bottomTask from Overview",
numTasks - 1, recentsView.getTaskViewCount()));
@@ -581,34 +585,38 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test
@PortraitLandscape
+ @EnableFlags(value = Flags.FLAG_ENABLE_GRID_ONLY_OVERVIEW)
public void testDismissLastGridRow() throws Exception {
assumeTrue(mLauncher.isTablet());
mLauncher.goHome().switchToOverview().dismissAllTasks();
startTestAppsWithCheck();
startTestActivity(3);
startTestActivity(4);
- runOnRecentsView(
- recentsView -> assertNotEquals("Grid overview should have unequal row counts",
- recentsView.getTopRowTaskCountForTablet(),
- recentsView.getBottomRowTaskCountForTablet()));
+ runOnRecentsView(recentsView -> assertNotEquals(
+ "Grid overview should have unequal row counts",
+ recentsView.getTopRowTaskCountForTablet(),
+ recentsView.getBottomRowTaskCountForTablet()));
Overview overview = mLauncher.goHome().switchToOverview();
assertIsInState("Launcher internal state didn't switch to Overview",
ExpectedState.OVERVIEW);
+
overview.flingForwardUntilClearAllVisible();
assertTrue("Clear All not visible.", overview.isClearAllVisible());
final Integer numTasks = getFromRecentsView(RecentsView::getTaskViewCount);
- OverviewTask lastGridTask = overview.getCurrentTasksForTablet().stream().min(
- Comparator.comparingInt(OverviewTask::getTaskCenterX)).get();
- assertNotNull("lastGridTask null.", lastGridTask);
+ Optional lastGridTask = overview.getCurrentTasksForTablet().stream().min(
+ Comparator.comparingInt(OverviewTask::getTaskCenterX));
+ assertTrue("lastGridTask null.", lastGridTask.isPresent());
- lastGridTask.dismiss();
-
- runOnRecentsView(recentsView -> assertEquals(
- "Dismissing a lastGridTask didn't remove 1 lastGridTask from Overview",
- numTasks - 1, recentsView.getTaskViewCount()));
- runOnRecentsView(recentsView -> assertEquals("Grid overview should have equal row counts.",
- recentsView.getTopRowTaskCountForTablet(),
- recentsView.getBottomRowTaskCountForTablet()));
+ lastGridTask.get().dismiss();
+ runOnRecentsView(recentsView -> {
+ assertEquals(
+ "Dismissing a lastGridTask didn't remove 1 lastGridTask from Overview",
+ numTasks - 1, recentsView.getTaskViewCount());
+ assertEquals(
+ "Grid overview should have equal row counts.",
+ recentsView.getTopRowTaskCountForTablet(),
+ recentsView.getBottomRowTaskCountForTablet());
+ });
assertTrue("Clear All not visible.", overview.isClearAllVisible());
}
diff --git a/res/layout/all_apps_personal_work_tabs.xml b/res/layout/all_apps_personal_work_tabs.xml
index 1435f8203d..f81ea977e7 100644
--- a/res/layout/all_apps_personal_work_tabs.xml
+++ b/res/layout/all_apps_personal_work_tabs.xml
@@ -37,7 +37,7 @@
android:contentDescription="@string/all_apps_personal_tab_content_description"
android:textColor="@color/all_apps_tab_text"
android:textSize="14sp"
- style="?android:attr/borderlessButtonStyle" />
+ style="@style/AllAppsPersonalWorkTabStyle" />
+ style="@style/AllAppsPersonalWorkTabStyle" />
\ No newline at end of file
diff --git a/res/layout/private_space_header.xml b/res/layout/private_space_header.xml
index 29da5aaf44..db11d7bff2 100644
--- a/res/layout/private_space_header.xml
+++ b/res/layout/private_space_header.xml
@@ -75,7 +75,7 @@
android:maxLines="1"
android:visibility="gone"
android:alpha="0"
- style="@style/TextHeadline"/>
+ style="@style/PrivateSpaceLockTextStyle"/>
+ android:textSize="14sp"
+ style="@style/WorkPausedBodyTextStyle"/>
+ android:textSize="14sp"
+ style="@style/WorkPausedBodyTextStyle"/>
\ No newline at end of file
diff --git a/res/layout/work_mode_fab.xml b/res/layout/work_mode_fab.xml
index d6d83e4405..5d1c0f4c82 100644
--- a/res/layout/work_mode_fab.xml
+++ b/res/layout/work_mode_fab.xml
@@ -45,5 +45,5 @@
android:layout_marginStart="@dimen/work_fab_text_start_margin"
android:layout_marginEnd="@dimen/work_fab_text_end_margin"
android:maxLines="1"
- style="@style/TextHeadline"/>
+ style="@style/WorkModeFabTextStyle"/>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 7d5b57587b..84c34e3435 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -364,6 +364,9 @@
- @animator/all_apps_fastscroll_icon_anim
- @dimen/dynamic_grid_cell_padding_x
- @dimen/dynamic_grid_cell_padding_x
+ -
+ variable-title-small
+
@@ -474,7 +477,36 @@
+
+
+
+
+
+
+
+
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 30e3a2b577..6684e4ce45 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -473,10 +473,10 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
* Directly set the icon and label.
*/
@UiThread
- public void applyIconAndLabel(Drawable icon, CharSequence label) {
+ public void applyIconAndLabel(Drawable icon, CharSequence title, CharSequence description) {
applyCompoundDrawables(icon);
- setText(label);
- setContentDescription(label);
+ setText(title);
+ setContentDescription(description);
}
/** Updates whether the app this view represents is currently running. */
diff --git a/src/com/android/launcher3/graphics/GridCustomizationsProxy.java b/src/com/android/launcher3/graphics/GridCustomizationsProxy.java
index 7bd9a28416..d8a10c16bd 100644
--- a/src/com/android/launcher3/graphics/GridCustomizationsProxy.java
+++ b/src/com/android/launcher3/graphics/GridCustomizationsProxy.java
@@ -56,11 +56,9 @@ import com.android.launcher3.util.RunnableList;
import com.android.systemui.shared.Flags;
import java.lang.ref.WeakReference;
-import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
-import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
@@ -171,16 +169,10 @@ public class GridCustomizationsProxy implements ProxyProvider {
if (Flags.newCustomizationPickerUi()) {
MatrixCursor cursor = new MatrixCursor(new String[]{
KEY_SHAPE_KEY, KEY_SHAPE_TITLE, KEY_PATH, KEY_IS_DEFAULT});
- String currentShapePath = mThemeManager.getIconState().getIconMask();
- Optional selectedShape = Arrays.stream(
- ShapesProvider.INSTANCE.getIconShapes()).filter(
- shape -> shape.getPathString().equals(currentShapePath)
- ).findFirst();
- // Handle default for when current shape doesn't match new shapes.
- if (selectedShape.isEmpty()) {
- selectedShape = Optional.of(Arrays.stream(
- ShapesProvider.INSTANCE.getIconShapes()
- ).findFirst().get());
+ String currentShape = mPrefs.get(PREF_ICON_SHAPE);
+ if (TextUtils.isEmpty(currentShape)) {
+ // Handle default for when there is no current shape.
+ currentShape = ShapesProvider.INSTANCE.getIconShapes()[0].getKey();
}
for (IconShapeModel shape : ShapesProvider.INSTANCE.getIconShapes()) {
@@ -188,7 +180,7 @@ public class GridCustomizationsProxy implements ProxyProvider {
.add(KEY_SHAPE_KEY, shape.getKey())
.add(KEY_SHAPE_TITLE, shape.getTitle())
.add(KEY_PATH, shape.getPathString())
- .add(KEY_IS_DEFAULT, shape.equals(selectedShape.get()));
+ .add(KEY_IS_DEFAULT, shape.getKey().equals(currentShape));
}
return cursor;
} else {
@@ -254,9 +246,9 @@ public class GridCustomizationsProxy implements ProxyProvider {
if (match == null) {
return 0;
}
-
mIdp.setCurrentGrid(mContext, gridName);
- if (Flags.newCustomizationPickerUi()) {
+ boolean didGridChange = !mPrefs.get(LauncherPrefs.GRID_NAME).equals(gridName);
+ if (Flags.newCustomizationPickerUi() && didGridChange) {
try {
// Wait for device profile to be fully reloaded and applied to the launcher
loadModelSync(mContext);
diff --git a/src/com/android/launcher3/icons/LauncherIcons.kt b/src/com/android/launcher3/icons/LauncherIcons.kt
index 29c0de1e5a..ef3eccc8b0 100644
--- a/src/com/android/launcher3/icons/LauncherIcons.kt
+++ b/src/com/android/launcher3/icons/LauncherIcons.kt
@@ -88,7 +88,12 @@ internal constructor(
canvas.clipPath(overridePath)
canvas.drawColor(Color.BLACK)
canvas.save()
- canvas.scale(iconScale, iconScale, canvas.width / 2f, canvas.height / 2f)
+ canvas.scale(
+ iconScale,
+ iconScale,
+ drawable.bounds.exactCenterX(),
+ drawable.bounds.exactCenterY(),
+ )
if (drawable.background != null) {
drawable.background.draw(canvas)
}
diff --git a/src/com/android/launcher3/views/ClipIconView.java b/src/com/android/launcher3/views/ClipIconView.java
index a295d6b52e..8439c3f98a 100644
--- a/src/com/android/launcher3/views/ClipIconView.java
+++ b/src/com/android/launcher3/views/ClipIconView.java
@@ -49,6 +49,7 @@ import com.android.launcher3.Flags;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.dragndrop.FolderAdaptiveIcon;
+import com.android.launcher3.graphics.ShapeDelegate;
import com.android.launcher3.graphics.ThemeManager;
/**
@@ -67,6 +68,7 @@ public class ClipIconView extends View implements ClipPathView {
private @Nullable Drawable mBackground;
private boolean mIsAdaptiveIcon = false;
+ private boolean mIsFolderIcon = false;
private ValueAnimator mRevealAnimator;
private float mIconScale;
@@ -180,8 +182,9 @@ public class ClipIconView extends View implements ClipPathView {
if ((!isOpening || Flags.enableLauncherIconShapes())
&& progress >= shapeProgressStart) {
if (mRevealAnimator == null) {
- mRevealAnimator = themeManager.getIconShape()
- .createRevealAnimator(this, mStartRevealRect,
+ ShapeDelegate shape = mIsFolderIcon ? themeManager.getFolderShape()
+ : themeManager.getIconShape();
+ mRevealAnimator = shape.createRevealAnimator(this, mStartRevealRect,
mOutline, mTaskCornerRadius, !isOpening);
mRevealAnimator.addListener(forEndCallback(() -> mRevealAnimator = null));
mRevealAnimator.start();
@@ -235,7 +238,7 @@ public class ClipIconView extends View implements ClipPathView {
boolean isOpening, DeviceProfile dp) {
mIsAdaptiveIcon = drawable instanceof AdaptiveIconDrawable;
if (mIsAdaptiveIcon) {
- boolean isFolderIcon = drawable instanceof FolderAdaptiveIcon;
+ mIsFolderIcon = drawable instanceof FolderAdaptiveIcon;
AdaptiveIconDrawable adaptiveIcon = (AdaptiveIconDrawable) drawable;
Drawable background = adaptiveIcon.getBackground();
@@ -255,7 +258,7 @@ public class ClipIconView extends View implements ClipPathView {
int blurMargin = mBlurSizeOutline / 2;
mFinalDrawableBounds.set(0, 0, originalWidth, originalHeight);
- if (!isFolderIcon) {
+ if (!mIsFolderIcon) {
mFinalDrawableBounds.inset(iconOffset - blurMargin, iconOffset - blurMargin);
}
mForeground.setBounds(mFinalDrawableBounds);
@@ -263,7 +266,7 @@ public class ClipIconView extends View implements ClipPathView {
mStartRevealRect.set(0, 0, originalWidth, originalHeight);
- if (!isFolderIcon) {
+ if (!mIsFolderIcon) {
Utilities.scaleRectAboutCenter(mStartRevealRect, ICON_VISIBLE_AREA_FACTOR);
}
@@ -319,11 +322,13 @@ public class ClipIconView extends View implements ClipPathView {
canvas.clipPath(mClipPath);
}
int count2 = canvas.save();
- float iconCenterX =
- (mFinalDrawableBounds.right - mFinalDrawableBounds.left) / 2f * mIconScale;
- float iconCenterY =
- (mFinalDrawableBounds.bottom - mFinalDrawableBounds.top) / 2f * mIconScale;
- canvas.scale(mIconScale, mIconScale, iconCenterX, iconCenterY);
+ if (!mIsFolderIcon) {
+ float iconCenterX =
+ (mFinalDrawableBounds.right - mFinalDrawableBounds.left) / 2f * mIconScale;
+ float iconCenterY =
+ (mFinalDrawableBounds.bottom - mFinalDrawableBounds.top) / 2f * mIconScale;
+ canvas.scale(mIconScale, mIconScale, iconCenterX, iconCenterY);
+ }
if (mBackground != null) {
mBackground.draw(canvas);
}
diff --git a/tests/multivalentTests/src/com/android/launcher3/model/ShortcutsChangedTaskTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/ShortcutsChangedTaskTest.kt
index 0ab736b26c..8fd042878d 100644
--- a/tests/multivalentTests/src/com/android/launcher3/model/ShortcutsChangedTaskTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/model/ShortcutsChangedTaskTest.kt
@@ -39,11 +39,9 @@ import com.android.launcher3.model.data.WorkspaceItemInfo
import com.android.launcher3.shortcuts.ShortcutKey
import com.android.launcher3.util.ComponentKey
import com.android.launcher3.util.IntSparseArrayMap
-import com.android.launcher3.util.LauncherModelHelper
-import com.android.launcher3.util.LauncherModelHelper.SandboxModelContext
+import com.android.launcher3.util.SandboxApplication
import com.google.common.truth.Truth.assertThat
import java.util.function.Predicate
-import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@@ -60,19 +58,20 @@ import org.mockito.kotlin.whenever
@RunWith(AndroidJUnit4::class)
class ShortcutsChangedTaskTest {
@get:Rule val setFlagsRule: SetFlagsRule = SetFlagsRule()
+ @get:Rule val context = SandboxApplication()
private lateinit var shortcutsChangedTask: ShortcutsChangedTask
- private lateinit var modelHelper: LauncherModelHelper
- private lateinit var context: SandboxModelContext
private lateinit var launcherApps: LauncherApps
private var shortcuts: List = emptyList()
private val expectedPackage: String = "expected"
private val expectedShortcutId: String = "shortcut_id"
private val user: UserHandle = myUserHandle()
+
private val mockTaskController: ModelTaskController = mock()
private val mockAllApps: AllAppsList = mock()
private val mockIconCache: IconCache = mock()
+ private val bgDataModel = BgDataModel(mock())
private val expectedWai =
WorkspaceItemInfo().apply {
@@ -87,9 +86,6 @@ class ShortcutsChangedTaskTest {
@Before
fun setup() {
- modelHelper = LauncherModelHelper()
- modelHelper.loadModelSync()
- context = modelHelper.sandboxContext
launcherApps = context.spyService(LauncherApps::class.java)
whenever(mockTaskController.context).thenReturn(context)
whenever(mockTaskController.iconCache).thenReturn(mockIconCache)
@@ -99,11 +95,6 @@ class ShortcutsChangedTaskTest {
shortcutsChangedTask = ShortcutsChangedTask(expectedPackage, shortcuts, user, false)
}
- @After
- fun teardown() {
- modelHelper.destroy()
- }
-
@Test
fun `When installed pinned shortcut is found then keep in workspace`() {
// Given
@@ -114,7 +105,7 @@ class ShortcutsChangedTaskTest {
whenever(id).thenReturn(expectedShortcutId)
}
)
- val items: IntSparseArrayMap = modelHelper.bgDataModel.itemsIdMap
+ val items: IntSparseArrayMap = bgDataModel.itemsIdMap
items.put(expectedWai.id, expectedWai)
doReturn(
ApplicationInfo().apply {
@@ -127,7 +118,7 @@ class ShortcutsChangedTaskTest {
.getApplicationInfo(eq(expectedPackage), any(), eq(user))
doReturn(shortcuts).whenever(launcherApps).getShortcuts(any(), eq(user))
// When
- shortcutsChangedTask.execute(mockTaskController, modelHelper.bgDataModel, mockAllApps)
+ shortcutsChangedTask.execute(mockTaskController, bgDataModel, mockAllApps)
// Then
verify(mockIconCache).getShortcutIcon(eq(expectedWai), any())
verify(mockTaskController).bindUpdatedWorkspaceItems(listOf(expectedWai))
@@ -144,7 +135,7 @@ class ShortcutsChangedTaskTest {
whenever(id).thenReturn(expectedShortcutId)
}
)
- val items: IntSparseArrayMap = modelHelper.bgDataModel.itemsIdMap
+ val items: IntSparseArrayMap = bgDataModel.itemsIdMap
items.put(expectedWai.id, expectedWai)
doReturn(
ApplicationInfo().apply {
@@ -157,7 +148,7 @@ class ShortcutsChangedTaskTest {
.getApplicationInfo(eq(expectedPackage), any(), eq(user))
doReturn(shortcuts).whenever(launcherApps).getShortcuts(any(), eq(user))
// When
- shortcutsChangedTask.execute(mockTaskController, modelHelper.bgDataModel, mockAllApps)
+ shortcutsChangedTask.execute(mockTaskController, bgDataModel, mockAllApps)
// Then
verify(mockTaskController)
.deleteAndBindComponentsRemoved(
@@ -177,7 +168,7 @@ class ShortcutsChangedTaskTest {
whenever(id).thenReturn(expectedShortcutId)
}
)
- val items: IntSparseArrayMap = modelHelper.bgDataModel.itemsIdMap
+ val items: IntSparseArrayMap = bgDataModel.itemsIdMap
items.put(expectedWai.id, expectedWai)
doReturn(
ApplicationInfo().apply {
@@ -190,7 +181,7 @@ class ShortcutsChangedTaskTest {
.getApplicationInfo(eq(expectedPackage), any(), eq(user))
doReturn(shortcuts).whenever(launcherApps).getShortcuts(any(), eq(user))
// When
- shortcutsChangedTask.execute(mockTaskController, modelHelper.bgDataModel, mockAllApps)
+ shortcutsChangedTask.execute(mockTaskController, bgDataModel, mockAllApps)
// Then
verify(mockIconCache).getShortcutIcon(eq(expectedWai), any())
verify(mockTaskController).bindUpdatedWorkspaceItems(listOf(expectedWai))
@@ -206,7 +197,7 @@ class ShortcutsChangedTaskTest {
whenever(id).thenReturn(expectedShortcutId)
}
)
- val items: IntSparseArrayMap = modelHelper.bgDataModel.itemsIdMap
+ val items: IntSparseArrayMap = bgDataModel.itemsIdMap
items.put(expectedWai.id, expectedWai)
doReturn(
ApplicationInfo().apply {
@@ -219,7 +210,7 @@ class ShortcutsChangedTaskTest {
.getApplicationInfo(eq(expectedPackage), any(), eq(user))
doReturn(shortcuts).whenever(launcherApps).getShortcuts(any(), eq(user))
// When
- shortcutsChangedTask.execute(mockTaskController, modelHelper.bgDataModel, mockAllApps)
+ shortcutsChangedTask.execute(mockTaskController, bgDataModel, mockAllApps)
// Then
verify(mockTaskController, times(0)).deleteAndBindComponentsRemoved(any(), any())
verify(mockTaskController, times(0)).bindUpdatedWorkspaceItems(any())
@@ -236,7 +227,7 @@ class ShortcutsChangedTaskTest {
whenever(id).thenReturn(expectedShortcutId)
}
)
- val items: IntSparseArrayMap = modelHelper.bgDataModel.itemsIdMap
+ val items: IntSparseArrayMap = bgDataModel.itemsIdMap
items.put(expectedWai.id, expectedWai)
doReturn(
ApplicationInfo().apply {
@@ -249,7 +240,7 @@ class ShortcutsChangedTaskTest {
.getApplicationInfo(eq(expectedPackage), any(), eq(user))
doReturn(shortcuts).whenever(launcherApps).getShortcuts(any(), eq(user))
// When
- shortcutsChangedTask.execute(mockTaskController, modelHelper.bgDataModel, mockAllApps)
+ shortcutsChangedTask.execute(mockTaskController, bgDataModel, mockAllApps)
// Then
verify(mockIconCache).getShortcutIcon(eq(expectedWai), any())
verify(mockTaskController).bindUpdatedWorkspaceItems(listOf(expectedWai))
@@ -266,7 +257,7 @@ class ShortcutsChangedTaskTest {
whenever(id).thenReturn(expectedShortcutId)
}
)
- val items: IntSparseArrayMap = modelHelper.bgDataModel.itemsIdMap
+ val items: IntSparseArrayMap = bgDataModel.itemsIdMap
items.put(expectedWai.id, expectedWai)
doReturn(
ApplicationInfo().apply {
@@ -279,7 +270,7 @@ class ShortcutsChangedTaskTest {
.getApplicationInfo(eq(expectedPackage), any(), eq(user))
doReturn(shortcuts).whenever(launcherApps).getShortcuts(any(), eq(user))
// When
- shortcutsChangedTask.execute(mockTaskController, modelHelper.bgDataModel, mockAllApps)
+ shortcutsChangedTask.execute(mockTaskController, bgDataModel, mockAllApps)
// Then
verify(mockIconCache).getShortcutIcon(eq(expectedWai), any())
verify(mockTaskController).bindUpdatedWorkspaceItems(listOf(expectedWai))
@@ -309,10 +300,10 @@ class ShortcutsChangedTaskTest {
shouldUpdateIdMap = true,
)
// When
- shortcutsChangedTask.execute(mockTaskController, modelHelper.bgDataModel, mockAllApps)
+ shortcutsChangedTask.execute(mockTaskController, bgDataModel, mockAllApps)
// Then
- assertThat(modelHelper.bgDataModel.deepShortcutMap).containsEntry(expectedKey, 1)
- verify(mockTaskController).bindDeepShortcuts(eq(modelHelper.bgDataModel))
+ assertThat(bgDataModel.deepShortcutMap).containsEntry(expectedKey, 1)
+ verify(mockTaskController).bindDeepShortcuts(eq(bgDataModel))
}
@Test
@@ -339,10 +330,10 @@ class ShortcutsChangedTaskTest {
shouldUpdateIdMap = false,
)
// When
- shortcutsChangedTask.execute(mockTaskController, modelHelper.bgDataModel, mockAllApps)
+ shortcutsChangedTask.execute(mockTaskController, bgDataModel, mockAllApps)
// Then
- assertThat(modelHelper.bgDataModel.deepShortcutMap).doesNotContainKey(expectedKey)
- verify(mockTaskController, times(0)).bindDeepShortcuts(eq(modelHelper.bgDataModel))
+ assertThat(bgDataModel.deepShortcutMap).doesNotContainKey(expectedKey)
+ verify(mockTaskController, times(0)).bindDeepShortcuts(eq(bgDataModel))
}
@Test
@@ -356,7 +347,7 @@ class ShortcutsChangedTaskTest {
whenever(id).thenReturn(expectedShortcutId)
}
)
- val items: IntSparseArrayMap = modelHelper.bgDataModel.itemsIdMap
+ val items: IntSparseArrayMap = bgDataModel.itemsIdMap
items.put(expectedWai.id, expectedWai)
doReturn(
ApplicationInfo().apply {
@@ -369,7 +360,7 @@ class ShortcutsChangedTaskTest {
.getApplicationInfo(eq(expectedPackage), any(), eq(user))
doReturn(shortcuts).whenever(launcherApps).getShortcuts(any(), eq(user))
// When
- shortcutsChangedTask.execute(mockTaskController, modelHelper.bgDataModel, mockAllApps)
+ shortcutsChangedTask.execute(mockTaskController, bgDataModel, mockAllApps)
// Then
verify(mockTaskController, times(0)).deleteAndBindComponentsRemoved(any(), any())
verify(mockTaskController, times(0)).bindUpdatedWorkspaceItems(any())
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index e0d2f394e1..6f2e8efb86 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -985,7 +985,7 @@ public final class LauncherInstrumentation {
waitUntilLauncherObjectGone(APPS_RES_ID);
waitUntilLauncherObjectGone(WORKSPACE_RES_ID);
waitUntilLauncherObjectGone(WIDGETS_RES_ID);
- if (isTablet() && !is3PLauncher() && !isRecentsWindowEnabled()) {
+ if (isTablet() && !is3PLauncher()) {
waitForSystemLauncherObject(TASKBAR_RES_ID);
} else {
waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);