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

Commit b6697b2a authored by Sally Yuen's avatar Sally Yuen Committed by Android (Google) Code Review
Browse files

Merge changes I72d65c73,Icc998925

* changes:
  Add Reduce Bright Color Settings to proto files
  Add Reduce Bright Colors to Settings
parents ccfe7f82 25cc44de
Loading
Loading
Loading
Loading
+42 −0
Original line number Original line Diff line number Diff line
@@ -326,6 +326,21 @@ public final class Settings {
    public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS =
    public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS =
            "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
            "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
    /**
     * Activity Action: Show settings to allow configuration of Reduce Bright Colors.
     * <p>
     * In some cases, a matching Activity may not exist, so ensure you
     * safeguard against this.
     * <p>
     * Input: Nothing.
     * <p>
     * Output: Nothing.
     * @hide
     */
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_REDUCE_BRIGHT_COLORS_SETTINGS =
            "android.settings.REDUCE_BRIGHT_COLORS_SETTINGS";
    /**
    /**
     * Activity Action: Show settings to control access to usage information.
     * Activity Action: Show settings to control access to usage information.
     * <p>
     * <p>
@@ -7124,6 +7139,33 @@ public final class Settings {
        public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS =
        public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS =
                "accessibility_interactive_ui_timeout_ms";
                "accessibility_interactive_ui_timeout_ms";
        /**
         * Setting that specifies whether Reduce Bright Colors, or brightness dimming by color
         * adjustment, is enabled.
         *
         * @hide
         */
        public static final String REDUCE_BRIGHT_COLORS_ACTIVATED =
                "reduce_bright_colors_activated";
        /**
         * Setting that specifies the level of Reduce Bright Colors in intensity. The range is
         * [0, 100].
         *
         * @hide
         */
        public static final String REDUCE_BRIGHT_COLORS_LEVEL =
                "reduce_bright_colors_level";
        /**
         * Setting that specifies whether Reduce Bright Colors should persist across reboots.
         *
         * @hide
         */
        public static final String REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS =
                "reduce_bright_colors_persist_across_reboots";
        /**
        /**
         * List of the enabled print services.
         * List of the enabled print services.
         *
         *
+10 −1
Original line number Original line Diff line number Diff line
@@ -452,6 +452,15 @@ message SecureSettingsProto {
    }
    }
    optional QuickSettings qs = 45;
    optional QuickSettings qs = 45;


    message ReduceBrightColors {
        option (android.msg_privacy).dest = DEST_EXPLICIT;

        optional SettingProto activated = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto level = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto persist_across_reboots = 3 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional ReduceBrightColors reduce_bright_colors = 87;

    message Rotation {
    message Rotation {
        option (android.msg_privacy).dest = DEST_EXPLICIT;
        option (android.msg_privacy).dest = DEST_EXPLICIT;


@@ -625,5 +634,5 @@ message SecureSettingsProto {


    // Please insert fields in alphabetical order and group them into messages
    // Please insert fields in alphabetical order and group them into messages
    // if possible (to avoid reaching the method limit).
    // if possible (to avoid reaching the method limit).
    // Next tag = 87;
    // Next tag = 88;
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -60,6 +60,8 @@ public class SecureSettings {
        Settings.Secure.ACCESSIBILITY_CAPTIONING_TYPEFACE,
        Settings.Secure.ACCESSIBILITY_CAPTIONING_TYPEFACE,
        Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE,
        Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE,
        Settings.Secure.ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
        Settings.Secure.ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
        Settings.Secure.REDUCE_BRIGHT_COLORS_LEVEL,
        Settings.Secure.REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS,
        Settings.Secure.TTS_DEFAULT_RATE,
        Settings.Secure.TTS_DEFAULT_RATE,
        Settings.Secure.TTS_DEFAULT_PITCH,
        Settings.Secure.TTS_DEFAULT_PITCH,
        Settings.Secure.TTS_DEFAULT_SYNTH,
        Settings.Secure.TTS_DEFAULT_SYNTH,
+3 −0
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@ import static android.provider.settings.validators.SettingsValidators.NONE_NEGAT
import static android.provider.settings.validators.SettingsValidators.NON_NEGATIVE_INTEGER_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.NON_NEGATIVE_INTEGER_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.NULLABLE_COMPONENT_NAME_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.NULLABLE_COMPONENT_NAME_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.PACKAGE_NAME_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.PACKAGE_NAME_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.PERCENTAGE_INTEGER_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.TILE_LIST_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.TILE_LIST_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.TTS_LIST_VALIDATOR;
import static android.provider.settings.validators.SettingsValidators.TTS_LIST_VALIDATOR;


@@ -101,6 +102,8 @@ public class SecureSettingsValidators {
                Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE,
                Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE,
                new InclusiveFloatRangeValidator(0.5f, 2.0f));
                new InclusiveFloatRangeValidator(0.5f, 2.0f));
        VALIDATORS.put(Secure.ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, ANY_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, ANY_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.REDUCE_BRIGHT_COLORS_LEVEL, PERCENTAGE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.TTS_DEFAULT_RATE, NON_NEGATIVE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.TTS_DEFAULT_RATE, NON_NEGATIVE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.TTS_DEFAULT_PITCH, NON_NEGATIVE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.TTS_DEFAULT_PITCH, NON_NEGATIVE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.TTS_DEFAULT_SYNTH, PACKAGE_NAME_VALIDATOR);
        VALIDATORS.put(Secure.TTS_DEFAULT_SYNTH, PACKAGE_NAME_VALIDATOR);
+12 −0
Original line number Original line Diff line number Diff line
@@ -2343,6 +2343,18 @@ class SettingsProtoDumpUtil {
                SecureSettingsProto.QuickSettings.AUTO_ADDED_TILES);
                SecureSettingsProto.QuickSettings.AUTO_ADDED_TILES);
        p.end(qsToken);
        p.end(qsToken);


        final long reduceBrightColorsToken = p.start(SecureSettingsProto.REDUCE_BRIGHT_COLORS);
        dumpSetting(s, p,
                Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED,
                SecureSettingsProto.ReduceBrightColors.ACTIVATED);
        dumpSetting(s, p,
                Settings.Secure.REDUCE_BRIGHT_COLORS_LEVEL,
                SecureSettingsProto.ReduceBrightColors.LEVEL);
        dumpSetting(s, p,
                Settings.Secure.REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS,
                SecureSettingsProto.ReduceBrightColors.PERSIST_ACROSS_REBOOTS);
        p.end(reduceBrightColorsToken);

        final long rotationToken = p.start(SecureSettingsProto.ROTATION);
        final long rotationToken = p.start(SecureSettingsProto.ROTATION);
        dumpSetting(s, p,
        dumpSetting(s, p,
                Settings.Secure.SHOW_ROTATION_SUGGESTIONS,
                Settings.Secure.SHOW_ROTATION_SUGGESTIONS,
Loading