DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name

Test: manual
Bug: 73173182
Change-Id: I3c25af233742e63351a68e8c5a279b51a94e49e2
This commit is contained in:
Hansong Zhang
2018-04-26 14:13:45 -07:00
parent 42f4ac8e42
commit b6cde9ecc1

View File

@@ -727,7 +727,11 @@ public final class BluetoothDevice implements Parcelable {
return null;
}
try {
return sService.getRemoteName(this);
String name = sService.getRemoteName(this);
if (name != null) {
return name.replaceAll("[\\t\\n\\r]+", " ");
}
return null;
} catch (RemoteException e) {Log.e(TAG, "", e);}
return null;
}