Remove mTargetViewContainer safely

Per bugreport there is chance that
PipDismissTargetHandler#mTargetViewContainer is not attached to window
manager when we try to remove it in PipDismissTargetHandler#init on
overlay changes (such as changing wallpaper)

Bug: 209796452
Test: N/A not able to reproduce on raven
Change-Id: Ic2fbe2d59145afa2c994bc75446d60f8c4415e58
This commit is contained in:
Hongwei Wang
2021-12-08 09:23:53 -08:00
parent 1ba4fcf076
commit 092b4a0f92

View File

@@ -122,7 +122,7 @@ public class PipDismissTargetHandler implements ViewTreeObserver.OnPreDrawListen
if (mTargetViewContainer != null) {
// init can be called multiple times, remove the old one from view hierarchy first.
mWindowManager.removeViewImmediate(mTargetViewContainer);
cleanUpDismissTarget();
}
mTargetView = new DismissCircleView(mContext);