Show single icon layout for unknown device type in advanced header.
Bug: 270654477 Test: AdvancedBluetoothDetailsHeaderControllerTest Change-Id: I24a42693a66664caa460d44245a68e3606e98481
This commit is contained in:
@@ -182,6 +182,26 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
||||
View.VISIBLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void refresh_connectedUnknownType_behaveAsExpected() {
|
||||
when(mBluetoothDevice.getMetadata(
|
||||
BluetoothDevice.METADATA_DEVICE_TYPE)).thenReturn(
|
||||
"UNKNOWN_TYPE".getBytes());
|
||||
when(mBluetoothDevice.getMetadata(
|
||||
BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET)).thenReturn(
|
||||
String.valueOf(false).getBytes());
|
||||
when(mCachedDevice.isConnected()).thenReturn(true);
|
||||
|
||||
mController.refresh();
|
||||
|
||||
assertThat(mLayoutPreference.findViewById(R.id.layout_left).getVisibility()).isEqualTo(
|
||||
View.GONE);
|
||||
assertThat(mLayoutPreference.findViewById(R.id.layout_right).getVisibility()).isEqualTo(
|
||||
View.GONE);
|
||||
assertThat(mLayoutPreference.findViewById(R.id.layout_middle).getVisibility()).isEqualTo(
|
||||
View.VISIBLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void refresh_connectedUntetheredHeadset_behaveAsExpected() {
|
||||
when(mBluetoothDevice.getMetadata(
|
||||
|
Reference in New Issue
Block a user