am bdf13107: Merge "Call disconnect / connect without checking the current status" into gingerbread

Merge commit 'bdf1310707e436db484113d7aa2881c966cddd0f' into gingerbread-plus-aosp

* commit 'bdf1310707e436db484113d7aa2881c966cddd0f':
  Call disconnect / connect without checking the current status
This commit is contained in:
Jaikumar Ganesh
2010-10-12 19:06:15 -07:00
committed by Android Git Automerger

View File

@@ -165,19 +165,12 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
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));
}
}
return false;
}
@@ -321,7 +314,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
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));
@@ -329,9 +321,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
return true;
}
Log.i(TAG, "Failed to connect " + profile.toString() + " to " + cachedDevice.mName);
} else {
Log.i(TAG, "Already connected");
}
return false;
}