am 8984d144: am a8c2514e: Merge "Pass BluetoothDevice to the Bluetooth Headset calls." into kraken

This commit is contained in:
Jaikumar Ganesh
2010-06-07 14:13:19 -07:00
committed by Android Git Automerger
5 changed files with 19 additions and 15 deletions

View File

@@ -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();
}
}
}
};