Merge "Truncate newline and tab characters in BluetoothDevice name" into pi-dev am: 69b1fce562

am: ead8f892a8

Change-Id: Id22889517d6779cc924988d30c57732d76797991
This commit is contained in:
android-build-team Robot
2018-04-30 12:47:17 -07:00
committed by android-build-merger

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);
}