diff options
author | Cyril Mottier <cyrilmottier@gmail.com> | 2013-07-15 10:29:48 +0200 |
---|---|---|
committer | Cyril Mottier <cyrilmottier@gmail.com> | 2013-07-15 15:38:10 +0200 |
commit | 5f5882ffa83d1c5762569e3260fa4ec85e0d0d4c (patch) | |
tree | 3b20e8b356a6a50ba008f2f6a3f365e4bcab0ecc | |
parent | 4b8cc94cc67d760e724c56aee9301d1bcc2bbe89 (diff) | |
download | base-5f5882ffa83d1c5762569e3260fa4ec85e0d0d4c.tar.gz |
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
-rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index d6dfff40844d..26a4e3944ec1 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -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 |