summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2011-01-21 21:29:23 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-21 21:29:23 -0800
commitf34cd026c163a5f6e52dff9fac08582576cca9f5 (patch)
tree8969e7a9f326779cac938d2af5c4e0af3b418ef1 /core
parent6ec457c32ebfa1a93e1b02f8aaf120b2561f9d0d (diff)
parent153ab0eb5357b1cf0ccd27d125bb349018c8d571 (diff)
downloadframeworks_base-f34cd026c163a5f6e52dff9fac08582576cca9f5.zip
frameworks_base-f34cd026c163a5f6e52dff9fac08582576cca9f5.tar.gz
frameworks_base-f34cd026c163a5f6e52dff9fac08582576cca9f5.tar.bz2
am 153ab0eb: am 8db58ea5: Merge "Connect other profiles when priority is auto connect." into honeycomb
* commit '153ab0eb5357b1cf0ccd27d125bb349018c8d571': Connect other profiles when priority is auto connect.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/bluetooth/BluetoothDeviceProfileState.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/bluetooth/BluetoothDeviceProfileState.java b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
index 3280d39..6ec347f 100644
--- a/core/java/android/bluetooth/BluetoothDeviceProfileState.java
+++ b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
@@ -82,6 +82,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine
public static final int TRANSITION_TO_STABLE = 102;
public static final int CONNECT_OTHER_PROFILES = 103;
+ private static final int AUTO_CONNECT_DELAY = 6000; // 6 secs
private static final int CONNECT_OTHER_PROFILES_DELAY = 4000; // 4 secs
private BondedDevice mBondedDevice = new BondedDevice();
@@ -1010,8 +1011,9 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine
case CONNECT_HFP_INCOMING:
// Connect A2DP if there is no incoming connection
// If the priority is OFF - don't auto connect.
- // If the priority is AUTO_CONNECT, auto connect code takes care.
- if (mA2dpService.getPriority(mDevice) == BluetoothProfile.PRIORITY_ON) {
+ if (mA2dpService.getPriority(mDevice) == BluetoothProfile.PRIORITY_ON ||
+ mA2dpService.getPriority(mDevice) ==
+ BluetoothProfile.PRIORITY_AUTO_CONNECT) {
Message msg = new Message();
msg.what = CONNECT_OTHER_PROFILES;
msg.arg1 = CONNECT_A2DP_OUTGOING;
@@ -1023,7 +1025,9 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine
// before A2DP, so we should not hit this case. But many devices
// don't follow this.
if (mHeadsetService != null &&
- mHeadsetService.getPriority(mDevice) == BluetoothProfile.PRIORITY_ON) {
+ (mHeadsetService.getPriority(mDevice) == BluetoothProfile.PRIORITY_ON ||
+ mHeadsetService.getPriority(mDevice) ==
+ BluetoothProfile.PRIORITY_AUTO_CONNECT)) {
Message msg = new Message();
msg.what = CONNECT_OTHER_PROFILES;
msg.arg1 = CONNECT_HFP_OUTGOING;