Show identity address in the bluetooth details page
Bug: 197044261 Test: build pass Change-Id: Ic1ef1d575f35c4b37d6f9195ec10dd31ed5bdd5b
This commit is contained in:
committed by
Chienyuan Huang
parent
0ccb8750b9
commit
84a9b23ba8
@@ -46,21 +46,22 @@ public class BluetoothDetailsMacAddressController extends BluetoothDetailsContro
|
|||||||
protected void init(PreferenceScreen screen) {
|
protected void init(PreferenceScreen screen) {
|
||||||
mFooterPreference = screen.findPreference(KEY_DEVICE_DETAILS_FOOTER);
|
mFooterPreference = screen.findPreference(KEY_DEVICE_DETAILS_FOOTER);
|
||||||
mFooterPreference.setTitle(mContext.getString(
|
mFooterPreference.setTitle(mContext.getString(
|
||||||
R.string.bluetooth_device_mac_address, mCachedDevice.getAddress()));
|
R.string.bluetooth_device_mac_address, mCachedDevice.getIdentityAddress()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void refresh() {
|
protected void refresh() {
|
||||||
if (mCachedDevice.getGroupId() != BluetoothCsipSetCoordinator.GROUP_ID_INVALID) {
|
if (mCachedDevice.getGroupId() != BluetoothCsipSetCoordinator.GROUP_ID_INVALID) {
|
||||||
StringBuilder title = new StringBuilder(mContext.getString(
|
StringBuilder title = new StringBuilder(mContext.getString(
|
||||||
R.string.bluetooth_multuple_devices_mac_address, mCachedDevice.getAddress()));
|
R.string.bluetooth_multuple_devices_mac_address,
|
||||||
|
mCachedDevice.getIdentityAddress()));
|
||||||
for (CachedBluetoothDevice member: mCachedDevice.getMemberDevice()) {
|
for (CachedBluetoothDevice member: mCachedDevice.getMemberDevice()) {
|
||||||
title.append("\n").append(member.getAddress());
|
title.append("\n").append(member.getIdentityAddress());
|
||||||
}
|
}
|
||||||
mFooterPreference.setTitle(title);
|
mFooterPreference.setTitle(title);
|
||||||
} else {
|
} else {
|
||||||
mFooterPreference.setTitle(mContext.getString(
|
mFooterPreference.setTitle(mContext.getString(
|
||||||
R.string.bluetooth_device_mac_address, mCachedDevice.getAddress()));
|
R.string.bluetooth_device_mac_address, mCachedDevice.getIdentityAddress()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -99,6 +99,7 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
|||||||
mController.mBluetoothAdapter = mBluetoothAdapter;
|
mController.mBluetoothAdapter = mBluetoothAdapter;
|
||||||
when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice);
|
when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice);
|
||||||
when(mCachedDevice.getAddress()).thenReturn(MAC_ADDRESS);
|
when(mCachedDevice.getAddress()).thenReturn(MAC_ADDRESS);
|
||||||
|
when(mCachedDevice.getIdentityAddress()).thenReturn(MAC_ADDRESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -155,6 +155,7 @@ public abstract class BluetoothDetailsControllerTestBase {
|
|||||||
mDevice = mBluetoothAdapter.getRemoteDevice(config.getAddress());
|
mDevice = mBluetoothAdapter.getRemoteDevice(config.getAddress());
|
||||||
when(mCachedDevice.getDevice()).thenReturn(mDevice);
|
when(mCachedDevice.getDevice()).thenReturn(mDevice);
|
||||||
when(mCachedDevice.getAddress()).thenReturn(config.getAddress());
|
when(mCachedDevice.getAddress()).thenReturn(config.getAddress());
|
||||||
|
when(mCachedDevice.getIdentityAddress()).thenReturn(config.getAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -89,6 +89,7 @@ public class BluetoothDeviceDetailsFragmentTest {
|
|||||||
when(fragmentManager.beginTransaction()).thenReturn(mFragmentTransaction);
|
when(fragmentManager.beginTransaction()).thenReturn(mFragmentTransaction);
|
||||||
|
|
||||||
when(mCachedDevice.getAddress()).thenReturn(TEST_ADDRESS);
|
when(mCachedDevice.getAddress()).thenReturn(TEST_ADDRESS);
|
||||||
|
when(mCachedDevice.getIdentityAddress()).thenReturn(TEST_ADDRESS);
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString(BluetoothDeviceDetailsFragment.KEY_DEVICE_ADDRESS, TEST_ADDRESS);
|
args.putString(BluetoothDeviceDetailsFragment.KEY_DEVICE_ADDRESS, TEST_ADDRESS);
|
||||||
mFragment.setArguments(args);
|
mFragment.setArguments(args);
|
||||||
|
@@ -305,6 +305,7 @@ public class BluetoothPairingDetailTest {
|
|||||||
when(cachedDevice.isConnected()).thenReturn(true);
|
when(cachedDevice.isConnected()).thenReturn(true);
|
||||||
when(cachedDevice.getDevice()).thenReturn(device2);
|
when(cachedDevice.getDevice()).thenReturn(device2);
|
||||||
when(cachedDevice.getAddress()).thenReturn(TEST_DEVICE_ADDRESS_B);
|
when(cachedDevice.getAddress()).thenReturn(TEST_DEVICE_ADDRESS_B);
|
||||||
|
when(cachedDevice.getIdentityAddress()).thenReturn(TEST_DEVICE_ADDRESS_B);
|
||||||
|
|
||||||
mFragment.onProfileConnectionStateChanged(cachedDevice, BluetoothProfile.A2DP,
|
mFragment.onProfileConnectionStateChanged(cachedDevice, BluetoothProfile.A2DP,
|
||||||
BluetoothAdapter.STATE_CONNECTED);
|
BluetoothAdapter.STATE_CONNECTED);
|
||||||
|
@@ -73,6 +73,7 @@ public class ForgetDeviceDialogFragmentTest {
|
|||||||
FakeFeatureFactory.setupForTest();
|
FakeFeatureFactory.setupForTest();
|
||||||
String deviceAddress = "55:66:77:88:99:AA";
|
String deviceAddress = "55:66:77:88:99:AA";
|
||||||
when(mCachedDevice.getAddress()).thenReturn(deviceAddress);
|
when(mCachedDevice.getAddress()).thenReturn(deviceAddress);
|
||||||
|
when(mCachedDevice.getIdentityAddress()).thenReturn(deviceAddress);
|
||||||
when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice);
|
when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice);
|
||||||
when(mCachedDevice.getName()).thenReturn(DEVICE_NAME);
|
when(mCachedDevice.getName()).thenReturn(DEVICE_NAME);
|
||||||
mFragment = spy(ForgetDeviceDialogFragment.newInstance(deviceAddress));
|
mFragment = spy(ForgetDeviceDialogFragment.newInstance(deviceAddress));
|
||||||
|
@@ -62,6 +62,7 @@ public class RemoteDeviceNameDialogFragmentTest {
|
|||||||
|
|
||||||
String deviceAddress = "55:66:77:88:99:AA";
|
String deviceAddress = "55:66:77:88:99:AA";
|
||||||
when(mCachedDevice.getAddress()).thenReturn(deviceAddress);
|
when(mCachedDevice.getAddress()).thenReturn(deviceAddress);
|
||||||
|
when(mCachedDevice.getIdentityAddress()).thenReturn(deviceAddress);
|
||||||
mFragment = spy(RemoteDeviceNameDialogFragment.newInstance(mCachedDevice));
|
mFragment = spy(RemoteDeviceNameDialogFragment.newInstance(mCachedDevice));
|
||||||
doReturn(mCachedDevice).when(mFragment).getDevice(any());
|
doReturn(mCachedDevice).when(mFragment).getDevice(any());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user