From c2d7be6667149ebdcf4091db4e76f9cb7a44e80b Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Wed, 22 Nov 2017 10:57:42 -0800 Subject: [PATCH] Add persistent state for Hearing Aid Profile Defines the flag used in code and the Settings.Global key names for persisting state of the Bluetooth Hearing Aid Profile. Test: manual Bug: 69623109 Change-Id: I19e68be55a80f338bdc5d39d6c3c6d251f1cb514 --- core/java/android/provider/Settings.java | 11 +++++++++++ core/proto/android/providers/settings.proto | 3 ++- .../src/android/provider/SettingsBackupTest.java | 1 + .../providers/settings/SettingsProtoDumpUtil.java | 3 +++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 994575545c5ca..729c0ff6febb4 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -9379,6 +9379,9 @@ public final class Settings { /** {@hide} */ public static final String BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; + /** {@hide} */ + public static final String + BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_"; /** * Activity manager specific settings. @@ -9744,6 +9747,14 @@ public final class Settings { return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); } + /** + * Get the key that retrieves a bluetooth hearing aid priority. + * @hide + */ + public static final String getBluetoothHearingAidPriorityKey(String address) { + return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); + } + /** * Get the key that retrieves a bluetooth map priority. * @hide diff --git a/core/proto/android/providers/settings.proto b/core/proto/android/providers/settings.proto index 5d5aea2a12cdb..322914061509c 100644 --- a/core/proto/android/providers/settings.proto +++ b/core/proto/android/providers/settings.proto @@ -281,6 +281,7 @@ message GlobalSettingsProto { optional SettingProto bluetooth_pbap_client_priority_prefix = 209; optional SettingProto bluetooth_sap_priority_prefix = 210; optional SettingProto bluetooth_pan_priority_prefix = 211; + optional SettingProto bluetooth_hearing_aid_priority_prefix = 345; optional SettingProto activity_manager_constants = 317; optional SettingProto device_idle_constants = 212; optional SettingProto device_idle_constants_watch = 213; @@ -387,7 +388,7 @@ message GlobalSettingsProto { optional SettingProto enable_deletion_helper_no_threshold_toggle = 340; optional SettingProto notification_snooze_options = 341; - // Next tag = 345; + // Next tag = 346; } message SecureSettingsProto { diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java index 492ef7288fccf..454d2096eca86 100644 --- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java +++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java @@ -127,6 +127,7 @@ public class SettingsBackupTest { Settings.Global.BLUETOOTH_PAN_PRIORITY_PREFIX, Settings.Global.BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX, Settings.Global.BLUETOOTH_SAP_PRIORITY_PREFIX, + Settings.Global.BLUETOOTH_HEARING_AID_PRIORITY_PREFIX, Settings.Global.BOOT_COUNT, Settings.Global.CAPTIVE_PORTAL_FALLBACK_URL, Settings.Global.CAPTIVE_PORTAL_HTTPS_URL, diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java index ba1c9e3cc43bc..52b4f4df57355 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java @@ -800,6 +800,9 @@ class SettingsProtoDumpUtil { dumpSetting(s, p, Settings.Global.BLUETOOTH_PAN_PRIORITY_PREFIX, GlobalSettingsProto.BLUETOOTH_PAN_PRIORITY_PREFIX); + dumpSetting(s, p, + Settings.Global.BLUETOOTH_HEARING_AID_PRIORITY_PREFIX, + GlobalSettingsProto.BLUETOOTH_HEARING_AID_PRIORITY_PREFIX); dumpSetting(s, p, Settings.Global.ACTIVITY_MANAGER_CONSTANTS, GlobalSettingsProto.ACTIVITY_MANAGER_CONSTANTS);