From: Jaikumar Ganesh Date: Sat, 16 Oct 2010 15:52:36 +0000 (-0700) Subject: am 7805fa99: am 022299df: Merge "Disconnect dock only if its connected." into gingerbread X-Git-Tag: android-x86-4.4-r1~2983 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=cf7ef7cbd6f0165f21d779628dc61485820c305f;hp=d8fff3dc924c0d84be591776389f011f42fd270d;p=android-x86%2Fpackages-apps-Settings.git am 7805fa99: am 022299df: Merge "Disconnect dock only if its connected." into gingerbread Merge commit '7805fa99ffce21bb9b016ffdd5375d331b9a8a54' * commit '7805fa99ffce21bb9b016ffdd5375d331b9a8a54': Disconnect dock only if its connected. --- diff --git a/src/com/android/settings/bluetooth/DockService.java b/src/com/android/settings/bluetooth/DockService.java index 47d4076d8b..e817e78725 100644 --- a/src/com/android/settings/bluetooth/DockService.java +++ b/src/com/android/settings/bluetooth/DockService.java @@ -719,9 +719,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) {