Merge "Truncate newline and tab characters in BluetoothDevice name" into pi-dev

This commit is contained in:
android-build-team Robot
2018-04-30 18:54:34 +00:00
committed by Android (Google) Code Review

View File

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