diff options
Diffstat (limited to 'src/com/android/settings/bluetooth/BluetoothPermissionRequest.java')
-rw-r--r-- | src/com/android/settings/bluetooth/BluetoothPermissionRequest.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index e2231bb..dab03bd 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java @@ -128,8 +128,9 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { private boolean checkUserChoice() { boolean processed = false; - // we only remember PHONEBOOK permission - if (mRequestType != BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) { + // we only remember PHONEBOOK and MESSAGE permissions + if (mRequestType != BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS && + mRequestType != BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) { return processed; } @@ -143,23 +144,25 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { bluetoothManager.getProfileManager(), mDevice); } - int phonebookPermission = cachedDevice.getPhonebookPermissionChoice(); + int permission = mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS + ? cachedDevice.getMessagePermissionChoice() + : cachedDevice.getPhonebookPermissionChoice(); - if (phonebookPermission == CachedBluetoothDevice.PHONEBOOK_ACCESS_UNKNOWN) { + if (permission == CachedBluetoothDevice.PERMISSION_ACCESS_UNKNOWN) { return processed; } String intentName = BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY; - if (phonebookPermission == CachedBluetoothDevice.PHONEBOOK_ACCESS_ALLOWED) { + if (permission == CachedBluetoothDevice.PERMISSION_ACCESS_ALLOWED) { sendIntentToReceiver(intentName, true, BluetoothDevice.EXTRA_ALWAYS_ALLOWED, true); processed = true; - } else if (phonebookPermission == CachedBluetoothDevice.PHONEBOOK_ACCESS_REJECTED) { + } else if (permission == CachedBluetoothDevice.PERMISSION_ACCESS_REJECTED) { sendIntentToReceiver(intentName, false, null, false // dummy value, no effect since previous param is null ); processed = true; } else { - Log.e(TAG, "Bad phonebookPermission: " + phonebookPermission); + Log.e(TAG, "Bad permission: " + permission); } return processed; } |