Loading res/values/strings.xml +4 −4 Original line number Diff line number Diff line Loading @@ -360,10 +360,10 @@ <!-- UI debug setting: Disable Bluetooth hardware offload [CHAR LIMIT=none] --> <string name="bluetooth_disable_hw_offload_dialog_cancel">Cancel</string> <!-- Setting Checkbox title for enabling Bluetooth LE Audio feature. [CHAR LIMIT=40] --> <string name="bluetooth_enable_leaudio">Enable Bluetooth LE audio</string> <!-- Summary of checkbox for enabling Bluetooth LE audio [CHAR LIMIT=none]--> <string name="bluetooth_enable_leaudio_summary">Enables Bluetooth LE audio feature if the device supports LE audio hardware capabilities.</string> <!-- Setting Checkbox title for disabling Bluetooth LE Audio feature. [CHAR LIMIT=40] --> <string name="bluetooth_disable_leaudio">Disable Bluetooth LE audio</string> <!-- Summary of checkbox for disabling Bluetooth LE audio [CHAR LIMIT=none]--> <string name="bluetooth_disable_leaudio_summary">Disables Bluetooth LE audio feature if the device supports LE audio hardware capabilities.</string> <!-- Setting Checkbox title for enabling Bluetooth LE Audio Allow List. [CHAR LIMIT=none] --> <string name="bluetooth_enable_leaudio_allow_list">Enable Bluetooth LE audio Allow List</string> res/xml/development_settings.xml +3 −3 Original line number Diff line number Diff line Loading @@ -340,9 +340,9 @@ android:summary="@string/bluetooth_disable_absolute_volume_summary" /> <SwitchPreference android:key="bluetooth_enable_leaudio" android:title="@string/bluetooth_enable_leaudio" android:summary="@string/bluetooth_enable_leaudio_summary" /> android:key="bluetooth_disable_leaudio" android:title="@string/bluetooth_disable_leaudio" android:summary="@string/bluetooth_disable_leaudio_summary" /> <SwitchPreference android:key="bluetooth_enable_leaudio_allow_list" Loading src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceController.java +3 −16 Original line number Diff line number Diff line Loading @@ -44,12 +44,6 @@ public class BluetoothLeAudioAllowListPreferenceController static final String LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY = "persist.bluetooth.leaudio.enable_allow_list"; private static final String LE_AUDIO_DYNAMIC_SWITCH_PROPERTY = "ro.bluetooth.leaudio_switcher.supported"; @VisibleForTesting static final String LE_AUDIO_DYNAMIC_ENABLED_PROPERTY = "persist.bluetooth.leaudio_switcher.enabled"; @VisibleForTesting BluetoothAdapter mBluetoothAdapter; Loading Loading @@ -83,16 +77,9 @@ public class BluetoothLeAudioAllowListPreferenceController return; } int leAudioSupportedState = mBluetoothAdapter.isLeAudioSupported(); boolean leAudioEnabled = false; if ((leAudioSupportedState == BluetoothStatusCodes.FEATURE_SUPPORTED) || (leAudioSupportedState == BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED && SystemProperties.getBoolean(LE_AUDIO_DYNAMIC_SWITCH_PROPERTY, false) && SystemProperties.getBoolean(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, false))) { leAudioEnabled = true; } final int leAudioSupportedState = mBluetoothAdapter.isLeAudioSupported(); final boolean leAudioEnabled = (leAudioSupportedState == BluetoothStatusCodes.FEATURE_SUPPORTED); final boolean leAudioAllowListSupport = SystemProperties.getBoolean(LE_AUDIO_ALLOW_LIST_SWITCH_SUPPORT_PROPERTY, false); Loading src/com/android/settings/development/BluetoothLeAudioPreferenceController.java +8 −8 Original line number Diff line number Diff line Loading @@ -36,13 +36,13 @@ public class BluetoothLeAudioPreferenceController extends DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin { private static final String PREFERENCE_KEY = "bluetooth_enable_leaudio"; private static final String PREFERENCE_KEY = "bluetooth_disable_leaudio"; private static final String LE_AUDIO_DYNAMIC_SWITCH_PROPERTY = "ro.bluetooth.leaudio_switcher.supported"; @VisibleForTesting static final String LE_AUDIO_DYNAMIC_ENABLED_PROPERTY = "persist.bluetooth.leaudio_switcher.enabled"; static final String LE_AUDIO_SWITCHER_DISABLED_PROPERTY = "persist.bluetooth.leaudio_switcher.disabled"; private final DevelopmentSettingsDashboardFragment mFragment; Loading Loading @@ -84,7 +84,7 @@ public class BluetoothLeAudioPreferenceController final boolean leAudioEnabled = (isLeAudioSupportedStatus == BluetoothStatusCodes.FEATURE_SUPPORTED); ((SwitchPreference) mPreference).setChecked(leAudioEnabled); ((SwitchPreference) mPreference).setChecked(!leAudioEnabled); // Disable option if Bluetooth is disabled or if switch is not supported if (isLeAudioSupportedStatus == BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED Loading @@ -101,10 +101,10 @@ public class BluetoothLeAudioPreferenceController return; } final boolean leAudioEnabled = (mBluetoothAdapter.isLeAudioSupported() == BluetoothStatusCodes.FEATURE_SUPPORTED); SystemProperties.set(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, Boolean.toString(!leAudioEnabled)); final boolean leAudioDisabled = (mBluetoothAdapter.isLeAudioSupported() != BluetoothStatusCodes.FEATURE_SUPPORTED); SystemProperties.set(LE_AUDIO_SWITCHER_DISABLED_PROPERTY, Boolean.toString(!leAudioDisabled)); } /** Loading tests/robotests/src/com/android/settings/development/BluetoothLeAudioPreferenceControllerTest.java +7 −7 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.settings.development; import static com.android.settings.development.BluetoothLeAudioPreferenceController .LE_AUDIO_DYNAMIC_ENABLED_PROPERTY; .LE_AUDIO_SWITCHER_DISABLED_PROPERTY; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -75,8 +75,8 @@ public class BluetoothLeAudioPreferenceControllerTest { mController.onRebootDialogConfirmed(); final boolean status = SystemProperties .getBoolean(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, false); assertThat(status).isTrue(); .getBoolean(LE_AUDIO_SWITCHER_DISABLED_PROPERTY, true); assertThat(status).isFalse(); } @Test Loading @@ -87,8 +87,8 @@ public class BluetoothLeAudioPreferenceControllerTest { mController.onRebootDialogConfirmed(); final boolean status = SystemProperties .getBoolean(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, false); assertThat(status).isFalse(); .getBoolean(LE_AUDIO_SWITCHER_DISABLED_PROPERTY, true); assertThat(status).isTrue(); } @Test Loading @@ -99,7 +99,7 @@ public class BluetoothLeAudioPreferenceControllerTest { mController.onRebootDialogCanceled(); final boolean status = SystemProperties .getBoolean(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, false); assertThat(status).isFalse(); .getBoolean(LE_AUDIO_SWITCHER_DISABLED_PROPERTY, true); assertThat(status).isTrue(); } } Loading
res/values/strings.xml +4 −4 Original line number Diff line number Diff line Loading @@ -360,10 +360,10 @@ <!-- UI debug setting: Disable Bluetooth hardware offload [CHAR LIMIT=none] --> <string name="bluetooth_disable_hw_offload_dialog_cancel">Cancel</string> <!-- Setting Checkbox title for enabling Bluetooth LE Audio feature. [CHAR LIMIT=40] --> <string name="bluetooth_enable_leaudio">Enable Bluetooth LE audio</string> <!-- Summary of checkbox for enabling Bluetooth LE audio [CHAR LIMIT=none]--> <string name="bluetooth_enable_leaudio_summary">Enables Bluetooth LE audio feature if the device supports LE audio hardware capabilities.</string> <!-- Setting Checkbox title for disabling Bluetooth LE Audio feature. [CHAR LIMIT=40] --> <string name="bluetooth_disable_leaudio">Disable Bluetooth LE audio</string> <!-- Summary of checkbox for disabling Bluetooth LE audio [CHAR LIMIT=none]--> <string name="bluetooth_disable_leaudio_summary">Disables Bluetooth LE audio feature if the device supports LE audio hardware capabilities.</string> <!-- Setting Checkbox title for enabling Bluetooth LE Audio Allow List. [CHAR LIMIT=none] --> <string name="bluetooth_enable_leaudio_allow_list">Enable Bluetooth LE audio Allow List</string>
res/xml/development_settings.xml +3 −3 Original line number Diff line number Diff line Loading @@ -340,9 +340,9 @@ android:summary="@string/bluetooth_disable_absolute_volume_summary" /> <SwitchPreference android:key="bluetooth_enable_leaudio" android:title="@string/bluetooth_enable_leaudio" android:summary="@string/bluetooth_enable_leaudio_summary" /> android:key="bluetooth_disable_leaudio" android:title="@string/bluetooth_disable_leaudio" android:summary="@string/bluetooth_disable_leaudio_summary" /> <SwitchPreference android:key="bluetooth_enable_leaudio_allow_list" Loading
src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceController.java +3 −16 Original line number Diff line number Diff line Loading @@ -44,12 +44,6 @@ public class BluetoothLeAudioAllowListPreferenceController static final String LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY = "persist.bluetooth.leaudio.enable_allow_list"; private static final String LE_AUDIO_DYNAMIC_SWITCH_PROPERTY = "ro.bluetooth.leaudio_switcher.supported"; @VisibleForTesting static final String LE_AUDIO_DYNAMIC_ENABLED_PROPERTY = "persist.bluetooth.leaudio_switcher.enabled"; @VisibleForTesting BluetoothAdapter mBluetoothAdapter; Loading Loading @@ -83,16 +77,9 @@ public class BluetoothLeAudioAllowListPreferenceController return; } int leAudioSupportedState = mBluetoothAdapter.isLeAudioSupported(); boolean leAudioEnabled = false; if ((leAudioSupportedState == BluetoothStatusCodes.FEATURE_SUPPORTED) || (leAudioSupportedState == BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED && SystemProperties.getBoolean(LE_AUDIO_DYNAMIC_SWITCH_PROPERTY, false) && SystemProperties.getBoolean(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, false))) { leAudioEnabled = true; } final int leAudioSupportedState = mBluetoothAdapter.isLeAudioSupported(); final boolean leAudioEnabled = (leAudioSupportedState == BluetoothStatusCodes.FEATURE_SUPPORTED); final boolean leAudioAllowListSupport = SystemProperties.getBoolean(LE_AUDIO_ALLOW_LIST_SWITCH_SUPPORT_PROPERTY, false); Loading
src/com/android/settings/development/BluetoothLeAudioPreferenceController.java +8 −8 Original line number Diff line number Diff line Loading @@ -36,13 +36,13 @@ public class BluetoothLeAudioPreferenceController extends DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin { private static final String PREFERENCE_KEY = "bluetooth_enable_leaudio"; private static final String PREFERENCE_KEY = "bluetooth_disable_leaudio"; private static final String LE_AUDIO_DYNAMIC_SWITCH_PROPERTY = "ro.bluetooth.leaudio_switcher.supported"; @VisibleForTesting static final String LE_AUDIO_DYNAMIC_ENABLED_PROPERTY = "persist.bluetooth.leaudio_switcher.enabled"; static final String LE_AUDIO_SWITCHER_DISABLED_PROPERTY = "persist.bluetooth.leaudio_switcher.disabled"; private final DevelopmentSettingsDashboardFragment mFragment; Loading Loading @@ -84,7 +84,7 @@ public class BluetoothLeAudioPreferenceController final boolean leAudioEnabled = (isLeAudioSupportedStatus == BluetoothStatusCodes.FEATURE_SUPPORTED); ((SwitchPreference) mPreference).setChecked(leAudioEnabled); ((SwitchPreference) mPreference).setChecked(!leAudioEnabled); // Disable option if Bluetooth is disabled or if switch is not supported if (isLeAudioSupportedStatus == BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED Loading @@ -101,10 +101,10 @@ public class BluetoothLeAudioPreferenceController return; } final boolean leAudioEnabled = (mBluetoothAdapter.isLeAudioSupported() == BluetoothStatusCodes.FEATURE_SUPPORTED); SystemProperties.set(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, Boolean.toString(!leAudioEnabled)); final boolean leAudioDisabled = (mBluetoothAdapter.isLeAudioSupported() != BluetoothStatusCodes.FEATURE_SUPPORTED); SystemProperties.set(LE_AUDIO_SWITCHER_DISABLED_PROPERTY, Boolean.toString(!leAudioDisabled)); } /** Loading
tests/robotests/src/com/android/settings/development/BluetoothLeAudioPreferenceControllerTest.java +7 −7 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.settings.development; import static com.android.settings.development.BluetoothLeAudioPreferenceController .LE_AUDIO_DYNAMIC_ENABLED_PROPERTY; .LE_AUDIO_SWITCHER_DISABLED_PROPERTY; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -75,8 +75,8 @@ public class BluetoothLeAudioPreferenceControllerTest { mController.onRebootDialogConfirmed(); final boolean status = SystemProperties .getBoolean(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, false); assertThat(status).isTrue(); .getBoolean(LE_AUDIO_SWITCHER_DISABLED_PROPERTY, true); assertThat(status).isFalse(); } @Test Loading @@ -87,8 +87,8 @@ public class BluetoothLeAudioPreferenceControllerTest { mController.onRebootDialogConfirmed(); final boolean status = SystemProperties .getBoolean(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, false); assertThat(status).isFalse(); .getBoolean(LE_AUDIO_SWITCHER_DISABLED_PROPERTY, true); assertThat(status).isTrue(); } @Test Loading @@ -99,7 +99,7 @@ public class BluetoothLeAudioPreferenceControllerTest { mController.onRebootDialogCanceled(); final boolean status = SystemProperties .getBoolean(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, false); assertThat(status).isFalse(); .getBoolean(LE_AUDIO_SWITCHER_DISABLED_PROPERTY, true); assertThat(status).isTrue(); } }