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

Commit 9216bc2f authored by Piotr Wilczyński's avatar Piotr Wilczyński Committed by Android (Google) Code Review
Browse files

Merge "Brightness wear bedtime mode clamper max reason" into main

parents 0fec5809 d144ebbc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -80,6 +80,11 @@ public final class BrightnessInfo implements Parcelable {
     */
    public static final int BRIGHTNESS_MAX_REASON_POWER_IC = 2;

    /**
     * Maximum brightness is restricted due to the Wear bedtime mode.
     */
    public static final int BRIGHTNESS_MAX_REASON_WEAR_BEDTIME_MODE = 3;

    /** Brightness */
    public final float brightness;

+1 −1
Original line number Diff line number Diff line
@@ -75,6 +75,6 @@ abstract class BrightnessClamper<T> {
    protected enum Type {
        THERMAL,
        POWER,
        BEDTIME_MODE,
        WEAR_BEDTIME_MODE,
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -156,6 +156,8 @@ public class BrightnessClamperController {
            return BrightnessInfo.BRIGHTNESS_MAX_REASON_THERMAL;
        } else if (mClamperType == Type.POWER) {
            return BrightnessInfo.BRIGHTNESS_MAX_REASON_POWER_IC;
        } else if (mClamperType == Type.WEAR_BEDTIME_MODE) {
            return BrightnessInfo.BRIGHTNESS_MAX_REASON_WEAR_BEDTIME_MODE;
        } else {
            Slog.wtf(TAG, "BrightnessMaxReason not mapped for type=" + mClamperType);
            return BrightnessInfo.BRIGHTNESS_MAX_REASON_NONE;
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ public class BrightnessWearBedtimeModeClamper extends
    @NonNull
    @Override
    Type getType() {
        return Type.BEDTIME_MODE;
        return Type.WEAR_BEDTIME_MODE;
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public class BrightnessWearBedtimeModeClamperTest {

    @Test
    public void testType() {
        assertEquals(BrightnessClamper.Type.BEDTIME_MODE, mClamper.getType());
        assertEquals(BrightnessClamper.Type.WEAR_BEDTIME_MODE, mClamper.getType());
    }

    @Test