Disable pinning popup when transient taskbar is disabled

On freeform displays where taskbar is always pinned, toggling "Always
show taskbar" option is no-op, as the taskbar won't transition to
transient taskbar.
Left a TODO to reevaluate behavior once desktop taskbar transient
behavior gets updated.

Bug: 390665752
Flag: com.android.window.flags.enable_desktop_taskbar_on_freeform_displays
Test: Manual.

Change-Id: Icfe7cd26e77de48ab34bfe4932bfedfe21923ef1
This commit is contained in:
Toni Barzic
2025-04-10 05:04:22 +00:00
parent 8ec6581db0
commit e5fc903495
5 changed files with 32 additions and 12 deletions
@@ -266,6 +266,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
mTaskbarView.init(TaskbarViewCallbacksFactory.newInstance(mActivity).create(
mActivity, mControllers, mTaskbarView));
// Pinning popup feature availability depends on taskbar controllers, wait for the
// controllers state initialization before evaluating the feature.
mControllers.runAfterInit(mTaskbarView::updatePinningPopupEventHandlers);
mTaskbarView.getLayoutParams().height = mActivity.isPhoneMode()
? mActivity.getResources().getDimensionPixelSize(R.dimen.taskbar_phone_size)
: mActivity.getDeviceProfile().taskbarHeight;
@@ -302,6 +305,14 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
}
}
/**
* Called whenever a new ui controller is set.
*/
public void onUiControllerChanged() {
// Pinning availability may depend on UI state when home has "locked" pinned taskbar.
mTaskbarView.updatePinningPopupEventHandlers();
}
/** Adjusts start aligned taskbar layout accordingly to the bubble bar position. */
@Override
public void onBubbleBarLocationUpdated(BubbleBarLocation location) {