Use same fallback bt name in Settings and notification.
Bug: 30126659 Change-Id: Id1432b459a4368bae9af6067307c4da0008f94aa
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.bluetooth;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.BluetoothProfile;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -126,6 +127,15 @@ public final class Utils {
|
||||
return LocalBluetoothManager.getInstance(context, mOnInitCallback);
|
||||
}
|
||||
|
||||
public static String createRemoteName(Context context, BluetoothDevice device) {
|
||||
String mRemoteName = device != null ? device.getAliasName() : null;
|
||||
|
||||
if (mRemoteName == null) {
|
||||
mRemoteName = context.getString(R.string.unknown);
|
||||
}
|
||||
return mRemoteName;
|
||||
}
|
||||
|
||||
private static final ErrorListener mErrorListener = new ErrorListener() {
|
||||
@Override
|
||||
public void onShowError(Context context, String name, int messageResId) {
|
||||
|
Reference in New Issue
Block a user