summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2010-10-12 19:06:15 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-12 19:06:15 -0700
commit0d5e320cdd9cbd76012c0a1aec157e358d05891e (patch)
tree881630d6306d8f6c57e92785269b7c70ba1b71e1
parentb3c4365d10047eae367b529d98d5a90d052f6393 (diff)
parentbdf1310707e436db484113d7aa2881c966cddd0f (diff)
downloadpackages_apps_settings-0d5e320cdd9cbd76012c0a1aec157e358d05891e.zip
packages_apps_settings-0d5e320cdd9cbd76012c0a1aec157e358d05891e.tar.gz
packages_apps_settings-0d5e320cdd9cbd76012c0a1aec157e358d05891e.tar.bz2
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
-rw-r--r--src/com/android/settings/bluetooth/CachedBluetoothDevice.java29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
index 2ac648a..26bb4e8 100644
--- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
+++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
@@ -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));
+ if (profileManager.disconnect(cachedDevice.mDevice)) {
+ if (D) {
+ Log.d(TAG, "Command sent successfully:DISCONNECT " + describe(profile));
}
+ return true;
}
-
return false;
}
@@ -321,17 +314,13 @@ 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));
- }
- 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;
}