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

Commit 0d8faee4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Destroy EGL context on colorfade.stop"" into main

parents 8536e37e f10b36aa
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -408,12 +408,6 @@ final class ColorFade {
        }
    }

    void stop() {
        if (mEglContext != null && mEglDisplay != null) {
            EGL14.eglDestroyContext(mEglDisplay, mEglContext);
        }
    }

    /**
     * Draws an animation frame showing the color fade activated at the
     * specified level.
+1 −2
Original line number Diff line number Diff line
@@ -3577,8 +3577,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call

        DisplayPowerState getDisplayPowerState(DisplayBlanker blanker, ColorFade colorFade,
                int displayId, int displayState) {
            return new DisplayPowerState(blanker, colorFade, displayId, displayState,
                    new Handler(/*async=*/ true));
            return new DisplayPowerState(blanker, colorFade, displayId, displayState);
        }

        DualRampAnimator<DisplayPowerState> getDualRampAnimator(DisplayPowerState dps,
+3 −2
Original line number Diff line number Diff line
@@ -324,6 +324,8 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
    // Must only be accessed on the handler thread.
    private DisplayPowerState mPowerState;



    // The currently active screen on unblocker.  This field is non-null whenever
    // we are waiting for a callback to release it and unblock the screen.
    private ScreenOnUnblocker mPendingScreenOnUnblocker;
@@ -2914,8 +2916,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal

        DisplayPowerState getDisplayPowerState(DisplayBlanker blanker, ColorFade colorFade,
                int displayId, int displayState) {
            return new DisplayPowerState(blanker, colorFade, displayId, displayState,
                    new Handler(/*async=*/ true));
            return new DisplayPowerState(blanker, colorFade, displayId, displayState);
        }

        DualRampAnimator<DisplayPowerState> getDualRampAnimator(DisplayPowerState dps,
+2 −9
Original line number Diff line number Diff line
@@ -74,9 +74,8 @@ final class DisplayPowerState {
    private volatile boolean mStopped;

    DisplayPowerState(
            DisplayBlanker blanker, ColorFade colorFade, int displayId, int displayState,
            Handler handler) {
        mHandler = handler;
            DisplayBlanker blanker, ColorFade colorFade, int displayId, int displayState) {
        mHandler = new Handler(true /*async*/);
        mChoreographer = Choreographer.getInstance();
        mBlanker = blanker;
        mColorFade = colorFade;
@@ -318,7 +317,6 @@ final class DisplayPowerState {
        mStopped = true;
        mPhotonicModulator.interrupt();
        dismissColorFade();
        stopColorFade();
        mCleanListener = null;
        mHandler.removeCallbacksAndMessages(null);
    }
@@ -378,11 +376,6 @@ final class DisplayPowerState {
        }
    }

    // Clears up color fade resources.
    private void stopColorFade() {
        if (mColorFade != null) mColorFade.stop();
    }

    private final Runnable mScreenUpdateRunnable = new Runnable() {
        @Override
        public void run() {
+0 −15
Original line number Diff line number Diff line
@@ -1254,21 +1254,6 @@ public final class DisplayPowerController2Test {
                eq(BRIGHTNESS_RAMP_RATE_SLOW_INCREASE_IDLE), eq(false));
    }

    @Test
    public void testPowerStateStopsOnDpcStop() {
        // Set up
        DisplayPowerRequest dpr = new DisplayPowerRequest();
        mHolder.dpc.requestPowerState(dpr, /* waitForNegativeProximity= */ false);
        advanceTime(1);

        // Stop dpc
        mHolder.dpc.stop();
        advanceTime(1);

        // Ensure dps has stopped
        verify(mHolder.displayPowerState, times(1)).stop();
    }

    @Test
    public void testRampRateForHdrContent_HdrClamperOff() {
        float hdrBrightness = 0.8f;
Loading