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

Commit 47ce9220 authored by Joseph Pirozzo's avatar Joseph Pirozzo Committed by android-build-merger
Browse files

Merge "Mock HFPClient Test Resources" am: 28f90b2f am: 032a4d73

am: ad036e8a

Change-Id: Iebe6e70a524ea913d0bf661fcc1bc93ff69f9af2
parents 5e8bbf11 ad036e8a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -11,12 +11,15 @@ import android.bluetooth.BluetoothHeadsetClientCall;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.media.AudioManager;
import android.os.HandlerThread;
import android.support.test.espresso.intent.matcher.IntentMatchers;
import android.support.test.filters.MediumTest;
import android.support.test.runner.AndroidJUnit4;

import com.android.bluetooth.R;

import org.hamcrest.core.AllOf;
import org.hamcrest.core.IsInstanceOf;
import org.junit.After;
@@ -37,6 +40,8 @@ public class HeadsetClientStateMachineTest {
    private HeadsetClientStateMachine mHeadsetClientStateMachine;
    private BluetoothDevice mTestDevice;

    @Mock
    private Resources mMockHfpResources;
    @Mock
    private HeadsetClientService mHeadsetClientService;
    @Mock
@@ -52,6 +57,9 @@ public class HeadsetClientStateMachineTest {
        when(mAudioManager.getStreamMinVolume(anyInt())).thenReturn(1);
        when(mHeadsetClientService.getSystemService(Context.AUDIO_SERVICE)).thenReturn(
                mAudioManager);
        when(mHeadsetClientService.getResources()).thenReturn(mMockHfpResources);
        when(mMockHfpResources.getBoolean(R.bool.hfp_clcc_poll_during_call)).thenReturn(true);

        // This line must be called to make sure relevant objects are initialized properly
        mAdapter = BluetoothAdapter.getDefaultAdapter();
        // Get a device for testing