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

Commit 1102afa6 authored by Jason Hsu's avatar Jason Hsu Committed by Android (Google) Code Review
Browse files

Merge changes from topic "flag_hearing_devices" into main

* changes:
  Add Global Settings key for HEARING_DEVICE_LOCAL_NOTIFICATION
  New flag: hearing_devices_input_routing_control
parents 7980a97f 04b1abc3
Loading
Loading
Loading
Loading
+38 −22
Original line number Diff line number Diff line
@@ -6395,27 +6395,6 @@ public final class Settings {
        public static final String SCREEN_FLASH_NOTIFICATION_COLOR =
                "screen_flash_notification_color_global";
        /**
         * A semi-colon separated list of Bluetooth hearing devices' local ambient volume.
         * Each entry is encoded as a key=value list, separated by commas. Ex:
         *
         * "addr=XX:XX:XX:00:11,ambient=20,group_ambient=30;addr=XX:XX:XX:00:22,ambient=50"
         *
         * The following keys are supported:
         * <pre>
         * addr                 (String)
         * ambient              (int)
         * group_ambient        (int)
         * control_expanded     (boolean)
         * </pre>
         *
         * Each entry must contains "addr" attribute, otherwise it'll be ignored.
         * @hide
         */
        public static final String HEARING_DEVICE_LOCAL_AMBIENT_VOLUME =
                "hearing_device_local_ambient_volume";
        /**
         * IMPORTANT: If you add a new public settings you also have to add it to
         * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
@@ -6560,7 +6539,6 @@ public final class Settings {
            PRIVATE_SETTINGS.add(DEFAULT_DEVICE_FONT_SCALE);
            PRIVATE_SETTINGS.add(MOUSE_REVERSE_VERTICAL_SCROLLING);
            PRIVATE_SETTINGS.add(MOUSE_SWAP_PRIMARY_BUTTON);
            PRIVATE_SETTINGS.add(HEARING_DEVICE_LOCAL_AMBIENT_VOLUME);
        }
        /**
@@ -18137,6 +18115,44 @@ public final class Settings {
         */
        public static final String ONE_HANDED_KEYGUARD_SIDE = "one_handed_keyguard_side";
        /**
         * A semi-colon separated list of Bluetooth hearing devices' local ambient volume data.
         * Each entry is encoded as a key=value list, separated by commas. Ex:
         *
         * "addr=XX:XX:XX:00:11,ambient=20,group_ambient=30;addr=XX:XX:XX:00:22,ambient=50"
         *
         * The following keys are supported:
         * <pre>
         * addr                 (String)
         * ambient              (int)
         * group_ambient        (int)
         * control_expanded     (boolean)
         * </pre>
         *
         * Each entry must contains "addr" attribute, otherwise it'll be ignored.
         * @hide
         */
        public static final String HEARING_DEVICE_LOCAL_AMBIENT_VOLUME =
                "hearing_device_local_ambient_volume";
        /**
         * A semi-colon separated list of Bluetooth hearing devices' notification data.
         * Each entry is encoded as a key=value list, separated by commas. Ex:
         *
         * "addr=XX:XX:XX:00:11,input_changes=1"
         *
         * The following keys are supported:
         * <pre>
         * addr                 (String)
         * input_changes        (boolean)
         * </pre>
         *
         * Each entry must contains "addr" attribute, otherwise it'll be ignored.
         * @hide
         */
        public static final String HEARING_DEVICE_LOCAL_NOTIFICATION =
                "hearing_device_local_notification";
        /**
         * Global settings that shouldn't be persisted.
         *
+7 −0
Original line number Diff line number Diff line
@@ -171,3 +171,10 @@ flag {
    description: "Enable the user consent prompt before writing sensitive preferences via service"
    bug: "378552675"
}

flag {
    name: "hearing_devices_input_routing_control"
    namespace: "accessibility"
    description: "Enable the input routing control in device details and hearing devices dialog."
    bug: "349255906"
}
+2 −0
Original line number Diff line number Diff line
@@ -462,5 +462,7 @@ public class GlobalSettingsValidators {
                Global.Wearable.PHONE_SWITCHING_REQUEST_SOURCE_NONE,
                Global.Wearable.PHONE_SWITCHING_REQUEST_SOURCE_COMPANION
        ));
        VALIDATORS.put(Global.HEARING_DEVICE_LOCAL_AMBIENT_VOLUME, ANY_STRING_VALIDATOR);
        VALIDATORS.put(Global.HEARING_DEVICE_LOCAL_NOTIFICATION, ANY_STRING_VALIDATOR);
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -263,6 +263,5 @@ public class SystemSettingsValidators {
        VALIDATORS.put(System.NOTIFICATION_COOLDOWN_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(System.NOTIFICATION_COOLDOWN_ALL, BOOLEAN_VALIDATOR);
        VALIDATORS.put(System.NOTIFICATION_COOLDOWN_VIBRATE_UNLOCKED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(System.HEARING_DEVICE_LOCAL_AMBIENT_VOLUME, ANY_STRING_VALIDATOR);
    }
}
+3 −2
Original line number Diff line number Diff line
@@ -564,6 +564,8 @@ public class SettingsBackupTest {
                    Settings.Global.MANAGED_PROVISIONING_DEFER_PROVISIONING_TO_ROLE_HOLDER,
                    Settings.Global.REVIEW_PERMISSIONS_NOTIFICATION_STATE,
                    Settings.Global.ENABLE_BACK_ANIMATION, // Temporary for T, dev option only
                    Settings.Global.HEARING_DEVICE_LOCAL_AMBIENT_VOLUME, // cache per hearing device
                    Settings.Global.HEARING_DEVICE_LOCAL_NOTIFICATION, // cache per hearing device
                    Settings.Global.Wearable.COMBINED_LOCATION_ENABLE,
                    Settings.Global.Wearable.HAS_PAY_TOKENS,
                    Settings.Global.Wearable.GMS_CHECKIN_TIMEOUT_MIN,
@@ -944,8 +946,7 @@ public class SettingsBackupTest {
                        Settings.System.WEAR_ACCESSIBILITY_GESTURE_ENABLED_DURING_OOBE,
                        Settings.System.WEAR_TTS_PREWARM_ENABLED,
                        Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ,
                        Settings.System.MULTI_AUDIO_FOCUS_ENABLED, // form-factor/OEM specific
                        Settings.System.HEARING_DEVICE_LOCAL_AMBIENT_VOLUME // internal cache
                        Settings.System.MULTI_AUDIO_FOCUS_ENABLED // form-factor/OEM specific
                );
        if (!Flags.backUpSmoothDisplayAndForcePeakRefreshRate()) {
            settings.add(Settings.System.MIN_REFRESH_RATE);