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

am: 69b1fce562

Change-Id: Ib23eddfe8efeebccf6d5c9ecdb2ef7debf555aa9
This commit is contained in:
android-build-team Robot
2018-04-30 12:18:57 -07:00
committed by android-build-merger

View File

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