diff options
author | Seven Shen <lingtongshen@gmail.com> | 2016-05-03 14:57:48 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@cyngn.com> | 2016-06-07 15:38:40 -0700 |
commit | 49da2a86b7cd6993498e233932c7c19d4e94eccf (patch) | |
tree | 66569b56067cf748a751682f9ce304dd77a9930a | |
parent | 65bb6f285417a80c1e0599c5e40865349dbaab0a (diff) | |
download | android_packages_apps_Bluetooth-49da2a86b7cd6993498e233932c7c19d4e94eccf.tar.gz android_packages_apps_Bluetooth-49da2a86b7cd6993498e233932c7c19d4e94eccf.tar.bz2 android_packages_apps_Bluetooth-49da2a86b7cd6993498e233932c7c19d4e94eccf.zip |
[PATCH] "DO NOT MERGE" Add write SMS protection
Ticket: CYNGNOS-2707
Bug: 25138326
Change-Id: I9f418370b8725d49e3734406b6f435107bcff021
(cherry picked from commit 64745b114948ea0c774f74af5721b6283087247d)
-rw-r--r-- | src/com/android/bluetooth/map/BluetoothMapService.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapService.java b/src/com/android/bluetooth/map/BluetoothMapService.java index 8cf69f601..db388eafc 100644 --- a/src/com/android/bluetooth/map/BluetoothMapService.java +++ b/src/com/android/bluetooth/map/BluetoothMapService.java @@ -29,6 +29,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.IntentFilter.MalformedMimeTypeException; +import android.Manifest; import android.os.Handler; import android.os.Message; import android.os.ParcelUuid; @@ -599,7 +600,10 @@ public class BluetoothMapService extends ProfileService { try { registerReceiver(mMapReceiver, filter); - registerReceiver(mMapReceiver, filterMessageSent); + // We need WRITE_SMS permission to handle messages in + // actionMessageSentDisconnected() + registerReceiver(mMapReceiver, filterMessageSent, + Manifest.permission.WRITE_SMS, null); } catch (Exception e) { Log.w(TAG,"Unable to register map receiver",e); } @@ -1051,8 +1055,12 @@ public class BluetoothMapService extends ProfileService { { /* We do not have a connection to a device, hence we need to move the SMS to the correct folder. */ - BluetoothMapContentObserver + try { + BluetoothMapContentObserver .actionMessageSentDisconnected(context, intent, result); + } catch(IllegalArgumentException e) { + return; + } } } else if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED) && mIsWaitingAuthorization) { |