From b547dda338f1b135076c8be59c50a12d843cebf8 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Wed, 30 Sep 2009 23:08:19 -0700 Subject: [PATCH] Don't auto-connect to OPP after pairing Change-Id: Ie7e8a7ef7188f7ffa6b32595764c100a0d72be89 --- .../bluetooth/CachedBluetoothDevice.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java index 380c484cabb..25c7f14bc4a 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java @@ -396,11 +396,13 @@ public class CachedBluetoothDevice implements Comparable int preferredProfiles = 0; for (Profile profile : mProfiles) { - LocalBluetoothProfileManager profileManager = - LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile); - if (profileManager.isPreferred(mDevice)) { - ++preferredProfiles; - queueCommand(new BluetoothJob(BluetoothCommand.CONNECT, this, profile)); + if (isConnectableProfile(profile)) { + LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager + .getProfileManager(mLocalManager, profile); + if (profileManager.isPreferred(mDevice)) { + ++preferredProfiles; + queueCommand(new BluetoothJob(BluetoothCommand.CONNECT, this, profile)); + } } } if (DEBUG) Log.d(TAG, "Preferred profiles = " + preferredProfiles); @@ -417,10 +419,12 @@ public class CachedBluetoothDevice implements Comparable mIsConnectingErrorPossible = true; for (Profile profile : mProfiles) { - LocalBluetoothProfileManager profileManager = - LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile); - profileManager.setPreferred(mDevice, false); - queueCommand(new BluetoothJob(BluetoothCommand.CONNECT, this, profile)); + if (isConnectableProfile(profile)) { + LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager + .getProfileManager(mLocalManager, profile); + profileManager.setPreferred(mDevice, false); + queueCommand(new BluetoothJob(BluetoothCommand.CONNECT, this, profile)); + } } }