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

Commit 8ec8236f authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Apply ValueAnimator scale factor immediately in WM." into jb-mr1-dev

parents 60a5fa4f ff7e6ef4
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -231,6 +231,13 @@ public class ValueAnimator extends Animator {
        sDurationScale = durationScale;
        sDurationScale = durationScale;
    }
    }


    /**
     * @hide
     */
    public static float getDurationScale() {
        return sDurationScale;
    }

    /**
    /**
     * Creates a new ValueAnimator object. This default constructor is primarily for
     * Creates a new ValueAnimator object. This default constructor is primarily for
     * use internally; the factory methods which take parameters are more generally
     * use internally; the factory methods which take parameters are more generally
+9 −3
Original line number Original line Diff line number Diff line
@@ -57,6 +57,7 @@ import android.app.ActivityOptions;
import android.app.IActivityManager;
import android.app.IActivityManager;
import android.app.StatusBarManager;
import android.app.StatusBarManager;
import android.app.admin.DevicePolicyManager;
import android.app.admin.DevicePolicyManager;
import android.animation.ValueAnimator;
import android.content.BroadcastReceiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Context;
import android.content.Intent;
import android.content.Intent;
@@ -900,8 +901,8 @@ public class WindowManagerService extends IWindowManager.Stub
                Settings.System.WINDOW_ANIMATION_SCALE, mWindowAnimationScale);
                Settings.System.WINDOW_ANIMATION_SCALE, mWindowAnimationScale);
        mTransitionAnimationScale = Settings.System.getFloat(context.getContentResolver(),
        mTransitionAnimationScale = Settings.System.getFloat(context.getContentResolver(),
                Settings.System.TRANSITION_ANIMATION_SCALE, mTransitionAnimationScale);
                Settings.System.TRANSITION_ANIMATION_SCALE, mTransitionAnimationScale);
        mAnimatorDurationScale = Settings.System.getFloat(context.getContentResolver(),
        setAnimatorDurationScale(Settings.System.getFloat(context.getContentResolver(),
                Settings.System.ANIMATOR_DURATION_SCALE, mTransitionAnimationScale);
                Settings.System.ANIMATOR_DURATION_SCALE, mTransitionAnimationScale));


        // Track changes to DevicePolicyManager state so we can enable/disable keyguard.
        // Track changes to DevicePolicyManager state so we can enable/disable keyguard.
        IntentFilter filter = new IntentFilter();
        IntentFilter filter = new IntentFilter();
@@ -5160,7 +5161,7 @@ public class WindowManagerService extends IWindowManager.Stub
                mTransitionAnimationScale = fixScale(scales[1]);
                mTransitionAnimationScale = fixScale(scales[1]);
            }
            }
            if (scales.length >= 3) {
            if (scales.length >= 3) {
                mAnimatorDurationScale = fixScale(scales[2]);
                setAnimatorDurationScale(fixScale(scales[2]));
            }
            }
        }
        }


@@ -5168,6 +5169,11 @@ public class WindowManagerService extends IWindowManager.Stub
        mH.obtainMessage(H.PERSIST_ANIMATION_SCALE).sendToTarget();
        mH.obtainMessage(H.PERSIST_ANIMATION_SCALE).sendToTarget();
    }
    }


    private void setAnimatorDurationScale(float scale) {
        mAnimatorDurationScale = scale;
        ValueAnimator.setDurationScale(scale);
    }

    public float getAnimationScale(int which) {
    public float getAnimationScale(int which) {
        switch (which) {
        switch (which) {
            case 0: return mWindowAnimationScale;
            case 0: return mWindowAnimationScale;