Merge "DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name" into oc-dev

This commit is contained in:
android-build-team Robot
2018-05-04 00:47:48 +00:00
committed by Android (Google) Code Review

View File

@@ -780,7 +780,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;
}