Remove taskbar window from WindowManager in TaskbarManager.destroy()

When task bar crashes (from anything), task bar window is not cleaned up properly. This is because destroyExistingTaskbar() only removes the root layout from the window when we are no longer rendering task bar (one use case of that is folding the device). We need to clean it up in onDestroy() also.

Fixes: 319105323
Test: adb shell am crash com.android.systemui and make sure there is only one task bar window
Change-Id: Ia9c808e903422707bf4c270b2631fc913dde65d9
This commit is contained in:
Tracy Zhou
2024-01-11 16:13:06 -08:00
parent e19c572ac2
commit 78c548a829
@@ -572,6 +572,7 @@ public class TaskbarManager {
UI_HELPER_EXECUTOR.execute(
() -> mTaskbarBroadcastReceiver.unregisterReceiverSafely(mContext));
destroyExistingTaskbar();
removeTaskbarRootViewFromWindow();
if (mUserUnlocked) {
DisplayController.INSTANCE.get(mContext).removeChangeListener(mRecreationListener);
}