[CD Taskbar] Move DisplayController method calls to BaseTaskbarContext

To ensure consistent, controllable Taskbar in Connected Displays Behavior, move all independent calls to the singleton DisplayController's various methods into one place in BaseTaskbarContext, where we have access to the parent context and can override default behaviors of these methods throughout taskbar if in external display.

Flag: EXEMPT not adding new behavior
Bug: 401553128
Test: m
Change-Id: If9efc0cfc18bac3ee75bb64bf5280ea979d1faa2
This commit is contained in:
Sukesh Ram
2025-03-14 04:20:30 -07:00
parent 3a4595c207
commit 16e04e84eb
12 changed files with 138 additions and 55 deletions
@@ -65,7 +65,6 @@ import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.util.SystemUiFlagUtils;
@@ -306,8 +305,8 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
// TODO(b/390665752): Feature to "lock" pinned taskbar to home screen will be superseded by
// pinning, in other launcher states, at which point this variable can be removed.
mInAppStateAffectsDesktopTasksVisibilityInTaskbar =
!DisplayController.showDesktopTaskbarForFreeformDisplay(mActivity)
&& DisplayController.showLockedTaskbarOnHome(mActivity);
!mActivity.showDesktopTaskbarForFreeformDisplay()
&& mActivity.showLockedTaskbarOnHome();
mTaskbarBackgroundDuration = activity.getResources().getInteger(
R.integer.taskbar_background_duration);
@@ -412,7 +411,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
* Returns how long the stash/unstash animation should play.
*/
public long getStashDuration() {
if (DisplayController.isPinnedTaskbar(mActivity)) {
if (mActivity.isPinnedTaskbar()) {
return PINNED_TASKBAR_TRANSITION_DURATION;
}
return mActivity.isTransientTaskbar() ? TRANSIENT_TASKBAR_STASH_DURATION
@@ -1182,7 +1181,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
}
// Do not stash if pinned taskbar, hardware keyboard is attached and no IME is docked
if (mActivity.isHardwareKeyboard() && DisplayController.isPinnedTaskbar(mActivity)
if (mActivity.isHardwareKeyboard() && mActivity.isPinnedTaskbar()
&& !mActivity.isImeDocked()) {
return false;
}