Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -206,9 +206,8 @@ public class A2dpProfileTest { when(config.isMandatoryCodec()).thenReturn(false); when(config.getCodecType()).thenReturn(4); when(config.getCodecName()).thenReturn("LDAC"); assertThat(mProfile.getHighQualityAudioOptionLabel(mDevice)).isEqualTo( String.format(KNOWN_CODEC_LABEL, config.getCodecName())); String.format(KNOWN_CODEC_LABEL, "LDAC")); } @Test Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java +13 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothUuid; import android.content.Context; import android.os.Parcel; import android.os.ParcelUuid; import org.junit.Before; Loading Loading @@ -60,9 +61,9 @@ public class CachedBluetoothDeviceManagerTest { private final static Map<Integer, ParcelUuid> CAP_GROUP2 = Map.of(2, BluetoothUuid.CAP); private final BluetoothClass DEVICE_CLASS_1 = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES); private final BluetoothClass DEVICE_CLASS_2 = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); @Mock private LocalBluetoothProfileManager mLocalProfileManager; @Mock Loading Loading @@ -92,6 +93,16 @@ public class CachedBluetoothDeviceManagerTest { private HearingAidDeviceManager mHearingAidDeviceManager; private Context mContext; private BluetoothClass createBtClass(int deviceClass) { Parcel p = Parcel.obtain(); p.writeInt(deviceClass); p.setDataPosition(0); // reset position of parcel before passing to constructor BluetoothClass bluetoothClass = BluetoothClass.CREATOR.createFromParcel(p); p.recycle(); return bluetoothClass; } @Before public void setUp() { MockitoAnnotations.initMocks(this); Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/HearingAidDeviceManagerTest.java +12 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHearingAid; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.os.Parcel; import org.junit.Before; import org.junit.Test; Loading @@ -48,7 +49,7 @@ public class HearingAidDeviceManagerTest { private final static String DEVICE_ADDRESS_1 = "AA:BB:CC:DD:EE:11"; private final static String DEVICE_ADDRESS_2 = "AA:BB:CC:DD:EE:22"; private final BluetoothClass DEVICE_CLASS = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); @Mock private LocalBluetoothProfileManager mLocalProfileManager; @Mock Loading @@ -67,6 +68,16 @@ public class HearingAidDeviceManagerTest { private HearingAidDeviceManager mHearingAidDeviceManager; private Context mContext; private BluetoothClass createBtClass(int deviceClass) { Parcel p = Parcel.obtain(); p.writeInt(deviceClass); p.setDataPosition(0); // reset position of parcel before passing to constructor BluetoothClass bluetoothClass = BluetoothClass.CREATOR.createFromParcel(p); p.recycle(); return bluetoothClass; } @Before public void setUp() { MockitoAnnotations.initMocks(this); Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaDeviceTest.java +13 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.bluetooth.BluetoothDevice; import android.content.Context; import android.media.MediaRoute2Info; import android.media.MediaRouter2Manager; import android.os.Parcel; import com.android.settingslib.bluetooth.A2dpProfile; import com.android.settingslib.bluetooth.CachedBluetoothDevice; Loading Loading @@ -65,9 +66,9 @@ public class MediaDeviceTest { private static final String ROUTER_ID_3 = "RouterId_3"; private static final String TEST_PACKAGE_NAME = "com.test.playmusic"; private final BluetoothClass mHeadreeClass = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES); private final BluetoothClass mCarkitClass = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_CAR_AUDIO); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_CAR_AUDIO); @Mock private BluetoothDevice mDevice1; Loading Loading @@ -118,6 +119,16 @@ public class MediaDeviceTest { private List<MediaDevice> mMediaDevices = new ArrayList<>(); private PhoneMediaDevice mPhoneMediaDevice; private BluetoothClass createBtClass(int deviceClass) { Parcel p = Parcel.obtain(); p.writeInt(deviceClass); p.setDataPosition(0); // reset position of parcel before passing to constructor BluetoothClass bluetoothClass = BluetoothClass.CREATOR.createFromParcel(p); p.recycle(); return bluetoothClass; } @Before public void setUp() { MockitoAnnotations.initMocks(this); Loading Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -206,9 +206,8 @@ public class A2dpProfileTest { when(config.isMandatoryCodec()).thenReturn(false); when(config.getCodecType()).thenReturn(4); when(config.getCodecName()).thenReturn("LDAC"); assertThat(mProfile.getHighQualityAudioOptionLabel(mDevice)).isEqualTo( String.format(KNOWN_CODEC_LABEL, config.getCodecName())); String.format(KNOWN_CODEC_LABEL, "LDAC")); } @Test Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java +13 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothUuid; import android.content.Context; import android.os.Parcel; import android.os.ParcelUuid; import org.junit.Before; Loading Loading @@ -60,9 +61,9 @@ public class CachedBluetoothDeviceManagerTest { private final static Map<Integer, ParcelUuid> CAP_GROUP2 = Map.of(2, BluetoothUuid.CAP); private final BluetoothClass DEVICE_CLASS_1 = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES); private final BluetoothClass DEVICE_CLASS_2 = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); @Mock private LocalBluetoothProfileManager mLocalProfileManager; @Mock Loading Loading @@ -92,6 +93,16 @@ public class CachedBluetoothDeviceManagerTest { private HearingAidDeviceManager mHearingAidDeviceManager; private Context mContext; private BluetoothClass createBtClass(int deviceClass) { Parcel p = Parcel.obtain(); p.writeInt(deviceClass); p.setDataPosition(0); // reset position of parcel before passing to constructor BluetoothClass bluetoothClass = BluetoothClass.CREATOR.createFromParcel(p); p.recycle(); return bluetoothClass; } @Before public void setUp() { MockitoAnnotations.initMocks(this); Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/HearingAidDeviceManagerTest.java +12 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHearingAid; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.os.Parcel; import org.junit.Before; import org.junit.Test; Loading @@ -48,7 +49,7 @@ public class HearingAidDeviceManagerTest { private final static String DEVICE_ADDRESS_1 = "AA:BB:CC:DD:EE:11"; private final static String DEVICE_ADDRESS_2 = "AA:BB:CC:DD:EE:22"; private final BluetoothClass DEVICE_CLASS = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); @Mock private LocalBluetoothProfileManager mLocalProfileManager; @Mock Loading @@ -67,6 +68,16 @@ public class HearingAidDeviceManagerTest { private HearingAidDeviceManager mHearingAidDeviceManager; private Context mContext; private BluetoothClass createBtClass(int deviceClass) { Parcel p = Parcel.obtain(); p.writeInt(deviceClass); p.setDataPosition(0); // reset position of parcel before passing to constructor BluetoothClass bluetoothClass = BluetoothClass.CREATOR.createFromParcel(p); p.recycle(); return bluetoothClass; } @Before public void setUp() { MockitoAnnotations.initMocks(this); Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaDeviceTest.java +13 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.bluetooth.BluetoothDevice; import android.content.Context; import android.media.MediaRoute2Info; import android.media.MediaRouter2Manager; import android.os.Parcel; import com.android.settingslib.bluetooth.A2dpProfile; import com.android.settingslib.bluetooth.CachedBluetoothDevice; Loading Loading @@ -65,9 +66,9 @@ public class MediaDeviceTest { private static final String ROUTER_ID_3 = "RouterId_3"; private static final String TEST_PACKAGE_NAME = "com.test.playmusic"; private final BluetoothClass mHeadreeClass = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES); private final BluetoothClass mCarkitClass = new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_CAR_AUDIO); createBtClass(BluetoothClass.Device.AUDIO_VIDEO_CAR_AUDIO); @Mock private BluetoothDevice mDevice1; Loading Loading @@ -118,6 +119,16 @@ public class MediaDeviceTest { private List<MediaDevice> mMediaDevices = new ArrayList<>(); private PhoneMediaDevice mPhoneMediaDevice; private BluetoothClass createBtClass(int deviceClass) { Parcel p = Parcel.obtain(); p.writeInt(deviceClass); p.setDataPosition(0); // reset position of parcel before passing to constructor BluetoothClass bluetoothClass = BluetoothClass.CREATOR.createFromParcel(p); p.recycle(); return bluetoothClass; } @Before public void setUp() { MockitoAnnotations.initMocks(this); Loading