diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java index c917dbc9d94..7805e14a73c 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java @@ -168,19 +168,12 @@ public class CachedBluetoothDevice implements Comparable LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile); int status = profileManager.getConnectionStatus(cachedDevice.mDevice); - if (SettingsBtStatus.isConnectionStatusConnected(status)) { - if (profileManager.disconnect(cachedDevice.mDevice)) { - if (D) { - Log.d(TAG, "Command sent successfully:DISCONNECT " + describe(profile)); - } - return true; - } - if (V) { - Log.v(TAG, "Framework rejected command immediately:DISCONNECT " + - describe(profile)); + if (profileManager.disconnect(cachedDevice.mDevice)) { + if (D) { + Log.d(TAG, "Command sent successfully:DISCONNECT " + describe(profile)); } + return true; } - return false; } @@ -324,17 +317,13 @@ public class CachedBluetoothDevice implements Comparable LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile); int status = profileManager.getConnectionStatus(cachedDevice.mDevice); - if (!SettingsBtStatus.isConnectionStatusConnected(status)) { - if (profileManager.connect(cachedDevice.mDevice)) { - if (D) { - Log.d(TAG, "Command sent successfully:CONNECT " + describe(profile)); - } - return true; + if (profileManager.connect(cachedDevice.mDevice)) { + if (D) { + Log.d(TAG, "Command sent successfully:CONNECT " + describe(profile)); } - Log.i(TAG, "Failed to connect " + profile.toString() + " to " + cachedDevice.mName); - } else { - Log.i(TAG, "Already connected"); + return true; } + Log.i(TAG, "Failed to connect " + profile.toString() + " to " + cachedDevice.mName); return false; }