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

Commit 599fe05a authored by Sal Savage's avatar Sal Savage
Browse files

Add more profile native interfaces

This allows the test to succeed on devices using A2DP Sink, AVRCP
Controller, and HFP Client

Bug: 366622623
Flag: EXEMPT, test only change
Test: atest com.android.bluetooth.btservice.ProfileServiceTest
Change-Id: If9a4f957d99f0a51e5f39c4d6f25ca54c4e0872e
parent 65713855
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -33,11 +33,14 @@ import androidx.test.runner.AndroidJUnit4;

import com.android.bluetooth.TestUtils;
import com.android.bluetooth.a2dp.A2dpNativeInterface;
import com.android.bluetooth.a2dpsink.A2dpSinkNativeInterface;
import com.android.bluetooth.avrcp.AvrcpNativeInterface;
import com.android.bluetooth.avrcpcontroller.AvrcpControllerNativeInterface;
import com.android.bluetooth.btservice.storage.DatabaseManager;
import com.android.bluetooth.csip.CsipSetCoordinatorNativeInterface;
import com.android.bluetooth.hearingaid.HearingAidNativeInterface;
import com.android.bluetooth.hfp.HeadsetNativeInterface;
import com.android.bluetooth.hfpclient.NativeInterface;
import com.android.bluetooth.hid.HidDeviceNativeInterface;
import com.android.bluetooth.hid.HidHostNativeInterface;
import com.android.bluetooth.le_audio.LeAudioNativeInterface;
@@ -80,8 +83,11 @@ public class ProfileServiceTest {
    private int[] mProfiles;

    @Mock private A2dpNativeInterface mA2dpNativeInterface;
    @Mock private A2dpSinkNativeInterface mA2dpSinkNativeInterface;
    @Mock private AvrcpNativeInterface mAvrcpNativeInterface;
    @Mock private AvrcpControllerNativeInterface mAvrcpControllerNativeInterface;
    @Mock private HeadsetNativeInterface mHeadsetNativeInterface;
    @Mock private NativeInterface mHeadsetClientNativeInterface;
    @Mock private HearingAidNativeInterface mHearingAidNativeInterface;
    @Mock private HidDeviceNativeInterface mHidDeviceNativeInterface;
    @Mock private HidHostNativeInterface mHidHostNativeInterface;
@@ -158,8 +164,11 @@ public class ProfileServiceTest {
        Assert.assertNotNull(AdapterService.getAdapterService());

        A2dpNativeInterface.setInstance(mA2dpNativeInterface);
        A2dpSinkNativeInterface.setInstance(mA2dpSinkNativeInterface);
        AvrcpNativeInterface.setInstance(mAvrcpNativeInterface);
        AvrcpControllerNativeInterface.setInstance(mAvrcpControllerNativeInterface);
        HeadsetNativeInterface.setInstance(mHeadsetNativeInterface);
        /* HeadsetClient */ NativeInterface.setInstance(mHeadsetClientNativeInterface);
        HearingAidNativeInterface.setInstance(mHearingAidNativeInterface);
        HidDeviceNativeInterface.setInstance(mHidDeviceNativeInterface);
        HidHostNativeInterface.setInstance(mHidHostNativeInterface);
@@ -176,8 +185,11 @@ public class ProfileServiceTest {
        mAdapterService = null;
        mProfiles = null;
        A2dpNativeInterface.setInstance(null);
        A2dpSinkNativeInterface.setInstance(null);
        AvrcpNativeInterface.setInstance(null);
        AvrcpControllerNativeInterface.setInstance(null);
        HeadsetNativeInterface.setInstance(null);
        /* HeadsetClient */ NativeInterface.setInstance(null);
        HearingAidNativeInterface.setInstance(null);
        HidDeviceNativeInterface.setInstance(null);
        HidHostNativeInterface.setInstance(null);