summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-05-09 16:05:35 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-06-13 16:29:30 -0700
commit15e2d38086db1419c3072a509e02ca62a6446825 (patch)
treeb817578797e0b5dbbad80b3dc95acd917b14667d
parenta31010be7c230fb298131803e4e3a20f9d4b4441 (diff)
downloadandroid_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)
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapContentObserver.java2
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapService.java5
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);
}