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

Commit fd0ccaf6 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Make brightness transition to ON immediate if the screen was OFF...

Merge "Merge "Make brightness transition to ON immediate if the screen was OFF because of close proxiity" into tm-qpr-dev am: e40c77a2" into tm-qpr-dev-plus-aosp am: d7f497cc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19505632



Change-Id: I741db4e47e2cb23f331a17274524e2b722f3bdf8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 841bcef5 d7f497cc
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1217,6 +1217,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
        }
        }
        assert (state != Display.STATE_UNKNOWN);
        assert (state != Display.STATE_UNKNOWN);


        boolean skipRampBecauseOfProximityChangeToNegative = false;
        // Apply the proximity sensor.
        // Apply the proximity sensor.
        if (mProximitySensor != null) {
        if (mProximitySensor != null) {
            if (mPowerRequest.useProximitySensor && state != Display.STATE_OFF) {
            if (mPowerRequest.useProximitySensor && state != Display.STATE_OFF) {
@@ -1254,6 +1255,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
                // the screen back on.  Also turn it back on if we've been asked to ignore the
                // the screen back on.  Also turn it back on if we've been asked to ignore the
                // prox sensor temporarily.
                // prox sensor temporarily.
                mScreenOffBecauseOfProximity = false;
                mScreenOffBecauseOfProximity = false;
                skipRampBecauseOfProximityChangeToNegative = true;
                sendOnProximityNegativeWithWakelock();
                sendOnProximityNegativeWithWakelock();
            }
            }
        } else {
        } else {
@@ -1536,8 +1538,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call


            final boolean wasOrWillBeInVr =
            final boolean wasOrWillBeInVr =
                    (state == Display.STATE_VR || oldState == Display.STATE_VR);
                    (state == Display.STATE_VR || oldState == Display.STATE_VR);
            final boolean initialRampSkip =
            final boolean initialRampSkip = (state == Display.STATE_ON && mSkipRampState
                    state == Display.STATE_ON && mSkipRampState != RAMP_STATE_SKIP_NONE;
                    != RAMP_STATE_SKIP_NONE) || skipRampBecauseOfProximityChangeToNegative;
            // While dozing, sometimes the brightness is split into buckets. Rather than animating
            // While dozing, sometimes the brightness is split into buckets. Rather than animating
            // through the buckets, which is unlikely to be smooth in the first place, just jump
            // through the buckets, which is unlikely to be smooth in the first place, just jump
            // right to the suggested brightness.
            // right to the suggested brightness.