From 706257c57aeee060fc79b19c1bb2e25a07546b17 Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Thu, 4 May 2023 03:35:50 +0800 Subject: [PATCH] Hide the LE audio toggle by flag Bug: 280021500 Test: build pass. Change-Id: I3f4a821c50dfb9d2de73919945334b42c59b3309 --- .../bluetooth/BluetoothDetailsProfilesController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java index f69cf580d51..208fba7716c 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java @@ -77,6 +77,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll private Map> mProfileDeviceMap = new HashMap>(); private boolean mIsLeContactSharingEnabled = false; + private boolean mIsLeAudioToggleEnabled = false; @VisibleForTesting PreferenceCategory mProfilesContainer; @@ -97,6 +98,8 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll mProfilesContainer.setLayoutResource(R.layout.preference_bluetooth_profile_category); 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); // Call refresh here even though it will get called later in onResume, to avoid the // list of switches appearing to "pop" into the page. refresh(); @@ -142,6 +145,10 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll profilePref.setEnabled(!mCachedDevice.isBusy()); } + if (profile instanceof LeAudioProfile && !mIsLeAudioToggleEnabled) { + profilePref.setVisible(false); + } + if (profile instanceof MapProfile) { profilePref.setChecked(device.getMessageAccessPermission() == BluetoothDevice.ACCESS_ALLOWED);