summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/map/BluetoothMapService.java
diff options
context:
space:
mode:
authorCasper Bonde <c.bonde@samsung.com>2013-10-11 15:01:04 +0200
committerZhihai Xu <zhihaixu@google.com>2013-10-11 15:26:24 -0700
commit98df3e8ff33a6137d4ea13845b583aaee2670613 (patch)
tree0550727012bb205958ef2723e414a76050aa4f9e /src/com/android/bluetooth/map/BluetoothMapService.java
parentc3cbf72f596c2af659905e06e85a5ac1241610a8 (diff)
downloadandroid_packages_apps_Bluetooth-98df3e8ff33a6137d4ea13845b583aaee2670613.tar.gz
android_packages_apps_Bluetooth-98df3e8ff33a6137d4ea13845b583aaee2670613.tar.bz2
android_packages_apps_Bluetooth-98df3e8ff33a6137d4ea13845b583aaee2670613.zip
Fix for MAP/PBAP: Race-condition when requesting authorization from Settings app
When MAP and PBAP requests authorization from the Settings app via Intents, it also sets a state isWaitingForAuthorization to indicate that it should handle incoming replies. This is however done in the code after the intent have been sent and in some cases the reply for the intent is returned before the state has been update = no handling of the reply. This only happens on the second connect with a paired device and only when the user have selected the "do not ask again" checkmark in the popup requesting access. FIX: Move the update of isWaitingAuthorization to before sending the intent to settings bug: 11179645 Change-Id: I25b019e32a01caa8509c8f97195712120823afa9
Diffstat (limited to 'src/com/android/bluetooth/map/BluetoothMapService.java')
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapService.java b/src/com/android/bluetooth/map/BluetoothMapService.java
index e1b11c8be..446a68167 100644
--- a/src/com/android/bluetooth/map/BluetoothMapService.java
+++ b/src/com/android/bluetooth/map/BluetoothMapService.java
@@ -405,8 +405,9 @@ public class BluetoothMapService extends ProfileService {
intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE,
BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS);
intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice);
- sendBroadcast(intent, BLUETOOTH_ADMIN_PERM);
+
isWaitingAuthorization = true;
+ sendBroadcast(intent, BLUETOOTH_ADMIN_PERM);
if (DEBUG) Log.d(TAG, "waiting for authorization for connection from: "
+ sRemoteDeviceName);