diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2010-06-02 12:33:53 -0700 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2010-06-02 16:03:51 -0700 |
commit | 740e39be6af3e366a4b82c030b5ea67ab144b42a (patch) | |
tree | 7a3f130873dde329ab0f64128a59ee318c13833a /media/java | |
parent | 9b637e5985f9a86f39d70335c0390ade3716592a (diff) | |
download | frameworks_base-740e39be6af3e366a4b82c030b5ea67ab144b42a.zip frameworks_base-740e39be6af3e366a4b82c030b5ea67ab144b42a.tar.gz frameworks_base-740e39be6af3e366a4b82c030b5ea67ab144b42a.tar.bz2 |
Pass BluetoothDevice to the Bluetooth Headset calls.
This is to support multiple headsets at the same time, atleast
at the framework level.
Change-Id: I91d05c6c2828c9a09d00806d5e79f1e9c9c7cf84
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioService.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 5c278d9..bd78f93 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -1092,16 +1092,20 @@ public class AudioService extends IAudioService.Stub { private BluetoothHeadset.ServiceListener mBluetoothHeadsetServiceListener = new BluetoothHeadset.ServiceListener() { public void onServiceConnected() { - if (mBluetoothHeadset != null && - mBluetoothHeadset.getState() == BluetoothHeadset.STATE_CONNECTED) { - mBluetoothHeadsetConnected = true; + if (mBluetoothHeadset != null) { + BluetoothDevice device = mBluetoothHeadset.getCurrentHeadset(); + if (mBluetoothHeadset.getState(device) == BluetoothHeadset.STATE_CONNECTED) { + mBluetoothHeadsetConnected = true; + } } } public void onServiceDisconnected() { - if (mBluetoothHeadset != null && - mBluetoothHeadset.getState() == BluetoothHeadset.STATE_DISCONNECTED) { - mBluetoothHeadsetConnected = false; - clearAllScoClients(); + if (mBluetoothHeadset != null) { + BluetoothDevice device = mBluetoothHeadset.getCurrentHeadset(); + if (mBluetoothHeadset.getState(device) == BluetoothHeadset.STATE_DISCONNECTED) { + mBluetoothHeadsetConnected = false; + clearAllScoClients(); + } } } }; |