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

Commit 80176b87 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Only check electron beam for on/off transitions [issue 3263]" into gingerbread

parents d2763bb9 1c1cbbc1
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -2118,11 +2118,12 @@ class PowerManagerService extends IPowerManager.Stub
        }

        public void run() {
            if (mAnimateScreenLights ||
                    (!mAnimateScreenLights && Settings.System.getInt(mContext.getContentResolver(),
                            ELECTRON_BEAM_ANIMATION_OFF,
                            mContext.getResources().getBoolean(
                                    com.android.internal.R.bool.config_enableScreenOffAnimation) ? 1 : 0) == 0)) {
            // Check for the electron beam for fully on/off transitions.
            // Otherwise, allow it to fade the brightness as normal.
            final boolean electrifying = animating &&
                ((mElectronBeamAnimationOff && targetValue == Power.BRIGHTNESS_OFF) ||
                 (mElectronBeamAnimationOn && (int)curValue == Power.BRIGHTNESS_OFF));
            if (mAnimateScreenLights || !electrifying) {
                synchronized (mLocks) {
                    long now = SystemClock.uptimeMillis();
                    boolean more = mScreenBrightness.stepLocked();
@@ -2132,9 +2133,7 @@ class PowerManagerService extends IPowerManager.Stub
                }
            } else {
                synchronized (mLocks) {
                    // we're turning off
                    final boolean animate = animating && targetValue == Power.BRIGHTNESS_OFF;
                    if (animate) {
                    if (electrifying) {
                        // It's pretty scary to hold mLocks for this long, and we should
                        // redesign this, but it works for now.
                        nativeStartSurfaceFlingerAnimation(