Do not notify desk mode changes on visible desk tasks count changes

1. Trigger `notifyIsInDesktopModeChanged` on
   `visibleDesktopTasksCount` changes only when the multi-desks
   flags are disabled.
2. Make `DesktopVisibilityController.isInDesktopMode` variable
   private and legacy, which should only be used when the multi-desks
   feature is disabled. All the call sites should go to check
   `DesktopVisibilityController.isInDesktopMode(displayId)`, which
    works both with and without the multi-desks feature enabled.

Bug: 402222877
Test: m
Flag: com.android.window.flags.enable_multiple_desktops_frontend
Flag: com.android.window.flags.enable_multiple_desktops_backend
Change-Id: I291e2be6d99e81b0c918ae7f39c17a8cd4ea0918
This commit is contained in:
minch
2025-03-11 05:38:52 +00:00
parent 3956f310c0
commit c48f662c7d
5 changed files with 49 additions and 35 deletions
@@ -19,6 +19,7 @@ import static android.animation.LayoutTransition.APPEARING;
import static android.animation.LayoutTransition.CHANGE_APPEARING;
import static android.animation.LayoutTransition.CHANGE_DISAPPEARING;
import static android.animation.LayoutTransition.DISAPPEARING;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.window.DesktopModeFlags.ENABLE_TASKBAR_RECENTS_LAYOUT_TRANSITION;
import static com.android.app.animation.Interpolators.EMPHASIZED;
@@ -747,7 +748,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
}
private boolean shouldUpdateIconContentDescription(BubbleTextView btv) {
boolean isInDesktopMode = mControllers.taskbarDesktopModeController.isInDesktopMode();
boolean isInDesktopMode = mControllers.taskbarDesktopModeController.isInDesktopMode(
DEFAULT_DISPLAY);
boolean isAllAppsButton = btv instanceof TaskbarAllAppsButtonContainer;
boolean isDividerButton = btv instanceof TaskbarDividerContainer;
return isInDesktopMode && !isAllAppsButton && !isDividerButton;