Loading android/app/src/com/android/bluetooth/DeviceWorkArounds.java +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ public final class DeviceWorkArounds { public static final String HONDA_CARKIT = "64:D4:BD"; public static final String SYNC_CARKIT = "D0:39:72"; public static final String BREZZA_ZDI_CARKIT = "28:a1:83"; public static final String MERCEDES_BENZ_CARKIT = "00:26:e8"; /** * @hide Loading android/app/src/com/android/bluetooth/map/BluetoothMapMessageListing.java +19 −4 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ package com.android.bluetooth.map; import android.util.Log; import android.util.Xml; import com.android.bluetooth.DeviceWorkArounds; import com.android.internal.util.FastXmlSerializer; Loading Loading @@ -90,11 +91,25 @@ public class BluetoothMapMessageListing { public byte[] encode(boolean includeThreadId, String version) throws UnsupportedEncodingException { StringWriter sw = new StringWriter(); XmlSerializer xmlMsgElement = new FastXmlSerializer(); XmlSerializer xmlMsgElement = null; boolean isBenzCarkit = DeviceWorkArounds.addressStartsWith( BluetoothMapService.getRemoteDevice().getAddress(), DeviceWorkArounds.MERCEDES_BENZ_CARKIT); try { if (isBenzCarkit) { Log.d(TAG, "java_interop: Remote is Mercedes Benz, " + "using Xml Workaround."); xmlMsgElement = Xml.newSerializer(); xmlMsgElement.setOutput(sw); xmlMsgElement.text("\n"); } else { xmlMsgElement = new FastXmlSerializer(); xmlMsgElement.setOutput(sw); xmlMsgElement.startDocument("UTF-8", true); xmlMsgElement.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true); xmlMsgElement.text("\n"); xmlMsgElement.setFeature( "http://xmlpull.org/v1/doc/features.html#indent-output", true); } xmlMsgElement.startTag(null, "MAP-msg-listing"); xmlMsgElement.attribute(null, "version", version); // Do the XML encoding of list Loading android/app/src/com/android/bluetooth/map/BluetoothMapMessageListingElement.java +4 −3 Original line number Diff line number Diff line Loading @@ -14,8 +14,8 @@ */ package com.android.bluetooth.map; import com.android.bluetooth.DeviceWorkArounds; import com.android.bluetooth.map.BluetoothMapUtils.TYPE; import com.android.bluetooth.util.Interop; import org.xmlpull.v1.XmlSerializer; Loading Loading @@ -274,8 +274,9 @@ public class BluetoothMapMessageListingElement if (mSubject != null) { String stripped = BluetoothMapUtils.stripInvalidChars(mSubject); if (Interop.matchByAddress(Interop.INTEROP_MAP_ASCIIONLY, BluetoothMapService.getRemoteDevice().getAddress())) { if (DeviceWorkArounds.addressStartsWith(BluetoothMapService .getRemoteDevice().getAddress(), DeviceWorkArounds .MERCEDES_BENZ_CARKIT)) { stripped = stripped.replaceAll("[\\P{ASCII}&\"><]", ""); if (stripped.isEmpty()) { stripped = "---"; Loading Loading
android/app/src/com/android/bluetooth/DeviceWorkArounds.java +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ public final class DeviceWorkArounds { public static final String HONDA_CARKIT = "64:D4:BD"; public static final String SYNC_CARKIT = "D0:39:72"; public static final String BREZZA_ZDI_CARKIT = "28:a1:83"; public static final String MERCEDES_BENZ_CARKIT = "00:26:e8"; /** * @hide Loading
android/app/src/com/android/bluetooth/map/BluetoothMapMessageListing.java +19 −4 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ package com.android.bluetooth.map; import android.util.Log; import android.util.Xml; import com.android.bluetooth.DeviceWorkArounds; import com.android.internal.util.FastXmlSerializer; Loading Loading @@ -90,11 +91,25 @@ public class BluetoothMapMessageListing { public byte[] encode(boolean includeThreadId, String version) throws UnsupportedEncodingException { StringWriter sw = new StringWriter(); XmlSerializer xmlMsgElement = new FastXmlSerializer(); XmlSerializer xmlMsgElement = null; boolean isBenzCarkit = DeviceWorkArounds.addressStartsWith( BluetoothMapService.getRemoteDevice().getAddress(), DeviceWorkArounds.MERCEDES_BENZ_CARKIT); try { if (isBenzCarkit) { Log.d(TAG, "java_interop: Remote is Mercedes Benz, " + "using Xml Workaround."); xmlMsgElement = Xml.newSerializer(); xmlMsgElement.setOutput(sw); xmlMsgElement.text("\n"); } else { xmlMsgElement = new FastXmlSerializer(); xmlMsgElement.setOutput(sw); xmlMsgElement.startDocument("UTF-8", true); xmlMsgElement.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true); xmlMsgElement.text("\n"); xmlMsgElement.setFeature( "http://xmlpull.org/v1/doc/features.html#indent-output", true); } xmlMsgElement.startTag(null, "MAP-msg-listing"); xmlMsgElement.attribute(null, "version", version); // Do the XML encoding of list Loading
android/app/src/com/android/bluetooth/map/BluetoothMapMessageListingElement.java +4 −3 Original line number Diff line number Diff line Loading @@ -14,8 +14,8 @@ */ package com.android.bluetooth.map; import com.android.bluetooth.DeviceWorkArounds; import com.android.bluetooth.map.BluetoothMapUtils.TYPE; import com.android.bluetooth.util.Interop; import org.xmlpull.v1.XmlSerializer; Loading Loading @@ -274,8 +274,9 @@ public class BluetoothMapMessageListingElement if (mSubject != null) { String stripped = BluetoothMapUtils.stripInvalidChars(mSubject); if (Interop.matchByAddress(Interop.INTEROP_MAP_ASCIIONLY, BluetoothMapService.getRemoteDevice().getAddress())) { if (DeviceWorkArounds.addressStartsWith(BluetoothMapService .getRemoteDevice().getAddress(), DeviceWorkArounds .MERCEDES_BENZ_CARKIT)) { stripped = stripped.replaceAll("[\\P{ASCII}&\"><]", ""); if (stripped.isEmpty()) { stripped = "---"; Loading