From 06745aadca63cfb39a93640baa6e20728bf9f14c Mon Sep 17 00:00:00 2001 From: Joshua Tsuji Date: Thu, 9 Apr 2020 11:17:42 -0400 Subject: [PATCH] Fix intermittent PIP crash. Looks like this is caused by calling removeView right before addView, which happens when we recreate the dismiss target. Sometimes, removeView has not completed by the time we addView again. I wasn't able to reproduce the crash, but other places in sysui use removeViewImmediate for this purpose. Bug: 153551432 Test: try rotating the screen a bunch with a PIP visible Change-Id: Ic96173c1273b8476280a7daf63340bbe9613b21e --- .../src/com/android/systemui/pip/phone/PipTouchHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java index bbb4939665337..8007f7461e746 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java @@ -510,7 +510,7 @@ public class PipTouchHandler { mHandler.removeCallbacks(mShowTargetAction); if (mTargetViewContainer.isAttachedToWindow()) { - mWindowManager.removeView(mTargetViewContainer); + mWindowManager.removeViewImmediate(mTargetViewContainer); } }