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

Commit 5f5882ff authored by Cyril Mottier's avatar Cyril Mottier
Browse files

Remove useless/repetitive code

fixScale(float) method has been extracted from the code but the original
code has been kept in place. Because of this, the animation scale is 
"fixed" twice which is not necessary. This patch, simply call 
fixScale(float) once and stores the result of it in the scale variable.

Change-Id: I50aeacbc2c13ebbf447506ae4309d50c0e313837
parent 4b8cc94c
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -5366,13 +5366,11 @@ public class WindowManagerService extends IWindowManager.Stub
            throw new SecurityException("Requires SET_ANIMATION_SCALE permission");
        }

        if (scale < 0) scale = 0;
        else if (scale > 20) scale = 20;
        scale = Math.abs(scale);
        scale = fixScale(scale);
        switch (which) {
            case 0: mWindowAnimationScale = fixScale(scale); break;
            case 1: mTransitionAnimationScale = fixScale(scale); break;
            case 2: mAnimatorDurationScale = fixScale(scale); break;
            case 0: mWindowAnimationScale = scale; break;
            case 1: mTransitionAnimationScale = scale; break;
            case 2: mAnimatorDurationScale = scale; break;
        }

        // Persist setting