Merge "Sanitize Bluetooth device names without regex" am: 6bd37ba788 am: b8f0a92e0b am: 65d3f63d76 am: f0e75d8d5e am: 5c510955ee

Change-Id: I8fb1dd9863b558a4249cc087f98b1cade498509b
This commit is contained in:
Automerger Merge Worker
2020-03-01 04:23:10 +00:00

View File

@@ -1026,7 +1026,11 @@ public final class BluetoothDevice implements Parcelable {
try {
String name = service.getRemoteName(this);
if (name != null) {
return name.replaceAll("[\\t\\n\\r]+", " ");
// remove whitespace characters from the name
return name
.replace('\t', ' ')
.replace('\n', ' ')
.replace('\r', ' ');
}
return null;
} catch (RemoteException e) {