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

Commit 4b4a5c7e authored by Joseph Pirozzo's avatar Joseph Pirozzo
Browse files

Headset Client Profile AudioManager test

Headset Client tests were failing due to a null audioManager, this fixes
the test to get the correct mocked AudioManager.

Bug: 80261005
Test: runtest bluetooth -c com.android.bluetooth.hfpclient.HeadsetClientStateMachineTest
Change-Id: I547a33fc5f9555e91f5e1dadbab7b6543b047c11
parent 9f863115
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -929,7 +929,7 @@ public class HeadsetClientService extends ProfileService {
        mSmFactory = factory;
    }

    AudioManager getAudioManager() {
    protected AudioManager getAudioManager() {
        return mAudioManager;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public class HeadsetClientStateMachineTest {
        when(mAudioManager.getStreamVolume(anyInt())).thenReturn(2);
        when(mAudioManager.getStreamMaxVolume(anyInt())).thenReturn(10);
        when(mAudioManager.getStreamMinVolume(anyInt())).thenReturn(1);
        when(mHeadsetClientService.getSystemService(Context.AUDIO_SERVICE)).thenReturn(
        when(mHeadsetClientService.getAudioManager()).thenReturn(
                mAudioManager);
        when(mHeadsetClientService.getResources()).thenReturn(mMockHfpResources);
        when(mMockHfpResources.getBoolean(R.bool.hfp_clcc_poll_during_call)).thenReturn(true);