diff options
author | Ashwini Munigala <AshwiniM@codeaurora.org> | 2014-10-16 09:46:37 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2014-11-04 08:26:23 -0700 |
commit | 0424f48f91bf7fe5554d7065355b641f265bb760 (patch) | |
tree | c7da8a815ad749d6608c25b8ce0c8e6a06344dc3 /src/com/android/bluetooth/map | |
parent | ffb8e16b41cb58e0bbe7238618623955a4d33b16 (diff) | |
download | android_packages_apps_Bluetooth-0424f48f91bf7fe5554d7065355b641f265bb760.tar.gz android_packages_apps_Bluetooth-0424f48f91bf7fe5554d7065355b641f265bb760.tar.bz2 android_packages_apps_Bluetooth-0424f48f91bf7fe5554d7065355b641f265bb760.zip |
MAP: Handle EXTRA_ALWAYS_ALLOWED flag and setMessageAccessPermission.
Set MessageAccessPermission sharedPreference for MAP authorization
as per EXTRA_ALWAYS_ALLOWED flag indicated in ACTION_CONNECTION_ACCESS_REPLY
from Settings authority package.
Change-Id: I9e4c5e058aa3f27898ae9be0540d19d704e22bb3
CRs-fixed: 739535
Diffstat (limited to 'src/com/android/bluetooth/map')
-rw-r--r-- | src/com/android/bluetooth/map/BluetoothMapService.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapService.java b/src/com/android/bluetooth/map/BluetoothMapService.java index 7736f6429..6d7579b3f 100644 --- a/src/com/android/bluetooth/map/BluetoothMapService.java +++ b/src/com/android/bluetooth/map/BluetoothMapService.java @@ -1046,6 +1046,12 @@ public class BluetoothMapService extends ProfileService { BluetoothDevice.CONNECTION_ACCESS_NO) == BluetoothDevice.CONNECTION_ACCESS_YES) { //bluetooth connection accepted by user + if (intent.getBooleanExtra(BluetoothDevice.EXTRA_ALWAYS_ALLOWED, false)) { + boolean result = mRemoteDevice.setMessageAccessPermission( + BluetoothDevice.ACCESS_ALLOWED); + if( DEBUG) Log.d(TAG, "setMessageAccessPermission(ACCESS_ALLOWED) result=" + + result); + } if(mIsEmailEnabled) { // todo updateEmailAccount(); @@ -1053,9 +1059,15 @@ public class BluetoothMapService extends ProfileService { if (DEBUG) Log.d(TAG, "calling initiateObexServerSession"); mConnectionManager.initiateObexServerSession(mRemoteDevice); - } else { - Log.d(TAG, "calling stopObexServerSessionWaiting"); - mConnectionManager.stopObexServerSessionWaiting(); + } else { + if (intent.getBooleanExtra(BluetoothDevice.EXTRA_ALWAYS_ALLOWED, false)) { + boolean result = mRemoteDevice.setMessageAccessPermission( + BluetoothDevice.ACCESS_REJECTED); + if(DEBUG) Log.d(TAG, "setMessageAccessPermission(ACCESS_REJECTED) result=" + +result); + } + Log.d(TAG, "calling stopObexServerSessionWaiting"); + mConnectionManager.stopObexServerSessionWaiting(); } } else if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED) && isWaitingAuthorization) { |