Refactor usages of getAliasName to use getAlias in Settings

Bug: 142352567
Test: Manual
Change-Id: I40af1b1e0453900fd888317ae46b20ef359db473
This commit is contained in:
Rahul Sabnis
2019-10-22 15:34:40 -07:00
parent a67ca4cfd7
commit c96469f2bd
5 changed files with 7 additions and 7 deletions

View File

@@ -141,7 +141,7 @@ public final class BluetoothPairingService extends Service {
String name = intent.getStringExtra(BluetoothDevice.EXTRA_NAME); String name = intent.getStringExtra(BluetoothDevice.EXTRA_NAME);
if (TextUtils.isEmpty(name)) { if (TextUtils.isEmpty(name)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
name = device != null ? device.getAliasName() : res.getString(android.R.string.unknownName); name = device != null ? device.getAlias() : res.getString(android.R.string.unknownName);
} }
Log.d(TAG, "Show pairing notification for " + mDevice.getAddress() + " (" + name + ")"); Log.d(TAG, "Show pairing notification for " + mDevice.getAddress() + " (" + name + ")");

View File

@@ -125,7 +125,7 @@ public final class Utils {
} }
public static String createRemoteName(Context context, BluetoothDevice device) { public static String createRemoteName(Context context, BluetoothDevice device) {
String mRemoteName = device != null ? device.getAliasName() : null; String mRemoteName = device != null ? device.getAlias() : null;
if (mRemoteName == null) { if (mRemoteName == null) {
mRemoteName = context.getString(R.string.unknown); mRemoteName = context.getString(R.string.unknown);

View File

@@ -149,14 +149,14 @@ public class MediaOutputIndicatorSlice implements CustomSliceable {
// Return Hearing Aid device name if it is active // Return Hearing Aid device name if it is active
BluetoothDevice activeDevice = findActiveHearingAidDevice(); BluetoothDevice activeDevice = findActiveHearingAidDevice();
if (activeDevice != null) { if (activeDevice != null) {
return activeDevice.getAliasName(); return activeDevice.getAlias();
} }
// Return A2DP device name if it is active // Return A2DP device name if it is active
final A2dpProfile a2dpProfile = mProfileManager.getA2dpProfile(); final A2dpProfile a2dpProfile = mProfileManager.getA2dpProfile();
if (a2dpProfile != null) { if (a2dpProfile != null) {
activeDevice = a2dpProfile.getActiveDevice(); activeDevice = a2dpProfile.getActiveDevice();
if (activeDevice != null) { if (activeDevice != null) {
return activeDevice.getAliasName(); return activeDevice.getAlias();
} }
} }
// No active device, return default summary // No active device, return default summary

View File

@@ -66,7 +66,7 @@ public class HandsFreeProfileOutputPreferenceController extends AudioSwitchPrefe
final BluetoothDevice btDevice = mConnectedDevices.get(connectedDeviceIndex); final BluetoothDevice btDevice = mConnectedDevices.get(connectedDeviceIndex);
mSelectedIndex = connectedDeviceIndex; mSelectedIndex = connectedDeviceIndex;
setActiveBluetoothDevice(btDevice); setActiveBluetoothDevice(btDevice);
listPreference.setSummary(btDevice.getAliasName()); listPreference.setSummary(btDevice.getAlias());
} }
return true; return true;
} }
@@ -143,7 +143,7 @@ public class HandsFreeProfileOutputPreferenceController extends AudioSwitchPrefe
mediaValues[mSelectedIndex] = defaultSummary; mediaValues[mSelectedIndex] = defaultSummary;
for (int i = 0, size = mConnectedDevices.size(); i < size; i++) { for (int i = 0, size = mConnectedDevices.size(); i < size; i++) {
final BluetoothDevice btDevice = mConnectedDevices.get(i); final BluetoothDevice btDevice = mConnectedDevices.get(i);
mediaOutputs[i] = btDevice.getAliasName(); mediaOutputs[i] = btDevice.getAlias();
mediaValues[i] = btDevice.getAddress(); mediaValues[i] = btDevice.getAddress();
if (btDevice.equals(activeDevice)) { if (btDevice.equals(activeDevice)) {
// select the active connected device. // select the active connected device.

View File

@@ -76,7 +76,7 @@ public class MediaOutputPreferenceController extends AudioSwitchPreferenceContro
mPreference.setVisible(deviceConnected); mPreference.setVisible(deviceConnected);
mPreference.setSummary((activeDevice == null) ? mPreference.setSummary((activeDevice == null) ?
mContext.getText(R.string.media_output_default_summary) : mContext.getText(R.string.media_output_default_summary) :
activeDevice.getAliasName()); activeDevice.getAlias());
} }
@Override @Override