Merge "Add the log and moving it into onResume" into udc-d1-dev am: add7deceb2 am: 1f80bf93aa

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23579644

Change-Id: I0dfbb7d60d5b329c5fd72af814ba27a0abad917a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
SongFerng Wang
2023-06-07 04:34:11 +00:00
committed by Automerger Merge Worker

View File

@@ -96,12 +96,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
protected void init(PreferenceScreen screen) { protected void init(PreferenceScreen screen) {
mProfilesContainer = (PreferenceCategory)screen.findPreference(getPreferenceKey()); mProfilesContainer = (PreferenceCategory)screen.findPreference(getPreferenceKey());
mProfilesContainer.setLayoutResource(R.layout.preference_bluetooth_profile_category); 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, 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 // Call refresh here even though it will get called later in onResume, to avoid the
// list of switches appearing to "pop" into the page. // list of switches appearing to "pop" into the page.
refresh(); refresh();
@@ -437,6 +431,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
@Override @Override
public void onResume() { public void onResume() {
updateLeAudioConfig();
for (CachedBluetoothDevice item : mAllOfCachedDevices) { for (CachedBluetoothDevice item : mAllOfCachedDevices) {
item.registerCallback(this); item.registerCallback(this);
} }
@@ -444,6 +439,20 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
refresh(); refresh();
} }
private void updateLeAudioConfig() {
mIsLeContactSharingEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI,
SettingsUIDeviceConfig.BT_LE_AUDIO_CONTACT_SHARING_ENABLED, true);
boolean isLeDeviceDetailEnabled = DeviceConfig.getBoolean(
DeviceConfig.NAMESPACE_SETTINGS_UI,
SettingsUIDeviceConfig.BT_LE_AUDIO_DEVICE_DETAIL_ENABLED, true);
boolean isLeEnabledByDefault = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_BLUETOOTH,
CONFIG_LE_AUDIO_ENABLED_BY_DEFAULT, false);
mIsLeAudioToggleEnabled = isLeDeviceDetailEnabled || isLeEnabledByDefault;
Log.d(TAG, "BT_LE_AUDIO_CONTACT_SHARING_ENABLED:" + mIsLeContactSharingEnabled
+ ", BT_LE_AUDIO_DEVICE_DETAIL_ENABLED:" + isLeDeviceDetailEnabled
+ ", CONFIG_LE_AUDIO_ENABLED_BY_DEFAULT:" + isLeEnabledByDefault);
}
@Override @Override
public void onDeviceAttributesChanged() { public void onDeviceAttributesChanged() {
for (CachedBluetoothDevice item : mAllOfCachedDevices) { for (CachedBluetoothDevice item : mAllOfCachedDevices) {