Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d587368 authored by Angela Wang's avatar Angela Wang
Browse files

Fix AmbientVolumeControllerTest failed

Flag: EXEMPT bugfix
Bug: 397874606
Test: atest AmbientVolumeControllerTest
Change-Id: Idf9139e16193c76362a261c92b5b9cc6131feb96
parent a4ce9e92
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static org.mockito.Mockito.when;

import android.bluetooth.AudioInputControl;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.Context;

import androidx.test.core.app.ApplicationProvider;
@@ -67,6 +68,9 @@ public class AmbientVolumeControllerTest {
    @Before
    public void setUp() {
        when(mProfileManager.getVolumeControlProfile()).thenReturn(mVolumeControlProfile);
        when(mVolumeControlProfile.isProfileReady()).thenReturn(true);
        when(mVolumeControlProfile.getConnectionStatus(mDevice)).thenReturn(
                BluetoothProfile.STATE_CONNECTED);
        when(mDevice.getAddress()).thenReturn(TEST_ADDRESS);
        when(mDevice.isConnected()).thenReturn(true);
        mVolumeController = new AmbientVolumeController(mProfileManager, mCallback);
@@ -74,8 +78,6 @@ public class AmbientVolumeControllerTest {

    @Test
    public void onServiceConnected_notifyCallback() {
        when(mVolumeControlProfile.isProfileReady()).thenReturn(true);

        mVolumeController.onServiceConnected();

        verify(mCallback).onVolumeControlServiceConnected();