diff options
author | Jessica Wagantall <jwagantall@cyngn.com> | 2016-05-09 16:05:35 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@cyngn.com> | 2016-06-13 16:29:30 -0700 |
commit | 15e2d38086db1419c3072a509e02ca62a6446825 (patch) | |
tree | b817578797e0b5dbbad80b3dc95acd917b14667d /src | |
parent | a31010be7c230fb298131803e4e3a20f9d4b4441 (diff) | |
download | android_packages_apps_Bluetooth-15e2d38086db1419c3072a509e02ca62a6446825.tar.gz android_packages_apps_Bluetooth-15e2d38086db1419c3072a509e02ca62a6446825.tar.bz2 android_packages_apps_Bluetooth-15e2d38086db1419c3072a509e02ca62a6446825.zip |
"DO NOT MERGE" Add write SMS protection
Bug: 25138326
Ticket: CYNGNOS-2707
Change-Id: I494db57e9291fac108e2abae85db367992ad81a1
(cherry picked from commit fd7a794fc57e06606244b9fc1673c9c549cce5c4)
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/bluetooth/map/BluetoothMapContentObserver.java | 2 | ||||
-rw-r--r-- | src/com/android/bluetooth/map/BluetoothMapService.java | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapContentObserver.java b/src/com/android/bluetooth/map/BluetoothMapContentObserver.java index d768ebb76..1981eac26 100644 --- a/src/com/android/bluetooth/map/BluetoothMapContentObserver.java +++ b/src/com/android/bluetooth/map/BluetoothMapContentObserver.java @@ -1176,7 +1176,7 @@ public class BluetoothMapContentObserver { Log.e(TAG, "Wrong mime type!!!", e); } - mContext.registerReceiver(this, intentFilter, null, handler); + mContext.registerReceiver(this, intentFilter, Manifest.permission.WRITE_SMS, handler); } public void unregister() { diff --git a/src/com/android/bluetooth/map/BluetoothMapService.java b/src/com/android/bluetooth/map/BluetoothMapService.java index d7d6a6178..cb0a0b55f 100644 --- a/src/com/android/bluetooth/map/BluetoothMapService.java +++ b/src/com/android/bluetooth/map/BluetoothMapService.java @@ -38,6 +38,7 @@ import android.bluetooth.BluetoothMap; import android.bluetooth.BluetoothSocket; import android.content.Context; import android.content.Intent; +import android.Manifest; import android.os.Handler; import android.os.Message; import android.os.PowerManager; @@ -425,6 +426,10 @@ public class BluetoothMapService extends ProfileService { filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED); try { registerReceiver(mMapReceiver, filter); + // 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); } |