Merge "DO NOT MERGE Bluetooth: Fix formatting in getAlias()" into pi-dev

This commit is contained in:
TreeHugger Robot
2021-09-01 23:50:38 +00:00
committed by Android (Google) Code Review

View File

@@ -894,7 +894,14 @@ public final class BluetoothDevice implements Parcelable {
return null; return null;
} }
try { 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) { } catch (RemoteException e) {
Log.e(TAG, "", e); Log.e(TAG, "", e);
} }