Handle DEVICE_TYPE_STYLUS in advanced details header.
Bug: 270654477 Test: AdvancedBluetoothDetailsHeaderControllerTest Change-Id: I725dd575ba56bf86e1336094961e769b81540479
This commit is contained in:
@@ -162,6 +162,26 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
||||
.requireViewById(R.id.bt_battery_summary).getVisibility()).isEqualTo(View.GONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void refresh_connectedStylus_behaveAsExpected() {
|
||||
when(mBluetoothDevice.getMetadata(
|
||||
BluetoothDevice.METADATA_DEVICE_TYPE)).thenReturn(
|
||||
BluetoothDevice.DEVICE_TYPE_STYLUS.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