diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 709f221cd2f23..8b2b766078eb1 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -6999,6 +6999,58 @@ public final class Settings {
public static final String BLUETOOTH_LE_BROADCAST_APP_SOURCE_NAME =
"bluetooth_le_broadcast_app_source_name";
+ /**
+ * Ringtone routing value for hearing aid. It routes ringtone to hearing aid or device
+ * speaker.
+ *
+ * - 0 = Default
+ *
- 1 = Route to hearing aid
+ *
- 2 = Route to device speaker
+ *
+ * @hide
+ */
+ public static final String HEARING_AID_RINGTONE_ROUTING =
+ "hearing_aid_ringtone_routing";
+
+ /**
+ * Phone call routing value for hearing aid. It routes phone call to hearing aid or
+ * device speaker.
+ *
+ * - 0 = Default
+ *
- 1 = Route to hearing aid
+ *
- 2 = Route to device speaker
+ *
+ * @hide
+ */
+ public static final String HEARING_AID_CALL_ROUTING =
+ "hearing_aid_call_routing";
+
+ /**
+ * Media routing value for hearing aid. It routes media to hearing aid or device
+ * speaker.
+ *
+ * - 0 = Default
+ *
- 1 = Route to hearing aid
+ *
- 2 = Route to device speaker
+ *
+ * @hide
+ */
+ public static final String HEARING_AID_MEDIA_ROUTING =
+ "hearing_aid_media_routing";
+
+ /**
+ * System sounds routing value for hearing aid. It routes system sounds to hearing aid
+ * or device speaker.
+ *
+ * - 0 = Default
+ *
- 1 = Route to hearing aid
+ *
- 2 = Route to device speaker
+ *
+ * @hide
+ */
+ public static final String HEARING_AID_SYSTEM_SOUNDS_ROUTING =
+ "hearing_aid_system_sounds_routing";
+
/**
* Setting to indicate that on device captions are enabled.
*
diff --git a/core/proto/android/providers/settings/secure.proto b/core/proto/android/providers/settings/secure.proto
index 68267db87a5ce..56627878dee85 100644
--- a/core/proto/android/providers/settings/secure.proto
+++ b/core/proto/android/providers/settings/secure.proto
@@ -90,6 +90,10 @@ message SecureSettingsProto {
optional SettingProto accessibility_magnification_follow_typing_enabled = 43 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto contrast_level = 44 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto accessibility_magnification_always_on_enabled = 45 [ (android.privacy).dest = DEST_AUTOMATIC ];
+ optional SettingProto hearing_aid_ringtone_routing = 46 [ (android.privacy).dest = DEST_AUTOMATIC ];
+ optional SettingProto hearing_aid_call_routing = 47 [ (android.privacy).dest = DEST_AUTOMATIC ];
+ optional SettingProto hearing_aid_media_routing = 48 [ (android.privacy).dest = DEST_AUTOMATIC ];
+ optional SettingProto hearing_aid_system_sounds_routing = 49 [ (android.privacy).dest = DEST_AUTOMATIC ];
}
optional Accessibility accessibility = 2;
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
index a08d7cd16b74f..6b5e19983949f 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
@@ -230,6 +230,10 @@ public class SecureSettings {
Settings.Secure.BLUETOOTH_LE_BROADCAST_APP_SOURCE_NAME,
Settings.Secure.CUSTOM_BUGREPORT_HANDLER_APP,
Settings.Secure.CUSTOM_BUGREPORT_HANDLER_USER,
- Settings.Secure.LOCK_SCREEN_WEATHER_ENABLED
+ Settings.Secure.LOCK_SCREEN_WEATHER_ENABLED,
+ Settings.Secure.HEARING_AID_RINGTONE_ROUTING,
+ Settings.Secure.HEARING_AID_CALL_ROUTING,
+ Settings.Secure.HEARING_AID_MEDIA_ROUTING,
+ Settings.Secure.HEARING_AID_SYSTEM_SOUNDS_ROUTING,
};
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
index 154987dad7360..8dbf3d4b0abdc 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
@@ -363,5 +363,13 @@ public class SecureSettingsValidators {
VALIDATORS.put(Secure.CUSTOM_BUGREPORT_HANDLER_APP, ANY_STRING_VALIDATOR);
VALIDATORS.put(Secure.CUSTOM_BUGREPORT_HANDLER_USER, ANY_INTEGER_VALIDATOR);
VALIDATORS.put(Secure.LOCK_SCREEN_WEATHER_ENABLED, BOOLEAN_VALIDATOR);
+ VALIDATORS.put(Secure.HEARING_AID_RINGTONE_ROUTING,
+ new DiscreteValueValidator(new String[] {"0", "1", "2"}));
+ VALIDATORS.put(Secure.HEARING_AID_CALL_ROUTING,
+ new DiscreteValueValidator(new String[] {"0", "1", "2"}));
+ VALIDATORS.put(Secure.HEARING_AID_MEDIA_ROUTING,
+ new DiscreteValueValidator(new String[] {"0", "1", "2"}));
+ VALIDATORS.put(Secure.HEARING_AID_SYSTEM_SOUNDS_ROUTING,
+ new DiscreteValueValidator(new String[] {"0", "1", "2"}));
}
}
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
index 159f2dd52586c..6db4dcc8b87f3 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
@@ -1836,6 +1836,18 @@ class SettingsProtoDumpUtil {
Settings.Secure.ACCESSIBILITY_MAGNIFICATION_ALWAYS_ON_ENABLED,
SecureSettingsProto.Accessibility
.ACCESSIBILITY_MAGNIFICATION_ALWAYS_ON_ENABLED);
+ dumpSetting(s, p,
+ Settings.Secure.HEARING_AID_RINGTONE_ROUTING,
+ SecureSettingsProto.Accessibility.HEARING_AID_RINGTONE_ROUTING);
+ dumpSetting(s, p,
+ Settings.Secure.HEARING_AID_CALL_ROUTING,
+ SecureSettingsProto.Accessibility.HEARING_AID_CALL_ROUTING);
+ dumpSetting(s, p,
+ Settings.Secure.HEARING_AID_MEDIA_ROUTING,
+ SecureSettingsProto.Accessibility.HEARING_AID_MEDIA_ROUTING);
+ dumpSetting(s, p,
+ Settings.Secure.HEARING_AID_SYSTEM_SOUNDS_ROUTING,
+ SecureSettingsProto.Accessibility.HEARING_AID_SYSTEM_SOUNDS_ROUTING);
p.end(accessibilityToken);
final long adaptiveSleepToken = p.start(SecureSettingsProto.ADAPTIVE_SLEEP);