Merge "Check usb functions support with USB Gadget Hal version" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-04-15 17:07:19 +00:00
committed by Android (Google) Code Review

View File

@@ -2139,6 +2139,12 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
Slog.d(TAG, "setEnabledFunctions functions=" + functions + ", "
+ "forceRestart=" + forceRestart);
}
if (mCurrentGadgetHalVersion < UsbManager.GADGET_HAL_V1_2) {
if ((functions & UsbManager.FUNCTION_NCM) != 0) {
Slog.e(TAG, "Could not set unsupported function for the GadgetHal");
return;
}
}
if (mCurrentFunctions != functions
|| !mCurrentFunctionsApplied
|| forceRestart) {