summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2011-01-21 18:58:17 -0800
committerJaikumar Ganesh <jaikumar@google.com>2011-01-21 19:05:54 -0800
commit40e6c210f88bfde3f5bc0faa93de0910f1a8181b (patch)
treedadac59fd1180a38e4c32f991262bb7f44e1877d /core/java/android
parent07e6f616d122496342a5bae51323bb218d88f7f2 (diff)
Do Not Merge Connect other profiles when priority is auto connect.
ACL auto connection was removed so other profiles won't auto connect when priority was auto connect. Reduced connect other profiles time delay. Bug: 3281016 Change-Id: Ic56ca6e95f618f02bc316d1f80014e58c4b6c3bc
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/bluetooth/BluetoothDeviceProfileState.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/bluetooth/BluetoothDeviceProfileState.java b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
index 954fde559695..f6d7073cb308 100644
--- a/core/java/android/bluetooth/BluetoothDeviceProfileState.java
+++ b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
@@ -75,6 +75,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine
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();
private OutgoingHandsfree mOutgoingHandsfree = new OutgoingHandsfree();
@@ -765,23 +766,26 @@ 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.getSinkPriority(mDevice) == BluetoothA2dp.PRIORITY_ON) {
+ if (mA2dpService.getSinkPriority(mDevice) == BluetoothA2dp.PRIORITY_ON ||
+ mA2dpService.getSinkPriority(mDevice) ==
+ BluetoothA2dp.PRIORITY_AUTO_CONNECT) {
Message msg = new Message();
msg.what = CONNECT_OTHER_PROFILES;
msg.arg1 = CONNECT_A2DP_OUTGOING;
- sendMessageDelayed(msg, AUTO_CONNECT_DELAY);
+ sendMessageDelayed(msg, CONNECT_OTHER_PROFILES_DELAY);
}
break;
case CONNECT_A2DP_INCOMING:
// This is again against spec. HFP incoming connections should be made
// before A2DP, so we should not hit this case. But many devices
// don't follow this.
- if (mHeadsetService.getPriority(mDevice) == BluetoothHeadset.PRIORITY_ON) {
+ if (mHeadsetService.getPriority(mDevice) == BluetoothHeadset.PRIORITY_ON
+ || mHeadsetService.getPriority(mDevice) ==
+ BluetoothHeadset.PRIORITY_AUTO_CONNECT) {
Message msg = new Message();
msg.what = CONNECT_OTHER_PROFILES;
msg.arg1 = CONNECT_HFP_OUTGOING;
- sendMessageDelayed(msg, AUTO_CONNECT_DELAY);
+ sendMessageDelayed(msg, CONNECT_OTHER_PROFILES_DELAY);
}
break;
default: