From 3e980c7c8f0dc41acde82bf81d9d65adaaae9d60 Mon Sep 17 00:00:00 2001 From: Patty Huang Date: Thu, 1 Jun 2023 20:34:48 +0800 Subject: [PATCH] Default show LE audio toggle in Device Detail Bug: 284790607 Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioDeviceDetailsPreferenceControllerTest Test: Checks the LE Audio toggle is shown in Device Detail by default Change-Id: Id301815513e8066941d3e4c44ab2e7b4d5ed011b --- .../bluetooth/BluetoothDetailsProfilesController.java | 2 +- ...luetoothLeAudioDeviceDetailsPreferenceController.java | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java index 724947c2fd6..aaedebd7634 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java @@ -99,7 +99,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll mIsLeContactSharingEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI, SettingsUIDeviceConfig.BT_LE_AUDIO_CONTACT_SHARING_ENABLED, true); mIsLeAudioToggleEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI, - SettingsUIDeviceConfig.BT_LE_AUDIO_DEVICE_DETAIL_ENABLED, false) + SettingsUIDeviceConfig.BT_LE_AUDIO_DEVICE_DETAIL_ENABLED, true) || DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_BLUETOOTH, CONFIG_LE_AUDIO_ENABLED_BY_DEFAULT, false); // Call refresh here even though it will get called later in onResume, to avoid the diff --git a/src/com/android/settings/development/BluetoothLeAudioDeviceDetailsPreferenceController.java b/src/com/android/settings/development/BluetoothLeAudioDeviceDetailsPreferenceController.java index a54c594c84d..298ced091a9 100644 --- a/src/com/android/settings/development/BluetoothLeAudioDeviceDetailsPreferenceController.java +++ b/src/com/android/settings/development/BluetoothLeAudioDeviceDetailsPreferenceController.java @@ -40,6 +40,7 @@ public class BluetoothLeAudioDeviceDetailsPreferenceController private static final String PREFERENCE_KEY = "bluetooth_show_leaudio_device_details"; private static final String CONFIG_LE_AUDIO_ENABLED_BY_DEFAULT = "le_audio_enabled_by_default"; + private static final boolean LE_AUDIO_DEVICE_DETAIL_DEFAULT_VALUE = true; static int sLeAudioSupportedStateCache = BluetoothStatusCodes.ERROR_UNKNOWN; @VisibleForTesting @@ -75,7 +76,7 @@ public class BluetoothLeAudioDeviceDetailsPreferenceController DeviceConfig.setProperty( DeviceConfig.NAMESPACE_SETTINGS_UI, SettingsUIDeviceConfig.BT_LE_AUDIO_DEVICE_DETAIL_ENABLED, - isEnabled ? "true" : "false", false); + isEnabled ? "true" : "false", LE_AUDIO_DEVICE_DETAIL_DEFAULT_VALUE); return true; } @@ -87,7 +88,8 @@ public class BluetoothLeAudioDeviceDetailsPreferenceController final boolean leAudioDeviceDetailEnabled = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_SETTINGS_UI, - SettingsUIDeviceConfig.BT_LE_AUDIO_DEVICE_DETAIL_ENABLED, false); + SettingsUIDeviceConfig.BT_LE_AUDIO_DEVICE_DETAIL_ENABLED, + LE_AUDIO_DEVICE_DETAIL_DEFAULT_VALUE); final boolean leAudioEnabledByDefault = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_BLUETOOTH, CONFIG_LE_AUDIO_ENABLED_BY_DEFAULT, false); @@ -102,6 +104,7 @@ public class BluetoothLeAudioDeviceDetailsPreferenceController // Reset the toggle to null when the developer option is disabled DeviceConfig.setProperty( DeviceConfig.NAMESPACE_SETTINGS_UI, - SettingsUIDeviceConfig.BT_LE_AUDIO_DEVICE_DETAIL_ENABLED, "null", false); + SettingsUIDeviceConfig.BT_LE_AUDIO_DEVICE_DETAIL_ENABLED, "null", + LE_AUDIO_DEVICE_DETAIL_DEFAULT_VALUE); } }