Merge "Add some logging for taskbar recreation" into sc-v2-dev

This commit is contained in:
Winson Chung 2021-11-03 23:41:07 +00:00 committed by Android (Google) Code Review
commit 3b5dddbce1
4 changed files with 27 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_M
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.launcher3.testing.TestProtocol.TASKBAR_WINDOW_CRASH;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_BOTTOM_TAPPABLE_ELEMENT; import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_BOTTOM_TAPPABLE_ELEMENT;
@ -60,6 +61,7 @@ import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.logger.LauncherAtom; import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.model.data.FolderInfo; import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.touch.ItemClickHandler; import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.SettingsCache; import com.android.launcher3.util.SettingsCache;
@ -200,6 +202,9 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
updateSysuiStateFlags(sharedState.sysuiStateFlags, true /* fromInit */); updateSysuiStateFlags(sharedState.sysuiStateFlags, true /* fromInit */);
mWindowManager.addView(mDragLayer, mWindowLayoutParams); mWindowManager.addView(mDragLayer, mWindowLayoutParams);
if (TestProtocol.sDebugTracing) {
Log.e(TASKBAR_WINDOW_CRASH, "Adding taskbar window");
}
} }
public boolean isThreeButtonNav() { public boolean isThreeButtonNav() {
@ -330,6 +335,9 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
setUIController(TaskbarUIController.DEFAULT); setUIController(TaskbarUIController.DEFAULT);
mControllers.onDestroy(); mControllers.onDestroy();
mWindowManager.removeViewImmediate(mDragLayer); mWindowManager.removeViewImmediate(mDragLayer);
if (TestProtocol.sDebugTracing) {
Log.e(TASKBAR_WINDOW_CRASH, "Removing taskbar window");
}
} }
public void updateSysuiStateFlags(int systemUiStateFlags, boolean fromInit) { public void updateSysuiStateFlags(int systemUiStateFlags, boolean fromInit) {

View File

@ -17,6 +17,8 @@ package com.android.launcher3.taskbar;
import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
import static com.android.launcher3.testing.TestProtocol.TASKBAR_WINDOW_CRASH;
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN; import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY; import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
import static com.android.launcher3.util.DisplayController.CHANGE_SUPPORTED_BOUNDS; import static com.android.launcher3.util.DisplayController.CHANGE_SUPPORTED_BOUNDS;
@ -29,6 +31,7 @@ import android.content.res.Configuration;
import android.hardware.display.DisplayManager; import android.hardware.display.DisplayManager;
import android.net.Uri; import android.net.Uri;
import android.provider.Settings; import android.provider.Settings;
import android.util.Log;
import android.view.Display; import android.view.Display;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@ -39,6 +42,7 @@ import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherAppState;
import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info; import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.SettingsCache; import com.android.launcher3.util.SettingsCache;
@ -203,6 +207,10 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
} }
private void recreateTaskbar() { private void recreateTaskbar() {
if (TestProtocol.sDebugTracing) {
Log.e(TASKBAR_WINDOW_CRASH, "Recreating taskbar: mTaskbarActivityContext="
+ mTaskbarActivityContext);
}
destroyExistingTaskbar(); destroyExistingTaskbar();
DeviceProfile dp = DeviceProfile dp =
@ -225,6 +233,9 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
mTaskbarActivityContext.setUIController( mTaskbarActivityContext.setUIController(
createTaskbarUIControllerForActivity(mActivity)); createTaskbarUIControllerForActivity(mActivity));
} }
if (TestProtocol.sDebugTracing) {
Log.e(TASKBAR_WINDOW_CRASH, "Finished recreating taskbar");
}
} }
public void onSystemUiFlagsChanged(int systemUiStateFlags) { public void onSystemUiFlagsChanged(int systemUiStateFlags) {

View File

@ -22,6 +22,7 @@ import static android.view.MotionEvent.ACTION_UP;
import static com.android.launcher3.config.FeatureFlags.ASSISTANT_GIVES_LAUNCHER_FOCUS; import static com.android.launcher3.config.FeatureFlags.ASSISTANT_GIVES_LAUNCHER_FOCUS;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.testing.TestProtocol.TASKBAR_WINDOW_CRASH;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.quickstep.GestureState.DEFAULT_STATE; import static com.android.quickstep.GestureState.DEFAULT_STATE;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
@ -350,6 +351,9 @@ public class TouchInteractionService extends Service
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
if (TestProtocol.sDebugTracing) {
Log.e(TASKBAR_WINDOW_CRASH, "TIS created");
}
// Initialize anything here that is needed in direct boot mode. // Initialize anything here that is needed in direct boot mode.
// Everything else should be initialized in onUserUnlocked() below. // Everything else should be initialized in onUserUnlocked() below.
mMainChoreographer = Choreographer.getInstance(); mMainChoreographer = Choreographer.getInstance();
@ -511,6 +515,9 @@ public class TouchInteractionService extends Service
@Override @Override
public void onDestroy() { public void onDestroy() {
Log.d(TAG, "Touch service destroyed: user=" + getUserId()); Log.d(TAG, "Touch service destroyed: user=" + getUserId());
if (TestProtocol.sDebugTracing) {
Log.e(TASKBAR_WINDOW_CRASH, "TIS destroyed");
}
sIsInitialized = false; sIsInitialized = false;
if (mDeviceState.isUserUnlocked()) { if (mDeviceState.isUserUnlocked()) {
mInputConsumer.unregisterInputConsumer(); mInputConsumer.unregisterInputConsumer();

View File

@ -121,6 +121,7 @@ public final class TestProtocol {
public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation"; public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation";
public static final String PERMANENT_DIAG_TAG = "TaplTarget"; public static final String PERMANENT_DIAG_TAG = "TaplTarget";
public static final String TASKBAR_WINDOW_CRASH = "b/201305599";
public static final String TASK_VIEW_ID_CRASH = "b/195430732"; public static final String TASK_VIEW_ID_CRASH = "b/195430732";
public static final String NO_DROP_TARGET = "b/195031154"; public static final String NO_DROP_TARGET = "b/195031154";
public static final String NULL_INT_SET = "b/200572078"; public static final String NULL_INT_SET = "b/200572078";