b/2318290 connect should be called instead of connect(profile) if device is unpaired.

Change-Id: I5d665d1c3149ffc77387f96c3822e80b84c78de1
This commit is contained in:
Michael Chan
2009-12-10 14:53:35 -08:00
parent c0a606d2d6
commit d8eec52a37

View File

@@ -459,19 +459,19 @@ public class DockService extends Service implements AlertDialog.OnMultiChoiceCli
mPendingDevice = null;
boolean callConnect = false;
CachedBluetoothDevice cachedDevice = getCachedBluetoothDevice(mContext, mBtManager,
device);
for (int i = 0; i < mProfiles.length; i++) {
LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager
.getProfileManager(mBtManager, mProfiles[i]);
boolean isConnected = profileManager.isConnected(device);
CachedBluetoothDevice cachedDevice = getCachedBluetoothDevice(mContext, mBtManager,
device);
if (DEBUG) Log.d(TAG, mProfiles[i].toString() + " = " + mCheckedItems[i]);
if (mCheckedItems[i] && !isConnected) {
// Checked but not connected
if (DEBUG) Log.d(TAG, "applyBtSettings - Connecting");
cachedDevice.connect(mProfiles[i]);
callConnect = true;
} else if (!mCheckedItems[i] && isConnected) {
// Unchecked but connected
if (DEBUG) Log.d(TAG, "applyBtSettings - Disconnecting");
@@ -484,6 +484,11 @@ public class DockService extends Service implements AlertDialog.OnMultiChoiceCli
}
}
}
if (callConnect) {
if (DEBUG) Log.d(TAG, "applyBtSettings - Connecting");
cachedDevice.connect();
}
}
void handleUndocked(Context context, LocalBluetoothManager localManager,