BubbleController: Remove stack view even when broadcast receiver missing

Bug: 253647225
Test: atest BubblesTest, also see bug for abtd run.
Change-Id: Ia60fb73fc3cff887af466b21f140f1ad01261dd1
This commit is contained in:
David Saff
2022-10-24 20:07:11 +00:00
parent 0310eb679e
commit 9e0f324e7c

View File

@@ -671,10 +671,18 @@ public class BubbleController implements ConfigurationChangeListener {
return;
}
mAddedToWindowManager = false;
// Put on background for this binder call, was causing jank
mBackgroundExecutor.execute(() -> {
try {
mContext.unregisterReceiver(mBroadcastReceiver);
} catch (IllegalArgumentException e) {
// Not sure if this happens in production, but was happening in tests
// (b/253647225)
e.printStackTrace();
}
});
try {
mAddedToWindowManager = false;
// Put on background for this binder call, was causing jank
mBackgroundExecutor.execute(() -> mContext.unregisterReceiver(mBroadcastReceiver));
if (mStackView != null) {
mWindowManager.removeView(mStackView);
mBubbleData.getOverflow().cleanUpExpandedState();