Headset connection status is displayed incorrectly, as the boolean mIsProfileReady is not initalized properly. Make sure mIsProfileReady is initialized always when onServiceConnected is received

Change-Id: I968ce6900121a6140256b3181c792d421bdb7cf6
This commit is contained in:
Ravi Nagarajan
2012-05-22 18:08:48 +05:30
committed by Matthew Xie
parent afedeacd57
commit d1889ed4bd

View File

@@ -65,10 +65,7 @@ final class HeadsetProfile implements LocalBluetoothProfile {
// We just bound to the service, so refresh the UI of the
// headset device.
List<BluetoothDevice> deviceList = mService.getConnectedDevices();
if (deviceList.isEmpty()) {
mProfileManager.setHfServiceUp(true);
return;
}
if (!deviceList.isEmpty()) {
BluetoothDevice firstDevice = deviceList.get(0);
CachedBluetoothDevice device = mDeviceManager.findDevice(firstDevice);
// we may add a new device here, but generally this should not happen
@@ -78,6 +75,7 @@ final class HeadsetProfile implements LocalBluetoothProfile {
}
device.onProfileStateChanged(HeadsetProfile.this,
BluetoothProfile.STATE_CONNECTED);
}
mProfileManager.callServiceConnectedListeners();
mProfileManager.setHfServiceUp(true);