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

Commit 41e9f3c2 authored by Angela Wang's avatar Angela Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix AmbientVolumeControllerTest failed" into main

parents 44f1aa1f 3d587368
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();