From 2cfc2e1b1c3cb877113d48b8d228e398785fb620 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Sat, 3 Aug 2024 22:14:18 -0700 Subject: [PATCH] [Taskbar Performance] Avoid calling notifyUpdateLayoutParams in code logic specifically for unfolded taskbar when folded Bug: 355968858 Test: https://android-build.corp.google.com/abtd/run/L59700030005634589/?referrer=email Flag: com.android.wm.shell.enable_taskbar_on_phones Change-Id: I27ee8aefa7dbb42028de4c2de617c0deac4452e8 --- .../android/launcher3/taskbar/TaskbarActivityContext.java | 7 +++++-- .../launcher3/taskbar/TaskbarLauncherStateController.java | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index e4f726257d..42703cea4a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -1134,6 +1134,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext { * window. */ public void setTaskbarWindowFocusable(boolean focusable) { + if (isPhoneMode()) { + return; + } if (focusable) { mWindowLayoutParams.flags &= ~FLAG_NOT_FOCUSABLE; } else { @@ -1146,7 +1149,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { * Applies forcibly show flag to taskbar window iff transient taskbar is unstashed. */ public void applyForciblyShownFlagWhileTransientTaskbarUnstashed(boolean shouldForceShow) { - if (!DisplayController.isTransientTaskbar(this)) { + if (!DisplayController.isTransientTaskbar(this) || isPhoneMode()) { return; } if (shouldForceShow) { @@ -1689,7 +1692,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { * @param exclude {@code true} then the magnification region computation will omit the window. */ public void excludeFromMagnificationRegion(boolean exclude) { - if (mIsExcludeFromMagnificationRegion == exclude) { + if (mIsExcludeFromMagnificationRegion == exclude || isPhoneMode()) { return; } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index 20ab32ed2f..e6b3acdced 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -470,7 +470,8 @@ public class TaskbarLauncherStateController { // We're changing state to home, should close open popups e.g. Taskbar AllApps handleOpenFloatingViews = true; } - if (mLauncherState == LauncherState.OVERVIEW) { + if (mLauncherState == LauncherState.OVERVIEW + && !mControllers.taskbarActivityContext.isPhoneMode()) { // Calling to update the insets in TaskbarInsetController#updateInsetsTouchability mControllers.taskbarActivityContext.notifyUpdateLayoutParams(); }