diff options
Diffstat (limited to 'src/main/java/com/google/android/mobly/snippet')
-rw-r--r-- | src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java b/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java index ec148ca..60ed1ec 100644 --- a/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java +++ b/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java @@ -96,6 +96,12 @@ public class BluetoothA2dpSnippet implements Snippet { return mJsonSerializer.serializeBluetoothDeviceList(sA2dpProfile.getConnectedDevices()); } + @Rpc(description = "Checks if a device is streaming audio via A2DP profile.") + public boolean btIsA2dpPlaying(String deviceAddress) throws Throwable { + BluetoothDevice device = getConnectedBluetoothDevice(deviceAddress); + return sA2dpProfile.isA2dpPlaying(device); + } + private BluetoothDevice getConnectedBluetoothDevice(String deviceAddress) throws BluetoothA2dpSnippetException { for (BluetoothDevice device : sA2dpProfile.getConnectedDevices()) { |