From c0da168637e0c16e3d46b67331d64c575d195c05 Mon Sep 17 00:00:00 2001 From: Toshiki Kikuchi Date: Fri, 9 May 2025 15:02:27 +0900 Subject: [PATCH] Prevent unnecessary DisplayInfo refreshment This CL avoids refreshing DisplayInfo when the display is not freeform. As notifyConfigChange() is expensive, we want to minimize the call. Note: enterDesktopByDefaultOnFreeformDisplay only checks the flag state but showLockedTaskbarOnHome can check if the display is freeform in addition to the flag state. Flag: com.android.window.flags.enter_desktop_by_default_on_freeform_displays Test: TaplTestsLockedTaskbar Bug: 416253799 Change-Id: Ief298c05c8ce46ed70055139e5e817b41f6a572d --- .../android/launcher3/taskbar/LauncherTaskbarUIController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index 639eb4823d..d3d30c8b39 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -60,7 +60,6 @@ import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.RecentsViewContainer; import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; -import com.android.wm.shell.shared.desktopmode.DesktopModeStatus; import java.io.PrintWriter; import java.util.Arrays; @@ -224,7 +223,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController { @Override public void onLauncherVisibilityChanged(boolean isVisible) { final TaskbarActivityContext taskbarContext = mControllers.taskbarActivityContext; - if (DesktopModeStatus.enterDesktopByDefaultOnFreeformDisplay(mLauncher) + if (taskbarContext.showLockedTaskbarOnHome() && !taskbarContext.showDesktopTaskbarForFreeformDisplay() && taskbarContext.isPrimaryDisplay()) { DisplayController.INSTANCE.get(mLauncher).notifyConfigChange();