diff --git a/services/native/src/usb_right_manager.cpp b/services/native/src/usb_right_manager.cpp index 2ef9cedbd592f0d02210091b131f2969e80caa12..6c375fcad24266099b8fed98a181764019a9695b 100644 --- a/services/native/src/usb_right_manager.cpp +++ b/services/native/src/usb_right_manager.cpp @@ -119,7 +119,7 @@ bool UsbRightManager::HasRight(const std::string &deviceName, const std::string int32_t uid = USB_RIGHT_USERID_INVALID; GetCurrentUserId(uid); if (uid == USB_RIGHT_USERID_CONSOLE) { - USB_HILOGE(MODULE_USB_SERVICE, "console called, bypass"); + USB_HILOGW(MODULE_USB_SERVICE, "console called, bypass"); return true; } uint64_t nowTime = GetCurrentTimestamp(); @@ -139,7 +139,7 @@ int32_t UsbRightManager::RequestRight( USB_HILOGD(MODULE_USB_SERVICE, "RequestRight: busdev=%{private}s device=%{public}s app=%{public}s", busDev.c_str(), deviceName.c_str(), bundleName.c_str()); if (HasRight(deviceName, bundleName)) { - USB_HILOGE(MODULE_USB_SERVICE, "device has Right "); + USB_HILOGW(MODULE_USB_SERVICE, "device has Right "); return UEC_OK; } if (!GetUserAgreementByDiag(busDev, deviceName, bundleName)) { diff --git a/services/native/src/usb_service.cpp b/services/native/src/usb_service.cpp index a85fd4c864abe8df90d558ae7f0a40252d5b7379..7886fe280775b8a58ce330ca209aca5e16eb3556 100644 --- a/services/native/src/usb_service.cpp +++ b/services/native/src/usb_service.cpp @@ -59,7 +59,7 @@ constexpr int32_t SERVICE_STARTUP_MAX_TIME = 30; constexpr uint32_t UNLOAD_SA_TIMER_INTERVAL = 30 * 1000; } // namespace -auto pms = DelayedSpSingleton::GetInstance(); +auto g_serviceInstance = DelayedSpSingleton::GetInstance(); const bool G_REGISTER_RESULT = SystemAbility::MakeAndRegisterAbility(DelayedSpSingleton::GetInstance().GetRefPtr()); @@ -184,9 +184,9 @@ bool UsbService::Init() } } if (handler_ == nullptr) { - handler_ = std::make_shared(eventRunner_, pms); + handler_ = std::make_shared(eventRunner_, g_serviceInstance); - if (!Publish(pms)) { + if (!Publish(g_serviceInstance)) { USB_HILOGE(MODULE_USB_SERVICE, "OnStart register to system ability manager failed."); return false; } @@ -879,7 +879,7 @@ bool UsbService::AddDevice(uint8_t busNum, uint8_t devAddr) { UsbDevice *devInfo = new (std::nothrow) UsbDevice(); if (devInfo == nullptr) { - USB_HILOGI(MODULE_USB_SERVICE, "new failed"); + USB_HILOGE(MODULE_USB_SERVICE, "new failed"); return false; }