Merge "Sanitize Bluetooth device names without regex"
This commit is contained in:
@@ -1025,7 +1025,11 @@ public final class BluetoothDevice implements Parcelable {
|
|||||||
try {
|
try {
|
||||||
String name = service.getRemoteName(this);
|
String name = service.getRemoteName(this);
|
||||||
if (name != null) {
|
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;
|
return null;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user