Merge "Perform system actions on focused display." into main

This commit is contained in:
Brian Isganitis authored and Android (Google) Code Review committed 2025-03-25 12:28:30 -07:00
commit 409ea18bf8
1 file changed
+6 -3
@@ -559,8 +559,7 @@ public class TaskbarManager implements DisplayDecorationListener {
*/
private void showTaskbarFromBroadcast(Intent intent) {
debugPrimaryTaskbar("destroyTaskbarForDisplay");
// TODO: make this code displayId specific
TaskbarActivityContext taskbar = getTaskbarForDisplay(getDefaultDisplayId());
TaskbarActivityContext taskbar = getTaskbarForDisplay(getFocusedDisplayId());
if (ACTION_SHOW_TASKBAR.equals(intent.getAction()) && taskbar != null) {
taskbar.showTaskbarFromBroadcast();
}
@@ -580,7 +579,7 @@ public class TaskbarManager implements DisplayDecorationListener {
* Toggles All Apps for Taskbar or Launcher depending on the current state.
*/
public void toggleAllAppsSearch() {
TaskbarActivityContext taskbar = getTaskbarForDisplay(getDefaultDisplayId());
TaskbarActivityContext taskbar = getTaskbarForDisplay(getFocusedDisplayId());
if (taskbar == null) {
// Home All Apps should be toggled from this class, because the controllers are not
// initialized when Taskbar is disabled (i.e. TaskbarActivityContext is null).
@@ -1682,6 +1681,10 @@ public class TaskbarManager implements DisplayDecorationListener {
return mPrimaryDisplayId;
}
private int getFocusedDisplayId() {
return SystemUiProxy.INSTANCE.get(mBaseContext).getFocusState().getFocusedDisplayId();
}
/**
* Logs debug information about the TaskbarManager for primary display.
* @param debugReason A string describing the reason for the debug log.