summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/map/BluetoothMapMessageListingElement.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/bluetooth/map/BluetoothMapMessageListingElement.java')
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapMessageListingElement.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapMessageListingElement.java b/src/com/android/bluetooth/map/BluetoothMapMessageListingElement.java
index 88e5605de..832060e86 100644
--- a/src/com/android/bluetooth/map/BluetoothMapMessageListingElement.java
+++ b/src/com/android/bluetooth/map/BluetoothMapMessageListingElement.java
@@ -27,6 +27,7 @@ import android.util.Log;
import android.util.Xml;
import com.android.bluetooth.map.BluetoothMapUtils.TYPE;
+import com.android.bluetooth.util.Interop;
public class BluetoothMapMessageListingElement
implements Comparable<BluetoothMapMessageListingElement> {
@@ -276,9 +277,17 @@ public class BluetoothMapMessageListingElement
BluetoothMapUtils.getMapHandle(mCpHandle, mType));
if(mSubject != null){
String stripped = BluetoothMapUtils.stripInvalidChars(mSubject);
+
+ if (Interop.matchByAddress(Interop.INTEROP_MAP_ASCIIONLY,
+ BluetoothMapService.getRemoteDevice().getAddress())) {
+ stripped = stripped.replaceAll("[\\P{ASCII}&\"><]", "");
+ if (stripped.isEmpty()) stripped = "---";
+ }
+
xmlMsgElement.attribute(null, "subject",
stripped.substring(0, stripped.length() < 256 ? stripped.length() : 256));
}
+
if(mDateTime != 0)
xmlMsgElement.attribute(null, "datetime", this.getDateTimeString());
if(mSenderName != null)