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

Commit 4f580e68 authored by Chen Bai's avatar Chen Bai
Browse files

brightness: set up flag for bedtime autobrightness curve feature

Flag: com.android.server.display.feature.flags.auto_brightness_mode_bedtime_wear
Test: m -j
Bug: 350617205
Change-Id: Idfa0e8a6e5ea78d541909387e1e5a655970c0f60
parent 2ce641c5
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -237,6 +237,11 @@ public class DisplayManagerFlags {
            Flags::enableHasArrSupport
    );

    private final FlagState mAutoBrightnessModeBedtimeWearFlagState = new FlagState(
            Flags.FLAG_AUTO_BRIGHTNESS_MODE_BEDTIME_WEAR,
            Flags::autoBrightnessModeBedtimeWear
    );

    /**
     * @return {@code true} if 'port' is allowed in display layout configuration file.
     */
@@ -503,6 +508,15 @@ public class DisplayManagerFlags {
    public boolean hasArrSupportFlag() {
        return mHasArrSupport.isEnabled();
    }

    /**
     * @return {@code true} if bedtime mode specific auto-brightness curve should be loaded and be
     * applied when bedtime mode is enabled.
     */
    public boolean isAutoBrightnessModeBedtimeWearEnabled() {
        return mAutoBrightnessModeBedtimeWearFlagState.isEnabled();
    }

    /**
     * dumps all flagstates
     * @param pw printWriter
@@ -553,6 +567,7 @@ public class DisplayManagerFlags {
        pw.println(" " + mBlockAutobrightnessChangesOnStylusUsage);
        pw.println(" " + mIsUserRefreshRateForExternalDisplayEnabled);
        pw.println(" " + mHasArrSupport);
        pw.println(" " + mAutoBrightnessModeBedtimeWearFlagState);
    }

    private static class FlagState {
+8 −0
Original line number Diff line number Diff line
@@ -422,3 +422,11 @@ flag {
    bug: "361433651"
    is_fixed_read_only: true
}

flag {
    name: "auto_brightness_mode_bedtime_wear"
    namespace: "wear_frameworks"
    description: "Feature flag for loading and applying auto-brightness curve while wear bedtime mode enabled."
    bug: "350617205"
    is_fixed_read_only: true
}