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

Commit bc7cbb62 authored by Smriti Gupta's avatar Smriti Gupta Committed by Linux Build Service Account
Browse files

PBAP: Handle EXTRA_ALWAYS_ALLOWED flag and setPhonebookPermission.

Set PhonebookAccessPermission sharedPreference for PBAP authorization
as per EXTRA_ALWAYS_ALLOWED flag indicated in ACTION_CONNECTION_ACCESS_REPLY
from Settings authority package.

CRs-fixed: 748993
Change-Id: If2783636a8282e6b4135715b0b01cf17bae20cb6
parent 6209d01d
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -292,6 +292,16 @@ public class BluetoothPbapService extends Service {
            if (intent.getIntExtra(BluetoothDevice.EXTRA_CONNECTION_ACCESS_RESULT,
                                   BluetoothDevice.CONNECTION_ACCESS_NO) ==
                BluetoothDevice.CONNECTION_ACCESS_YES) {

                if (intent.getBooleanExtra(BluetoothDevice.EXTRA_ALWAYS_ALLOWED, false)) {
                    boolean result = mRemoteDevice.setPhonebookAccessPermission(
                            BluetoothDevice.ACCESS_ALLOWED);
                    if (VERBOSE) {
                        Log.v(TAG, "setPhonebookAccessPermission(ACCESS_ALLOWED) result="
                                + result);
                    }
                }

                try {
                    if (mConnSocket != null) {
                        startObexServerSession();