Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccfb52f8 authored by Hemant Gupta's avatar Hemant Gupta
Browse files

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
parent 7baac155
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;