summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index 257c93505cfc..b4afb7d8cd4c 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -1916,6 +1916,25 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
BluetoothProfile.STATE_CONNECTED;
}
+ /**
+ * @return {@code true} if {@code cachedBluetoothDevice} supports broadcast assistant profile
+ */
+ public boolean isConnectedLeAudioBroadcastAssistantDevice() {
+ LocalBluetoothLeBroadcastAssistant leBroadcastAssistant =
+ mProfileManager.getLeAudioBroadcastAssistantProfile();
+ return leBroadcastAssistant != null && leBroadcastAssistant.getConnectionStatus(mDevice)
+ == BluetoothProfile.STATE_CONNECTED;
+ }
+
+ /**
+ * @return {@code true} if {@code cachedBluetoothDevice} supports volume control profile
+ */
+ public boolean isConnectedVolumeControlDevice() {
+ VolumeControlProfile volumeControl = mProfileManager.getVolumeControlProfile();
+ return volumeControl != null && volumeControl.getConnectionStatus(mDevice)
+ == BluetoothProfile.STATE_CONNECTED;
+ }
+
private boolean isConnectedSapDevice() {
SapProfile sapProfile = mProfileManager.getSapProfile();
return sapProfile != null && sapProfile.getConnectionStatus(mDevice)