Merge "Use SysUi focus display ID as the source of truth" into main

This commit is contained in:
Steven Ng authored and Android (Google) Code Review committed 2025-04-15 10:11:20 -07:00
commit c5e8d1a929
3 files changed
+7 -40

No files matched your search

@@ -121,12 +121,6 @@ public class TaskbarManager implements DisplayDecorationListener {
// TODO: b/397738606 - Remove all logs with this tag after the growth framework is integrated.
public static final String GROWTH_FRAMEWORK_TAG = "Growth Framework";
/**
* An integer extra specifying the ID of the display on which the All Apps UI should be shown
* or hidden.
*/
public static final String EXTRA_KEY_ALL_APPS_ACTION_DISPLAY_ID =
"com.android.quickstep.allapps.display_id";
/**
* All the configurations which do not initiate taskbar recreation.
@@ -590,15 +584,7 @@ public class TaskbarManager implements DisplayDecorationListener {
* visibility on the System UI tracked focused display.
*/
public void toggleAllAppsSearch() {
toggleAllAppsSearchForDisplay(getFocusedDisplayId());
}
/**
* Shows or hides the All Apps view in the Taskbar or Launcher, based on its current
* visibility on the given display, with ID {@code displayId}.
*/
public void toggleAllAppsSearchForDisplay(int displayId) {
TaskbarActivityContext taskbar = getTaskbarForDisplay(displayId);
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).
@@ -1740,17 +1726,7 @@ public class TaskbarManager implements DisplayDecorationListener {
public void send(int code, Intent intent, String resolvedType,
IBinder allowlistToken, IIntentReceiver finishedReceiver,
String requiredPermission, Bundle options) {
MAIN_EXECUTOR.execute(() -> {
int displayId = -1;
if (options != null) {
displayId = options.getInt(EXTRA_KEY_ALL_APPS_ACTION_DISPLAY_ID, -1);
}
if (displayId == -1) {
toggleAllAppsSearch();
} else {
toggleAllAppsSearchForDisplay(displayId);
}
});
MAIN_EXECUTOR.execute(TaskbarManager.this::toggleAllAppsSearch);
}
});
}
@@ -21,11 +21,9 @@ import android.content.Context
import android.hardware.input.InputManager
import android.hardware.input.InputManager.KeyGestureEventHandler
import android.hardware.input.KeyGestureEvent
import android.os.Bundle
import android.os.IBinder
import android.util.Log
import androidx.annotation.VisibleForTesting
import com.android.launcher3.taskbar.TaskbarManager
import com.android.window.flags.Flags
/**
@@ -47,11 +45,9 @@ class QuickstepKeyGestureEventsManager(context: Context) {
return
}
allAppsPendingIntent?.send(
Bundle().apply {
putInt(TaskbarManager.EXTRA_KEY_ALL_APPS_ACTION_DISPLAY_ID, event.displayId)
}
)
// Ignore the display ID from the KeyGestureEvent as we will use the focus display
// from the SysUi proxy as the source of truth.
allAppsPendingIntent?.send()
}
}