Merge "Sanitize Bluetooth device names without regex" am: 6bd37ba788 am: b8f0a92e0b
Change-Id: I044fa2a33359b90724e68f89b1762e0e2b3b196a
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user