DEVICE_TYPE_STYLUS should support AdvancedDetailsHeader.

Bug: 251200056
Test: BluetoothUtilsTest
Change-Id: I714ecbcc12acd58d71e973bffe126e1dd275a0b7
This commit is contained in:
Vania Januar
2022-12-20 10:48:40 +00:00
parent 9e5f119429
commit face5ff497
2 changed files with 11 additions and 1 deletions

View File

@@ -260,7 +260,8 @@ public class BluetoothUtils {
BluetoothDevice.METADATA_DEVICE_TYPE);
if (TextUtils.equals(deviceType, BluetoothDevice.DEVICE_TYPE_UNTETHERED_HEADSET)
|| TextUtils.equals(deviceType, BluetoothDevice.DEVICE_TYPE_WATCH)
|| TextUtils.equals(deviceType, BluetoothDevice.DEVICE_TYPE_DEFAULT)) {
|| TextUtils.equals(deviceType, BluetoothDevice.DEVICE_TYPE_DEFAULT)
|| TextUtils.equals(deviceType, BluetoothDevice.DEVICE_TYPE_STYLUS)) {
Log.d(TAG, "isAdvancedDetailsHeader: deviceType is " + deviceType);
return true;
}

View File

@@ -192,6 +192,15 @@ public class BluetoothUtilsTest {
assertThat(BluetoothUtils.isAdvancedDetailsHeader(mBluetoothDevice)).isEqualTo(true);
}
@Test
public void isAdvancedDetailsHeader_deviceTypeStylus_returnTrue() {
when(mBluetoothDevice.getMetadata(
BluetoothDevice.METADATA_DEVICE_TYPE)).thenReturn(
BluetoothDevice.DEVICE_TYPE_STYLUS.getBytes());
assertThat(BluetoothUtils.isAdvancedDetailsHeader(mBluetoothDevice)).isEqualTo(true);
}
@Test
public void isAdvancedDetailsHeader_deviceTypeDefault_returnTrue() {
when(mBluetoothDevice.getMetadata(