Loading src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java +23 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings.bluetooth; import static android.bluetooth.BluetoothDevice.METADATA_MODEL_NAME; import android.app.settings.SettingsEnums; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; Loading Loading @@ -83,6 +84,8 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll private static final boolean LE_AUDIO_TOGGLE_VISIBLE_DEFAULT_VALUE = true; private static final String LE_AUDIO_TOGGLE_VISIBLE_PROPERTY = "persist.bluetooth.leaudio.toggle_visible"; private static final String BYPASS_LE_AUDIO_ALLOWLIST_PROPERTY = "persist.bluetooth.leaudio.bypass_allow_list"; private Set<String> mInvisibleProfiles = Collections.emptySet(); private final AtomicReference<Set<String>> mAdditionalInvisibleProfiles = Loading Loading @@ -378,6 +381,16 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll return result; } private boolean isCurrentDeviceInOrByPassAllowList() { if (!SystemProperties.getBoolean(LE_AUDIO_CONNECTION_BY_DEFAULT_PROPERTY, true)) { return false; } return SystemProperties.getBoolean(BYPASS_LE_AUDIO_ALLOWLIST_PROPERTY, false) || isModelNameInAllowList( BluetoothUtils.getStringMetaData( mCachedDevice.getDevice(), METADATA_MODEL_NAME)); } /** * Disable the Le Audio profile for each of the Le Audio devices. * Loading @@ -389,6 +402,11 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll return; } mMetricsFeatureProvider.action( mContext, SettingsEnums.ACTION_BLUETOOTH_PROFILE_LE_AUDIO_OFF, isCurrentDeviceInOrByPassAllowList()); LocalBluetoothProfile asha = mProfileManager.getHearingAidProfile(); LocalBluetoothProfile broadcastAssistant = mProfileManager.getLeAudioBroadcastAssistantProfile(); Loading Loading @@ -427,6 +445,11 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll return; } mMetricsFeatureProvider.action( mContext, SettingsEnums.ACTION_BLUETOOTH_PROFILE_LE_AUDIO_ON, isCurrentDeviceInOrByPassAllowList()); if (!SystemProperties.getBoolean(ENABLE_DUAL_MODE_AUDIO, false)) { Log.i(TAG, "Disabling classic audio profiles because dual mode is disabled"); disableProfileBeforeUserEnablesLeAudio(mProfileManager.getA2dpProfile()); Loading Loading
src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java +23 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings.bluetooth; import static android.bluetooth.BluetoothDevice.METADATA_MODEL_NAME; import android.app.settings.SettingsEnums; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; Loading Loading @@ -83,6 +84,8 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll private static final boolean LE_AUDIO_TOGGLE_VISIBLE_DEFAULT_VALUE = true; private static final String LE_AUDIO_TOGGLE_VISIBLE_PROPERTY = "persist.bluetooth.leaudio.toggle_visible"; private static final String BYPASS_LE_AUDIO_ALLOWLIST_PROPERTY = "persist.bluetooth.leaudio.bypass_allow_list"; private Set<String> mInvisibleProfiles = Collections.emptySet(); private final AtomicReference<Set<String>> mAdditionalInvisibleProfiles = Loading Loading @@ -378,6 +381,16 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll return result; } private boolean isCurrentDeviceInOrByPassAllowList() { if (!SystemProperties.getBoolean(LE_AUDIO_CONNECTION_BY_DEFAULT_PROPERTY, true)) { return false; } return SystemProperties.getBoolean(BYPASS_LE_AUDIO_ALLOWLIST_PROPERTY, false) || isModelNameInAllowList( BluetoothUtils.getStringMetaData( mCachedDevice.getDevice(), METADATA_MODEL_NAME)); } /** * Disable the Le Audio profile for each of the Le Audio devices. * Loading @@ -389,6 +402,11 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll return; } mMetricsFeatureProvider.action( mContext, SettingsEnums.ACTION_BLUETOOTH_PROFILE_LE_AUDIO_OFF, isCurrentDeviceInOrByPassAllowList()); LocalBluetoothProfile asha = mProfileManager.getHearingAidProfile(); LocalBluetoothProfile broadcastAssistant = mProfileManager.getLeAudioBroadcastAssistantProfile(); Loading Loading @@ -427,6 +445,11 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll return; } mMetricsFeatureProvider.action( mContext, SettingsEnums.ACTION_BLUETOOTH_PROFILE_LE_AUDIO_ON, isCurrentDeviceInOrByPassAllowList()); if (!SystemProperties.getBoolean(ENABLE_DUAL_MODE_AUDIO, false)) { Log.i(TAG, "Disabling classic audio profiles because dual mode is disabled"); disableProfileBeforeUserEnablesLeAudio(mProfileManager.getA2dpProfile()); Loading