Merge "[CD Taskbar] [CD Taskbar] Refactor TaskbarManager dump" into main
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
index b069846..b46b0dc 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
@@ -361,13 +361,13 @@
private void destroyTaskbarForDisplay(int displayId) {
TaskbarActivityContext taskbar = getTaskbarForDisplay(displayId);
- debugWhyTaskbarNotDestroyed(
- "destroyTaskbarForDisplay: " + taskbar + " displayId=" + displayId);
+ debugWhyTaskbarNotDestroyed("destroyTaskbarForDisplay: " + taskbar, displayId);
if (taskbar != null) {
taskbar.onDestroy();
// remove all defaults that we store
removeTaskbarFromMap(displayId);
}
+ // make this display-specific
DeviceProfile dp = mUserUnlocked ?
LauncherAppState.getIDP(mWindowContext).getDeviceProfile(mWindowContext) : null;
if (dp == null || !isTaskbarEnabled(dp)) {
@@ -522,6 +522,7 @@
private void recreateTaskbarForDisplay(int displayId) {
Trace.beginSection("recreateTaskbar");
try {
+ // TODO: make this code display specific
DeviceProfile dp = mUserUnlocked ?
LauncherAppState.getIDP(mWindowContext).getDeviceProfile(mWindowContext) : null;
@@ -765,12 +766,18 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarManager:");
- TaskbarActivityContext taskbar = getTaskbarForDisplay(getDefaultDisplayId());
- if (taskbar == null) {
- pw.println(prefix + "\tTaskbarActivityContext: null");
- } else {
- taskbar.dumpLogs(prefix + "\t", pw);
+ // iterate through taskbars and do the dump for each
+ for (int i = 0; i < mTaskbars.size(); i++) {
+ int displayId = mTaskbars.keyAt(i);
+ TaskbarActivityContext taskbar = mTaskbars.get(i);
+ pw.println(prefix + "\tTaskbar at display " + displayId + ":");
+ if (taskbar == null) {
+ pw.println(prefix + "\t\tTaskbarActivityContext: null");
+ } else {
+ taskbar.dumpLogs(prefix + "\t\t", pw);
+ }
}
+
}
private void addTaskbarRootViewToWindow(int displayId) {
@@ -939,11 +946,17 @@
/** Temp logs for b/254119092. */
public void debugWhyTaskbarNotDestroyed(String debugReason) {
+ debugWhyTaskbarNotDestroyed(debugReason, getDefaultDisplayId());
+ }
+
+ /** Temp logs for b/254119092. */
+ public void debugWhyTaskbarNotDestroyed(String debugReason, int displayId) {
StringJoiner log = new StringJoiner("\n");
- log.add(debugReason);
+ log.add(debugReason + " displayId=" + displayId);
boolean activityTaskbarPresent = mActivity != null
&& mActivity.getDeviceProfile().isTaskbarPresent;
+ // TODO: make this display specific
boolean contextTaskbarPresent = mUserUnlocked && LauncherAppState.getIDP(mWindowContext)
.getDeviceProfile(mWindowContext).isTaskbarPresent;
if (activityTaskbarPresent == contextTaskbarPresent) {