Ensure only single pip dismiss magnetized target exists

- If init() is called multiple times, the previous magnetized targets
  can cause the wrong target position to be calculated when trying (or
  not trying) to dismiss

Bug: 213348722
Test: Manual
Change-Id: Ic1f972cc60eafca2302ad168065c974c8a0ee924
This commit is contained in:
Winson Chung
2022-01-11 00:22:42 +00:00
parent 5a1d0103e4
commit b5e0878776

View File

@@ -140,6 +140,7 @@ public class PipDismissTargetHandler implements ViewTreeObserver.OnPreDrawListen
});
mMagnetizedPip = mMotionHelper.getMagnetizedPip();
mMagnetizedPip.clearAllTargets();
mMagneticTarget = mMagnetizedPip.addTarget(mTargetView, 0);
updateMagneticTargetSize();