Merge "Return profile state disconnected when not yet bound to service." into honeycomb-mr1

This commit is contained in:
Jaikumar Ganesh
2011-03-08 19:40:12 -08:00
committed by Android (Google) Code Review

View File

@@ -133,6 +133,8 @@ final class HeadsetProfile implements LocalBluetoothProfile {
} }
public int getConnectionStatus(BluetoothDevice device) { public int getConnectionStatus(BluetoothDevice device) {
if (mService == null) return BluetoothProfile.STATE_DISCONNECTED;
List<BluetoothDevice> deviceList = mService.getConnectedDevices(); List<BluetoothDevice> deviceList = mService.getConnectedDevices();
return !deviceList.isEmpty() && deviceList.get(0).equals(device) return !deviceList.isEmpty() && deviceList.get(0).equals(device)