summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHemant Gupta <hemantg@codeaurora.org>2014-12-22 12:59:23 +0530
committerArne Coucheron <arco68@gmail.com>2015-01-22 00:51:30 +0100
commit35c6e72e87a4866c628b53f810d31904d9bf66d6 (patch)
treecd2947b680ce7901d3df2b95887a01bf54a81bbd
parentc2519f460b58bb3099597ae506c7f84ebd8f4cfb (diff)
downloadandroid_packages_apps_Bluetooth-35c6e72e87a4866c628b53f810d31904d9bf66d6.tar.gz
android_packages_apps_Bluetooth-35c6e72e87a4866c628b53f810d31904d9bf66d6.tar.bz2
android_packages_apps_Bluetooth-35c6e72e87a4866c628b53f810d31904d9bf66d6.zip
MAP: Broadcast intent with FLAG_RECEIVER_FOREGROUND parameter
This patch adds FLAG_RECEIVER_FOREGROUND parameter before broadcasting intent so that intent is not delayed and can be received by settings app on time, thereby preventing connection failure for MAP Change-Id: I2a748316eda900aa9a30b84fa4ec233bb8612a33 CRs-Fixed: 771048
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapService.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapService.java b/src/com/android/bluetooth/map/BluetoothMapService.java
index 7582766b1..73963b48d 100644
--- a/src/com/android/bluetooth/map/BluetoothMapService.java
+++ b/src/com/android/bluetooth/map/BluetoothMapService.java
@@ -246,6 +246,7 @@ public class BluetoothMapService extends ProfileService {
intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice);
intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE,
BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS);
+ intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
sendBroadcast(intent, BLUETOOTH_PERM);
isWaitingAuthorization = false;
removeTimeoutMsg = false;
@@ -967,6 +968,7 @@ public class BluetoothMapService extends ProfileService {
intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE,
BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS);
intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice);
+ intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
sendBroadcast(intent, BLUETOOTH_ADMIN_PERM);
if (DEBUG) Log.d(TAG, "waiting for authorization for connection from: "
@@ -1014,6 +1016,7 @@ public class BluetoothMapService extends ProfileService {
timeoutIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice);
timeoutIntent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE,
BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS);
+ intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
sendBroadcast(timeoutIntent, BLUETOOTH_PERM);
isWaitingAuthorization = false;
removeTimeoutMsg = false;
@@ -1091,6 +1094,7 @@ public class BluetoothMapService extends ProfileService {
timeoutIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice);
timeoutIntent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE,
BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS);
+ intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
sendBroadcast(timeoutIntent, BLUETOOTH_PERM);
isWaitingAuthorization = false;
removeTimeoutMsg = false;