am 0d5e320c
: am bdf13107
: Merge "Call disconnect / connect without checking the current status" into gingerbread
Merge commit '0d5e320cdd9cbd76012c0a1aec157e358d05891e' * commit '0d5e320cdd9cbd76012c0a1aec157e358d05891e': Call disconnect / connect without checking the current status
This commit is contained in:
@@ -168,19 +168,12 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
|
|||||||
LocalBluetoothProfileManager profileManager =
|
LocalBluetoothProfileManager profileManager =
|
||||||
LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile);
|
LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile);
|
||||||
int status = profileManager.getConnectionStatus(cachedDevice.mDevice);
|
int status = profileManager.getConnectionStatus(cachedDevice.mDevice);
|
||||||
if (SettingsBtStatus.isConnectionStatusConnected(status)) {
|
if (profileManager.disconnect(cachedDevice.mDevice)) {
|
||||||
if (profileManager.disconnect(cachedDevice.mDevice)) {
|
if (D) {
|
||||||
if (D) {
|
Log.d(TAG, "Command sent successfully:DISCONNECT " + describe(profile));
|
||||||
Log.d(TAG, "Command sent successfully:DISCONNECT " + describe(profile));
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (V) {
|
|
||||||
Log.v(TAG, "Framework rejected command immediately:DISCONNECT " +
|
|
||||||
describe(profile));
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,17 +317,13 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
|
|||||||
LocalBluetoothProfileManager profileManager =
|
LocalBluetoothProfileManager profileManager =
|
||||||
LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile);
|
LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile);
|
||||||
int status = profileManager.getConnectionStatus(cachedDevice.mDevice);
|
int status = profileManager.getConnectionStatus(cachedDevice.mDevice);
|
||||||
if (!SettingsBtStatus.isConnectionStatusConnected(status)) {
|
if (profileManager.connect(cachedDevice.mDevice)) {
|
||||||
if (profileManager.connect(cachedDevice.mDevice)) {
|
if (D) {
|
||||||
if (D) {
|
Log.d(TAG, "Command sent successfully:CONNECT " + describe(profile));
|
||||||
Log.d(TAG, "Command sent successfully:CONNECT " + describe(profile));
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
Log.i(TAG, "Failed to connect " + profile.toString() + " to " + cachedDevice.mName);
|
return true;
|
||||||
} else {
|
|
||||||
Log.i(TAG, "Already connected");
|
|
||||||
}
|
}
|
||||||
|
Log.i(TAG, "Failed to connect " + profile.toString() + " to " + cachedDevice.mName);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user