diff options
Diffstat (limited to 'packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java')
| -rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java index bcb345584ff3..334792048105 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java @@ -24,6 +24,7 @@ import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHeadset; import android.bluetooth.BluetoothHeadsetClient; import android.bluetooth.BluetoothHearingAid; +import android.bluetooth.BluetoothLeAudio; import android.bluetooth.BluetoothHidDevice; import android.bluetooth.BluetoothHidHost; import android.bluetooth.BluetoothMap; @@ -102,6 +103,7 @@ public class LocalBluetoothProfileManager { private PbapServerProfile mPbapProfile; private HearingAidProfile mHearingAidProfile; private CsipSetCoordinatorProfile mCsipSetCoordinatorProfile; + private LeAudioProfile mLeAudioProfile; private SapProfile mSapProfile; private VolumeControlProfile mVolumeControlProfile; @@ -232,6 +234,14 @@ public class LocalBluetoothProfileManager { // Note: no event handler for VCP, only for being connectable. mProfileNameMap.put(VolumeControlProfile.NAME, mVolumeControlProfile); } + if (mLeAudioProfile == null && supportedList.contains(BluetoothProfile.LE_AUDIO)) { + if (DEBUG) { + Log.d(TAG, "Adding local LE_AUDIO profile"); + } + mLeAudioProfile = new LeAudioProfile(mContext, mDeviceManager, this); + addProfile(mLeAudioProfile, LeAudioProfile.NAME, + BluetoothLeAudio.ACTION_LE_AUDIO_CONNECTION_STATE_CHANGED); + } if (mCsipSetCoordinatorProfile == null && supportedList.contains(BluetoothProfile.CSIP_SET_COORDINATOR)) { if (DEBUG) { @@ -487,6 +497,10 @@ public class LocalBluetoothProfileManager { return mHearingAidProfile; } + public LeAudioProfile getLeAudioProfile() { + return mLeAudioProfile; + } + SapProfile getSapProfile() { return mSapProfile; } @@ -614,6 +628,11 @@ public class LocalBluetoothProfileManager { removedProfiles.remove(mHearingAidProfile); } + if (ArrayUtils.contains(uuids, BluetoothUuid.LE_AUDIO) && mLeAudioProfile != null) { + profiles.add(mLeAudioProfile); + removedProfiles.remove(mLeAudioProfile); + } + if (mSapProfile != null && ArrayUtils.contains(uuids, BluetoothUuid.SAP)) { profiles.add(mSapProfile); removedProfiles.remove(mSapProfile); |
