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

Commit 9ef40417 authored by Vadym Omelnytskyi's avatar Vadym Omelnytskyi Committed by Android (Google) Code Review
Browse files

Merge changes I0d904e03,I0fa61a45 into main

* changes:
  Settings: add system setting CV_PREFERRED_INTENSITY
  Settings: add system setting CV_DYNAMIC
parents feb2d5b8 f19809ee
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -6585,6 +6585,23 @@ public final class Settings {
        public static final String CV_ENABLED =
                "cv_enabled";
        /**
         * Setting to set enable/disable CV dynamic mode.
         * Setting should be boolean (0 or 1)
         *
         * @hide
         */
        public static final String CV_DYNAMIC_ENABLED =
                "cv_dynamic_enabled";
        /**
         * Setting to set CV preferred intensity
         * Setting should be integer (0-10)
         *
         * @hide
         */
        public static final String CV_PREFERRED_INTENSITY = "cv_preferred_intensity";
        /**
         * Integer property that specifes the color for screen flash notification as a
         * packed 32-bit color.
+4 −0
Original line number Diff line number Diff line
@@ -294,6 +294,10 @@ message SystemSettingsProto {
        option (android.msg_privacy).dest = DEST_EXPLICIT;

        optional SettingProto cv_enabled = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];

        optional SettingProto cv_dynamic_enabled = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];

        optional SettingProto cv_preferred_intensity = 3 [ (android.privacy).dest = DEST_AUTOMATIC] ;
    }
    optional Display display = 39;

+3 −1
Original line number Diff line number Diff line
@@ -126,7 +126,9 @@ public class SystemSettings {
                Settings.System.NOTIFICATION_COOLDOWN_ALL,
                Settings.System.NOTIFICATION_COOLDOWN_VIBRATE_UNLOCKED,
                Settings.System.PREFERRED_REGION,
                Settings.System.CV_ENABLED
                Settings.System.CV_ENABLED,
                Settings.System.CV_DYNAMIC_ENABLED,
                Settings.System.CV_PREFERRED_INTENSITY
        ));
        if (Flags.backUpSmoothDisplayAndForcePeakRefreshRate()) {
            settings.add(Settings.System.PEAK_REFRESH_RATE);
+9 −2
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@ import java.util.Map;
 * Validators for System settings
 */
public class SystemSettingsValidators {
    private static final int CV_PREFERRED_INTENSITY_MIN = 0;
    private static final int CV_PREFERRED_INTENSITY_MAX = 10;

    @UnsupportedAppUsage
    public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();

@@ -272,7 +275,11 @@ public class SystemSettingsValidators {
        VALIDATORS.put(System.NOTIFICATION_COOLDOWN_ALL, BOOLEAN_VALIDATOR);
        VALIDATORS.put(System.NOTIFICATION_COOLDOWN_VIBRATE_UNLOCKED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(System.PREFERRED_REGION, ANY_STRING_VALIDATOR);
        VALIDATORS.put(System.CV_ENABLED,
                new InclusiveIntegerRangeValidator(0, 1));
        VALIDATORS.put(System.CV_ENABLED, new InclusiveIntegerRangeValidator(0, 1));
        VALIDATORS.put(System.CV_DYNAMIC_ENABLED, new InclusiveIntegerRangeValidator(0, 1));
        VALIDATORS.put(
                System.CV_PREFERRED_INTENSITY,
                new InclusiveIntegerRangeValidator(
                        CV_PREFERRED_INTENSITY_MIN, CV_PREFERRED_INTENSITY_MAX));
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -3175,6 +3175,12 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.System.CV_ENABLED,
                SystemSettingsProto.Display.CV_ENABLED);
        dumpSetting(s, p,
                Settings.System.CV_DYNAMIC_ENABLED,
                SystemSettingsProto.Display.CV_DYNAMIC_ENABLED);
        dumpSetting(s, p,
                Settings.System.CV_PREFERRED_INTENSITY,
                SystemSettingsProto.Display.CV_PREFERRED_INTENSITY);
        p.end(systemDisplayToken);

        dumpSetting(s, p,