summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/btservice/AdapterService.java
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-11-23 15:11:13 -0700
committerLinux Build Service Account <lnxbuild@localhost>2016-11-23 15:11:13 -0700
commitc7ae94e96c0c7bb93ec80d548c024a968c411d32 (patch)
tree8d5c989d2c31f55122ba62c65aa40e83e0188bc9 /src/com/android/bluetooth/btservice/AdapterService.java
parent45073c8d3d3188c8c0ac8edc7cec0dd80ca61e75 (diff)
parenteddf6db49910f6d679e85586e53985034f2eff52 (diff)
downloadandroid_packages_apps_Bluetooth-c7ae94e96c0c7bb93ec80d548c024a968c411d32.tar.gz
android_packages_apps_Bluetooth-c7ae94e96c0c7bb93ec80d548c024a968c411d32.tar.bz2
android_packages_apps_Bluetooth-c7ae94e96c0c7bb93ec80d548c024a968c411d32.zip
Promotion of bt.lnx.2.1-00038.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 1088801 I0c13b1608286cf81463c7e8e5363c42bdef4e176 GAP: Check prev discovery state during discovery operati 1088247 I65d658da81fdb48ba40315d8cb176b9f3427bede A2DP: Fix NPE issue while BT turning off 1086579 I766538debaec330c5694844c4b7145bc9402dc6e Serialize the RC Cleanup events in BT-App context 736029 Ie1db73c8d0ad184b3920c3d8784a56ae8ad2d75d Cancel inquiry while auto-reconnect. 1089590 Ia12a26398f47c6bcfdf7346e5f8d00f77b56349e Modified playstatus mapping and disallow sending invalid 1084325 I40667a6e8c5a2cb047a1fd081d676e654e3ee858 Opp : Check interrupted state before create socket Change-Id: I557b7ebfdad46c3e6a06574e825453937c425d23 CRs-Fixed: 1088801, 1084325, 1086579, 1088247, 736029, 1089590
Diffstat (limited to 'src/com/android/bluetooth/btservice/AdapterService.java')
-rw-r--r--src/com/android/bluetooth/btservice/AdapterService.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java
index fb7d28226..4dcca00b0 100644
--- a/src/com/android/bluetooth/btservice/AdapterService.java
+++ b/src/com/android/bluetooth/btservice/AdapterService.java
@@ -1643,7 +1643,10 @@ public class AdapterService extends Service {
Log.i(TAG,"A2dp Multicast is Ongoing, ignore discovery");
return false;
}
-
+ if (mAdapterProperties.isDiscovering()) {
+ Log.i(TAG,"discovery already active, ignore startDiscovery");
+ return false;
+ }
return startDiscoveryNative();
}
@@ -1651,6 +1654,10 @@ public class AdapterService extends Service {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH ADMIN permission");
+ if (!mAdapterProperties.isDiscovering()) {
+ Log.i(TAG,"discovery not active, ignore cancelDiscovery");
+ return false;
+ }
return cancelDiscoveryNative();
}
@@ -1800,9 +1807,10 @@ public class AdapterService extends Service {
for (BluetoothDevice device : bondedDevices) {
if (headsetClientService.getPriority(device) == BluetoothProfile.PRIORITY_AUTO_CONNECT){
- debugLog("autoConnectHeadsetClient() - Connecting Headset Client with " +
- device.toString());
- headsetClientService.connect(device);
+ cancelDiscoveryforautoConnect();
+ debugLog("autoConnectHeadsetClient() - Connecting Headset Client with " +
+ device.toString());
+ headsetClientService.connect(device);
}
}
}
@@ -1831,6 +1839,7 @@ public class AdapterService extends Service {
}
for (BluetoothDevice device : bondedDevices) {
if (pbapClientService.getPriority(device) == BluetoothProfile.PRIORITY_AUTO_CONNECT) {
+ cancelDiscoveryforautoConnect();
debugLog("autoConnectPbapClient() - Connecting PBAP Client with " +
device.toString());
pbapClientService.connect(device);
@@ -2110,9 +2119,9 @@ public class AdapterService extends Service {
case BluetoothProfile.A2DP:
A2dpService a2dpService = A2dpService.getA2dpService();
- deviceList = a2dpService.getConnectedDevices();
if ((a2dpService != null) &&
(BluetoothProfile.PRIORITY_AUTO_CONNECT != a2dpService.getPriority(device))){
+ deviceList = a2dpService.getConnectedDevices();
adjustOtherSinkPriorities(a2dpService, deviceList);
a2dpService.setPriority(device,BluetoothProfile.PRIORITY_AUTO_CONNECT);
}