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

Commit 32492d57 authored by Khoa Hong's avatar Khoa Hong
Browse files

USB: Add NCM functions to related tests

Bug: 194376600
Test: atest UsbManagerTests
Test: atest UsbTests:com.android.server.usb.UsbHandlerTest#setFunctionsNcm
Change-Id: I48269a8badb525b9d5ca3a3e3b55203fc7229b0a
parent 412558e9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ public class UsbManagerTestLib {
        testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_PTP);
        testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_MIDI);
        testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_RNDIS);
        testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_NCM);
    }

    public void testSetCurrentFunctions_shouldMatched() {
@@ -125,5 +126,6 @@ public class UsbManagerTestLib {
        testSetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_PTP);
        testSetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_MIDI);
        testSetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_RNDIS);
        testSetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_NCM);
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -180,6 +180,14 @@ public class UsbHandlerTest {
        assertNotEquals(mUsbHandler.getEnabledFunctions() & UsbManager.FUNCTION_RNDIS, 0);
    }

    @SmallTest
    @Test
    public void setFunctionsNcm() {
        mUsbHandler.handleMessage(mUsbHandler.obtainMessage(MSG_SET_CURRENT_FUNCTIONS,
                UsbManager.FUNCTION_NCM));
        assertNotEquals(mUsbHandler.getEnabledFunctions() & UsbManager.FUNCTION_NCM, 0);
    }

    @SmallTest
    @Test
    public void setFunctionsNcmAndRndis() {