Merge "Return profile state disconnected when not yet bound to service." into honeycomb-mr1
diff --git a/src/com/android/settings/bluetooth/HeadsetProfile.java b/src/com/android/settings/bluetooth/HeadsetProfile.java
index dac47b7..e9c52ef 100644
--- a/src/com/android/settings/bluetooth/HeadsetProfile.java
+++ b/src/com/android/settings/bluetooth/HeadsetProfile.java
@@ -133,6 +133,8 @@
}
public int getConnectionStatus(BluetoothDevice device) {
+ if (mService == null) return BluetoothProfile.STATE_DISCONNECTED;
+
List<BluetoothDevice> deviceList = mService.getConnectedDevices();
return !deviceList.isEmpty() && deviceList.get(0).equals(device)