From 694af99a1a5b542cde56646e1c01c08def9de990 Mon Sep 17 00:00:00 2001 From: lixiangpeng5 Date: Thu, 22 Sep 2022 17:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E8=8C=83=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lixiangpeng5 Change-Id: Iec71faefc19d63d2afb0d526f2241db0594d78f6 --- interfaces/plugin/vibrator/include/vibrator_napi_utils.h | 1 - interfaces/plugin/vibrator/src/vibrator_napi_utils.cpp | 6 +++--- .../hdi_connection/adpter/include/hdi_connection.h | 2 +- .../hdi_connection/adpter/src/hdi_connection.cpp | 6 +++--- utils/include/death_recipient_template.h | 2 +- utils/include/permission_util.h | 2 -- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/interfaces/plugin/vibrator/include/vibrator_napi_utils.h b/interfaces/plugin/vibrator/include/vibrator_napi_utils.h index ebb5d23..de2a5e1 100644 --- a/interfaces/plugin/vibrator/include/vibrator_napi_utils.h +++ b/interfaces/plugin/vibrator/include/vibrator_napi_utils.h @@ -45,7 +45,6 @@ public: uint32_t callbackType = 0; AsyncCallbackInfo(napi_env env) : env(env) {} ~AsyncCallbackInfo(); -private: }; bool IsMatchType(const napi_env &env, const napi_value &value, const napi_valuetype &type); diff --git a/interfaces/plugin/vibrator/src/vibrator_napi_utils.cpp b/interfaces/plugin/vibrator/src/vibrator_napi_utils.cpp index e299a7b..b4ab6cb 100644 --- a/interfaces/plugin/vibrator/src/vibrator_napi_utils.cpp +++ b/interfaces/plugin/vibrator/src/vibrator_napi_utils.cpp @@ -162,7 +162,7 @@ napi_value GreateCallbackError(const napi_env &env, const int32_t errCode, return result; } -void emitSystemCallback(const napi_env &env, sptr asyncCallbackInfo) +void EmitSystemCallback(const napi_env &env, sptr asyncCallbackInfo) { CHKPV(asyncCallbackInfo); if (asyncCallbackInfo->error.code == SUCCESS) { @@ -210,7 +210,7 @@ void EmitAsyncCallbackWork(sptr asyncCallbackInfo) */ asyncCallbackInfo->DecStrongRef(nullptr); if (asyncCallbackInfo->callbackType == TYPE_SYSTEM_VIBRATE) { - emitSystemCallback(env, asyncCallbackInfo); + EmitSystemCallback(env, asyncCallbackInfo); return; } CHKPV(asyncCallbackInfo->callback[0]); @@ -261,7 +261,7 @@ void EmitPromiseWork(sptr asyncCallbackInfo) asyncCallbackInfo->DecStrongRef(nullptr); CHKPV(asyncCallbackInfo->deferred); if (asyncCallbackInfo->callbackType == TYPE_SYSTEM_VIBRATE) { - emitSystemCallback(env, asyncCallbackInfo); + EmitSystemCallback(env, asyncCallbackInfo); return; } napi_value result = nullptr; diff --git a/services/miscdevice_service/hdi_connection/adpter/include/hdi_connection.h b/services/miscdevice_service/hdi_connection/adpter/include/hdi_connection.h index 3195f57..4995320 100644 --- a/services/miscdevice_service/hdi_connection/adpter/include/hdi_connection.h +++ b/services/miscdevice_service/hdi_connection/adpter/include/hdi_connection.h @@ -44,7 +44,7 @@ private: sptr hdiDeathObserver_; void RegisterHdiDeathRecipient(); void UnregisterHdiDeathRecipient(); - void reconnect(); + void Reconnect(); }; } // namespace Sensors } // namespace OHOS diff --git a/services/miscdevice_service/hdi_connection/adpter/src/hdi_connection.cpp b/services/miscdevice_service/hdi_connection/adpter/src/hdi_connection.cpp index ee58cee..13c24e1 100644 --- a/services/miscdevice_service/hdi_connection/adpter/src/hdi_connection.cpp +++ b/services/miscdevice_service/hdi_connection/adpter/src/hdi_connection.cpp @@ -126,15 +126,15 @@ void HdiConnection::ProcessDeathObserver(const wptr &object) return; } hdiService->RemoveDeathRecipient(hdiDeathObserver_); - reconnect(); + Reconnect(); } -void HdiConnection::reconnect() +void HdiConnection::Reconnect() { int32_t ret = ConnectHdi(); if (ret != ERR_OK) { HiSysEvent::Write(HiSysEvent::Domain::MISCDEVICE, "VIBRATOR_HDF_SERVICE_EXCEPTION", - HiSysEvent::EventType::FAULT, "PKG_NAME", "reconnect", "ERROR_CODE", ret); + HiSysEvent::EventType::FAULT, "PKG_NAME", "Reconnect", "ERROR_CODE", ret); MISC_HILOGE("connect hdi fail"); } } diff --git a/utils/include/death_recipient_template.h b/utils/include/death_recipient_template.h index d3a13a7..7e5ad58 100755 --- a/utils/include/death_recipient_template.h +++ b/utils/include/death_recipient_template.h @@ -23,7 +23,7 @@ namespace Sensors { template class DeathRecipientTemplate : public IRemoteObject::DeathRecipient { public: - explicit DeathRecipientTemplate(T &privateData) : privateData_(privateData){}; + explicit DeathRecipientTemplate(T &privateData) : privateData_(privateData) {}; virtual ~DeathRecipientTemplate() = default; virtual void OnRemoteDied(const wptr &object) { diff --git a/utils/include/permission_util.h b/utils/include/permission_util.h index 8a9a5e2..cce531d 100644 --- a/utils/include/permission_util.h +++ b/utils/include/permission_util.h @@ -31,8 +31,6 @@ public: PermissionUtil() = default; virtual ~PermissionUtil() {}; int32_t CheckVibratePermission(AccessTokenID callerToken, std::string permissionName); - -private: }; } // namespace Sensors } // namespace OHOS -- Gitee