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

Commit 1ff9f8ad authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by android-build-merger
Browse files

Merge "System crash fixed when turn off MagnificationGesture"

am: 8f879493

* commit '8f879493':
  System crash fixed when turn off MagnificationGesture
parents 0170fb82 8f879493
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -372,6 +372,9 @@ public final class ScreenMagnifier implements WindowManagerInternal.Magnificatio

    @Override
    public void onDestroy() {
        if (mMagnificationController != null) {
            mMagnificationController.cancelAnimation();
        }
        mScreenStateObserver.destroy();
        mWindowManager.setMagnificationCallbacks(null);
    }
@@ -988,10 +991,14 @@ public final class ScreenMagnifier implements WindowManagerInternal.Magnificatio
            return mCurrentMagnificationSpec.scale > 1.0f;
        }

        public void reset(boolean animate) {
        public void cancelAnimation() {
            if (mTransformationAnimator.isRunning()) {
                mTransformationAnimator.cancel();
            }
        }

        public void reset(boolean animate) {
            cancelAnimation();
            mCurrentMagnificationSpec.clear();
            if (animate) {
                animateMangificationSpec(mSentMagnificationSpec,
@@ -1056,9 +1063,7 @@ public final class ScreenMagnifier implements WindowManagerInternal.Magnificatio
                            centerY) == 0) {
                return;
            }
            if (mTransformationAnimator.isRunning()) {
                mTransformationAnimator.cancel();
            }
            cancelAnimation();
            if (DEBUG_MAGNIFICATION_CONTROLLER) {
                Slog.i(LOG_TAG, "scale: " + scale + " offsetX: " + centerX
                        + " offsetY: " + centerY);