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

Commit 9d2f3764 authored by chenjean's avatar chenjean Committed by Chun-Ku Lin
Browse files

feat(HCT): Add a Setting to store the HCT prompt status

Bug: 369906140
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Test: used in other change in this topic
Change-Id: Ie5943d9ee5e06e8546732264050a057ae2bc2ec6
parent 283ce250
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -8949,6 +8949,18 @@ public final class Settings {
        public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
                "high_text_contrast_enabled";
        /**
         * Setting that specifies the status of the High Contrast Text
         * rectangle refresh's one-time prompt.
         * 0 = UNKNOWN
         * 1 = PROMPT_SHOWN
         * 2 = PROMPT_UNNECESSARY
         *
         * @hide
         */
        public static final String ACCESSIBILITY_HCT_RECT_PROMPT_STATUS =
                "accessibility_hct_rect_prompt_status";
        /**
         * The color contrast, float in [-1, 1], 1 being the highest contrast.
         *
+1 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ message SecureSettingsProto {
        optional SettingProto accessibility_gesture_targets = 57 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto display_daltonizer_saturation_level = 58 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto accessibility_key_gesture_targets = 59 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto hct_rect_prompt_status = 60 [ (android.privacy).dest = DEST_AUTOMATIC ];

    }
    optional Accessibility accessibility = 2;
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public class SecureSettings {
        Settings.Secure.ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
        Settings.Secure.ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
        Settings.Secure.ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
        Settings.Secure.ACCESSIBILITY_HCT_RECT_PROMPT_STATUS,
        Settings.Secure.ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
        Settings.Secure.CONTRAST_LEVEL,
        Settings.Secure.ACCESSIBILITY_CAPTIONING_PRESET,
+3 −0
Original line number Diff line number Diff line
@@ -88,6 +88,9 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(
                Secure.ACCESSIBILITY_HCT_RECT_PROMPT_STATUS,
                new DiscreteValueValidator(new String[] {"0", "1", "2"}));
        VALIDATORS.put(Secure.CONTRAST_LEVEL, new InclusiveFloatRangeValidator(-1f, 1f));
        VALIDATORS.put(
                Secure.ACCESSIBILITY_CAPTIONING_PRESET,
+3 −0
Original line number Diff line number Diff line
@@ -1777,6 +1777,9 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.Secure.ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
                SecureSettingsProto.Accessibility.HIGH_TEXT_CONTRAST_ENABLED);
        dumpSetting(s, p,
                Settings.Secure.ACCESSIBILITY_HCT_RECT_PROMPT_STATUS,
                SecureSettingsProto.Accessibility.HCT_RECT_PROMPT_STATUS);
        dumpSetting(s, p,
                Settings.Secure.CONTRAST_LEVEL,
                SecureSettingsProto.Accessibility.CONTRAST_LEVEL);