|
57 | 57 | import android.app.IActivityManager; |
58 | 58 | import android.app.StatusBarManager; |
59 | 59 | import android.app.admin.DevicePolicyManager; |
| 60 | +import android.animation.ValueAnimator; |
60 | 61 | import android.content.BroadcastReceiver; |
61 | 62 | import android.content.Context; |
62 | 63 | import android.content.Intent; |
@@ -900,8 +901,8 @@ private WindowManagerService(Context context, PowerManagerService pm, |
900 | 901 | Settings.System.WINDOW_ANIMATION_SCALE, mWindowAnimationScale); |
901 | 902 | mTransitionAnimationScale = Settings.System.getFloat(context.getContentResolver(), |
902 | 903 | Settings.System.TRANSITION_ANIMATION_SCALE, mTransitionAnimationScale); |
903 | | - mAnimatorDurationScale = Settings.System.getFloat(context.getContentResolver(), |
904 | | - Settings.System.ANIMATOR_DURATION_SCALE, mTransitionAnimationScale); |
| 904 | + setAnimatorDurationScale(Settings.System.getFloat(context.getContentResolver(), |
| 905 | + Settings.System.ANIMATOR_DURATION_SCALE, mTransitionAnimationScale)); |
905 | 906 |
|
906 | 907 | // Track changes to DevicePolicyManager state so we can enable/disable keyguard. |
907 | 908 | IntentFilter filter = new IntentFilter(); |
@@ -5160,14 +5161,19 @@ public void setAnimationScales(float[] scales) { |
5160 | 5161 | mTransitionAnimationScale = fixScale(scales[1]); |
5161 | 5162 | } |
5162 | 5163 | if (scales.length >= 3) { |
5163 | | - mAnimatorDurationScale = fixScale(scales[2]); |
| 5164 | + setAnimatorDurationScale(fixScale(scales[2])); |
5164 | 5165 | } |
5165 | 5166 | } |
5166 | 5167 |
|
5167 | 5168 | // Persist setting |
5168 | 5169 | mH.obtainMessage(H.PERSIST_ANIMATION_SCALE).sendToTarget(); |
5169 | 5170 | } |
5170 | 5171 |
|
| 5172 | + private void setAnimatorDurationScale(float scale) { |
| 5173 | + mAnimatorDurationScale = scale; |
| 5174 | + ValueAnimator.setDurationScale(scale); |
| 5175 | + } |
| 5176 | + |
5171 | 5177 | public float getAnimationScale(int which) { |
5172 | 5178 | switch (which) { |
5173 | 5179 | case 0: return mWindowAnimationScale; |
|
0 commit comments