am 022299df: Merge "Disconnect dock only if its connected." into gingerbread

Merge commit '022299dfce6a705a8cbaff972a4309da6e90a8c2' into gingerbread-plus-aosp

* commit '022299dfce6a705a8cbaff972a4309da6e90a8c2':
  Disconnect dock only if its connected.
This commit is contained in:
Jaikumar Ganesh
2010-10-14 15:33:42 -07:00
committed by Android Git Automerger

View File

@@ -718,9 +718,12 @@ public class DockService extends Service implements AlertDialog.OnMultiChoiceCli
// Checked but not connected
callConnect = true;
} else if (!mCheckedItems[i]) {
// Unchecked but connected
if (DEBUG) Log.d(TAG, "applyBtSettings - Disconnecting");
cachedDevice.disconnect(mProfiles[i]);
// Unchecked, may or may not be connected.
int status = profileManager.getConnectionStatus(cachedDevice.getDevice());
if (SettingsBtStatus.isConnectionStatusConnected(status)) {
if (DEBUG) Log.d(TAG, "applyBtSettings - Disconnecting");
cachedDevice.disconnect(mProfiles[i]);
}
}
profileManager.setPreferred(device, mCheckedItems[i]);
if (DEBUG) {