Loading packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/domain/SpatialAudioAvailabilityCriteriaTest.kt +11 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.volume.panel.component.spatial.domain import android.bluetooth.BluetoothDevice import android.bluetooth.BluetoothProfile import android.media.AudioDeviceAttributes import android.media.AudioDeviceInfo import android.media.session.MediaSession Loading @@ -24,12 +26,14 @@ import android.testing.TestableLooper.RunWithLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.settingslib.bluetooth.CachedBluetoothDevice import com.android.settingslib.bluetooth.LeAudioProfile import com.android.settingslib.media.BluetoothMediaDevice import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.kosmos.testScope import com.android.systemui.media.spatializerRepository import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.mock import com.android.systemui.util.mockito.whenever import com.android.systemui.volume.localMediaController Loading @@ -56,8 +60,15 @@ class SpatialAudioAvailabilityCriteriaTest : SysuiTestCase() { @Before fun setup() { with(kosmos) { val leAudioProfile = mock<LeAudioProfile> { whenever(profileId).thenReturn(BluetoothProfile.LE_AUDIO) whenever(isEnabled(any())).thenReturn(true) } val cachedBluetoothDevice: CachedBluetoothDevice = mock { whenever(address).thenReturn("test_address") whenever(profiles).thenReturn(listOf(leAudioProfile)) whenever(device).thenReturn(mock<BluetoothDevice> {}) } localMediaRepository.updateCurrentConnectedDevice( mock<BluetoothMediaDevice> { Loading packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractorTest.kt +5 −1 Original line number Diff line number Diff line Loading @@ -65,16 +65,20 @@ class SpatialAudioComponentInteractorTest : SysuiTestCase() { private val kosmos = testKosmos() private lateinit var underTest: SpatialAudioComponentInteractor private val bluetoothDevice: BluetoothDevice = mock {} private val a2dpProfile: A2dpProfile = mock { whenever(profileId).thenReturn(BluetoothProfile.A2DP) whenever(isEnabled(bluetoothDevice)).thenReturn(false) } private val leAudioProfile: LeAudioProfile = mock { whenever(profileId).thenReturn(BluetoothProfile.LE_AUDIO) whenever(isEnabled(bluetoothDevice)).thenReturn(true) } private val hearingAidProfile: HearingAidProfile = mock { whenever(profileId).thenReturn(BluetoothProfile.HEARING_AID) whenever(isEnabled(bluetoothDevice)).thenReturn(false) } private val bluetoothDevice: BluetoothDevice = mock {} @Before fun setup() { Loading packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/TestMediaDevicesFactory.kt +8 −0 Original line number Diff line number Diff line Loading @@ -18,9 +18,11 @@ package com.android.systemui.volume.panel.component.mediaoutput.domain.interacto import android.annotation.SuppressLint import android.bluetooth.BluetoothDevice import android.bluetooth.BluetoothProfile import android.graphics.drawable.Drawable import android.graphics.drawable.TestStubDrawable import com.android.settingslib.bluetooth.CachedBluetoothDevice import com.android.settingslib.bluetooth.LeAudioProfile import com.android.settingslib.media.BluetoothMediaDevice import com.android.settingslib.media.MediaDevice import com.android.settingslib.media.PhoneMediaDevice Loading Loading @@ -59,11 +61,17 @@ object TestMediaDevicesFactory { whenever(name).thenReturn(deviceName) whenever(address).thenReturn(deviceAddress) } val leAudioProfile = mock<LeAudioProfile> { whenever(profileId).thenReturn(BluetoothProfile.LE_AUDIO) whenever(isEnabled(bluetoothDevice)).thenReturn(true) } val cachedBluetoothDevice: CachedBluetoothDevice = mock { whenever(isHearingAidDevice).thenReturn(true) whenever(address).thenReturn(deviceAddress) whenever(device).thenReturn(bluetoothDevice) whenever(name).thenReturn(deviceName) whenever(profiles).thenReturn(listOf(leAudioProfile)) } return mock<BluetoothMediaDevice> { whenever(name).thenReturn(deviceName) Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/domain/SpatialAudioAvailabilityCriteriaTest.kt +11 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.volume.panel.component.spatial.domain import android.bluetooth.BluetoothDevice import android.bluetooth.BluetoothProfile import android.media.AudioDeviceAttributes import android.media.AudioDeviceInfo import android.media.session.MediaSession Loading @@ -24,12 +26,14 @@ import android.testing.TestableLooper.RunWithLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.settingslib.bluetooth.CachedBluetoothDevice import com.android.settingslib.bluetooth.LeAudioProfile import com.android.settingslib.media.BluetoothMediaDevice import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.kosmos.testScope import com.android.systemui.media.spatializerRepository import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.mock import com.android.systemui.util.mockito.whenever import com.android.systemui.volume.localMediaController Loading @@ -56,8 +60,15 @@ class SpatialAudioAvailabilityCriteriaTest : SysuiTestCase() { @Before fun setup() { with(kosmos) { val leAudioProfile = mock<LeAudioProfile> { whenever(profileId).thenReturn(BluetoothProfile.LE_AUDIO) whenever(isEnabled(any())).thenReturn(true) } val cachedBluetoothDevice: CachedBluetoothDevice = mock { whenever(address).thenReturn("test_address") whenever(profiles).thenReturn(listOf(leAudioProfile)) whenever(device).thenReturn(mock<BluetoothDevice> {}) } localMediaRepository.updateCurrentConnectedDevice( mock<BluetoothMediaDevice> { Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractorTest.kt +5 −1 Original line number Diff line number Diff line Loading @@ -65,16 +65,20 @@ class SpatialAudioComponentInteractorTest : SysuiTestCase() { private val kosmos = testKosmos() private lateinit var underTest: SpatialAudioComponentInteractor private val bluetoothDevice: BluetoothDevice = mock {} private val a2dpProfile: A2dpProfile = mock { whenever(profileId).thenReturn(BluetoothProfile.A2DP) whenever(isEnabled(bluetoothDevice)).thenReturn(false) } private val leAudioProfile: LeAudioProfile = mock { whenever(profileId).thenReturn(BluetoothProfile.LE_AUDIO) whenever(isEnabled(bluetoothDevice)).thenReturn(true) } private val hearingAidProfile: HearingAidProfile = mock { whenever(profileId).thenReturn(BluetoothProfile.HEARING_AID) whenever(isEnabled(bluetoothDevice)).thenReturn(false) } private val bluetoothDevice: BluetoothDevice = mock {} @Before fun setup() { Loading
packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/TestMediaDevicesFactory.kt +8 −0 Original line number Diff line number Diff line Loading @@ -18,9 +18,11 @@ package com.android.systemui.volume.panel.component.mediaoutput.domain.interacto import android.annotation.SuppressLint import android.bluetooth.BluetoothDevice import android.bluetooth.BluetoothProfile import android.graphics.drawable.Drawable import android.graphics.drawable.TestStubDrawable import com.android.settingslib.bluetooth.CachedBluetoothDevice import com.android.settingslib.bluetooth.LeAudioProfile import com.android.settingslib.media.BluetoothMediaDevice import com.android.settingslib.media.MediaDevice import com.android.settingslib.media.PhoneMediaDevice Loading Loading @@ -59,11 +61,17 @@ object TestMediaDevicesFactory { whenever(name).thenReturn(deviceName) whenever(address).thenReturn(deviceAddress) } val leAudioProfile = mock<LeAudioProfile> { whenever(profileId).thenReturn(BluetoothProfile.LE_AUDIO) whenever(isEnabled(bluetoothDevice)).thenReturn(true) } val cachedBluetoothDevice: CachedBluetoothDevice = mock { whenever(isHearingAidDevice).thenReturn(true) whenever(address).thenReturn(deviceAddress) whenever(device).thenReturn(bluetoothDevice) whenever(name).thenReturn(deviceName) whenever(profiles).thenReturn(listOf(leAudioProfile)) } return mock<BluetoothMediaDevice> { whenever(name).thenReturn(deviceName) Loading