diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2010-10-14 11:03:42 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-14 11:03:42 -0700 |
commit | 0b9ba91fa54f58ef3272e0f252ac16691731a788 (patch) | |
tree | b5a1abbb241b4070bfd71cc86406ce7eb78925a2 | |
parent | 271cbb62a509e75be9a2b04ec7530303dc99e500 (diff) | |
parent | 41d5c805d96aef0aaa9a2aaa86ccc4b77ca75e11 (diff) | |
download | frameworks_base-0b9ba91fa54f58ef3272e0f252ac16691731a788.zip frameworks_base-0b9ba91fa54f58ef3272e0f252ac16691731a788.tar.gz frameworks_base-0b9ba91fa54f58ef3272e0f252ac16691731a788.tar.bz2 |
Merge "Add function to check for AVRCP target to send volume keys."
-rw-r--r-- | core/java/android/bluetooth/BluetoothA2dp.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothA2dp.java b/core/java/android/bluetooth/BluetoothA2dp.java index d308a5c..920ef89 100644 --- a/core/java/android/bluetooth/BluetoothA2dp.java +++ b/core/java/android/bluetooth/BluetoothA2dp.java @@ -20,6 +20,7 @@ import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.content.Context; import android.os.IBinder; +import android.os.ParcelUuid; import android.os.RemoteException; import android.os.ServiceManager; import android.server.BluetoothA2dpService; @@ -338,6 +339,26 @@ public final class BluetoothA2dp implements BluetoothProfile { return false; } + /** + * This function checks if the remote device is an AVCRP + * target and thus whether we should send volume keys + * changes or not. + * @hide + */ + public boolean shouldSendVolumeKeys(BluetoothDevice device) { + if (isEnabled() && isValidDevice(device)) { + ParcelUuid[] uuids = device.getUuids(); + if (uuids == null) return false; + + for (ParcelUuid uuid: uuids) { + if (BluetoothUuid.isAvrcpTarget(uuid)) { + return true; + } + } + } + return false; + } + /** * Helper for converting a state to a string. * |