USB: Add NCM functions to related tests

Bug: 194376600
Test: atest UsbManagerTests
Test: atest UsbTests:com.android.server.usb.UsbHandlerTest#setFunctionsNcm
Change-Id: I48269a8badb525b9d5ca3a3e3b55203fc7229b0a
This commit is contained in:
Khoa Hong
2022-06-27 16:03:29 +08:00
parent 412558e904
commit 32492d576a
2 changed files with 10 additions and 0 deletions

View File

@@ -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);
}
}

View File

@@ -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() {