diff --git a/services/native/src/usb_device_manager.cpp b/services/native/src/usb_device_manager.cpp index a0304e9ea4db03e30351518e6047f1c31fc24a28..5693ea0408ab599fc49350925c3a2fbde2ca9f17 100644 --- a/services/native/src/usb_device_manager.cpp +++ b/services/native/src/usb_device_manager.cpp @@ -301,7 +301,12 @@ void UsbDeviceManager::UpdateFunctions(int32_t func) } ReportFuncChangeSysEvent(currentFunctions_, func); currentFunctions_ = func; - BroadcastFuncChange(connected_, currentFunctions_); + if (!connected_ && gadgetConnected_) { + USB_HILOGI(MODULE_USB_SERVICE, "%{public}s: connect %{public}d, gadget connect %{public}d", + __func__, connected_, gadgetConnected_); + } else { + BroadcastFuncChange(connected_, currentFunctions_); + } ProcessFunctionNotifier(connected_, func); }