commit | 3bdad2df2e34c948bde80a51ae232c46848dab06 | [log] [tgz] |
---|---|---|
author | Hansong Zhang <hsz@google.com> | Wed Aug 18 16:35:00 2021 -0700 |
committer | Hansong Zhang <hsz@google.com> | Wed Sep 01 21:19:06 2021 +0000 |
tree | bf39abb9162344042683838fdddfc8251cf87d09 | |
parent | b0fccf4d9d0bea39b9ad2d7163a65677d6d03cee [diff] |
DO NOT MERGE Bluetooth: Fix formatting in getAlias() Bug: 180747689 Test: manual Change-Id: Ic309f4aad116fd424d5d0d0e2016d61be8826b78
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 3cf8074..8916b53 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -894,7 +894,14 @@ return null; } try { - return service.getRemoteAlias(this); + String alias = service.getRemoteAlias(this); + if (alias == null) { + return getName(); + } + return alias + .replace('\t', ' ') + .replace('\n', ' ') + .replace('\r', ' '); } catch (RemoteException e) { Log.e(TAG, "", e); }