Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5e08787 authored by Winson Chung's avatar Winson Chung
Browse files

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
parent 5a1d0103
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -140,6 +140,7 @@ public class PipDismissTargetHandler implements ViewTreeObserver.OnPreDrawListen
        });
        });


        mMagnetizedPip = mMotionHelper.getMagnetizedPip();
        mMagnetizedPip = mMotionHelper.getMagnetizedPip();
        mMagnetizedPip.clearAllTargets();
        mMagneticTarget = mMagnetizedPip.addTarget(mTargetView, 0);
        mMagneticTarget = mMagnetizedPip.addTarget(mTargetView, 0);
        updateMagneticTargetSize();
        updateMagneticTargetSize();