Merge change Ie7e8a7ef into eclair

* changes:
  Don't auto-connect to OPP after pairing
This commit is contained in:
Android (Google) Code Review
2009-10-01 10:46:26 -04:00

View File

@@ -396,13 +396,15 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
int preferredProfiles = 0; int preferredProfiles = 0;
for (Profile profile : mProfiles) { for (Profile profile : mProfiles) {
LocalBluetoothProfileManager profileManager = if (isConnectableProfile(profile)) {
LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile); LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager
.getProfileManager(mLocalManager, profile);
if (profileManager.isPreferred(mDevice)) { if (profileManager.isPreferred(mDevice)) {
++preferredProfiles; ++preferredProfiles;
queueCommand(new BluetoothJob(BluetoothCommand.CONNECT, this, profile)); queueCommand(new BluetoothJob(BluetoothCommand.CONNECT, this, profile));
} }
} }
}
if (DEBUG) Log.d(TAG, "Preferred profiles = " + preferredProfiles); if (DEBUG) Log.d(TAG, "Preferred profiles = " + preferredProfiles);
if (preferredProfiles == 0) { if (preferredProfiles == 0) {
@@ -417,12 +419,14 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
mIsConnectingErrorPossible = true; mIsConnectingErrorPossible = true;
for (Profile profile : mProfiles) { for (Profile profile : mProfiles) {
LocalBluetoothProfileManager profileManager = if (isConnectableProfile(profile)) {
LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile); LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager
.getProfileManager(mLocalManager, profile);
profileManager.setPreferred(mDevice, false); profileManager.setPreferred(mDevice, false);
queueCommand(new BluetoothJob(BluetoothCommand.CONNECT, this, profile)); queueCommand(new BluetoothJob(BluetoothCommand.CONNECT, this, profile));
} }
} }
}
public void connect(Profile profile) { public void connect(Profile profile) {
mConnectAttempted = SystemClock.elapsedRealtime(); mConnectAttempted = SystemClock.elapsedRealtime();