From 48d104738b411e413ef5934a7bd7a86f3e7c2a58 Mon Sep 17 00:00:00 2001 From: songbao1 Date: Wed, 21 Aug 2024 19:01:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AD=E6=BA=90=E9=83=A8=E5=88=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=B8=8D=E5=8A=A0=E8=BD=BD=20=EF=BC=88cherry=20picked?= =?UTF-8?q?=20commit=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ans/src/notification_extension_wrapper.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/services/ans/src/notification_extension_wrapper.cpp b/services/ans/src/notification_extension_wrapper.cpp index 00fa00984..d39ccdcda 100644 --- a/services/ans/src/notification_extension_wrapper.cpp +++ b/services/ans/src/notification_extension_wrapper.cpp @@ -58,19 +58,10 @@ void ExtensionWrapper::InitExtentionWrapper() } syncAdditionConfig_ = (SYNC_ADDITION_CONFIG)dlsym(extensionWrapperHandle_, "SyncAdditionConfig"); - getUnifiedGroupInfo_ = (GET_UNIFIED_GROUP_INFO)dlsym(extensionWrapperHandle_, "GetUnifiedGroupInfo"); - updateByCancel_ = (UPDATE_BY_CANCEL)dlsym(extensionWrapperHandle_, "UpdateByCancel"); - setLocalSwitch_ = (SET_LOCAL_SWITCH)dlsym(extensionWrapperHandle_, "SetlocalSwitch"); - initSummary_ = (INIT_SUMMARY)dlsym(extensionWrapperHandle_, "InitSummary"); localControl_ = (LOCAL_CONTROL)dlsym(extensionWrapperHandle_, "LocalControl"); - updateByBundle_ = (UPDATE_BY_BUNDLE)dlsym(extensionWrapperHandle_, "UpdateByBundle"); reminderControl_ = (REMINDER_CONTROL)dlsym(extensionWrapperHandle_, "ReminderControl"); if (syncAdditionConfig_ == nullptr - || getUnifiedGroupInfo_ == nullptr - || updateByCancel_ == nullptr - || initSummary_ == nullptr || localControl_ == nullptr - || updateByBundle_ == nullptr || reminderControl_ == nullptr) { ANS_LOGE("extension wrapper symbol failed, error: %{public}s", dlerror()); return; @@ -85,7 +76,9 @@ void ExtensionWrapper::InitExtentionWrapper() if (!aggregateConfig.empty()) { syncAdditionConfig_("AGGREGATE_CONFIG", aggregateConfig); } - initSummary_(UpdateUnifiedGroupInfo); + if (initSummary_ != nullptr) { + initSummary_(UpdateUnifiedGroupInfo); + } ANS_LOGD("extension wrapper init success"); } @@ -93,7 +86,6 @@ void ExtensionWrapper::CheckIfSetlocalSwitch() { ANS_LOGD("CheckIfSetlocalSwitch enter"); if (extensionWrapperHandle_ == nullptr) { - ANS_LOGE("CheckIfSetlocalSwitch extension wrapper symbol failed"); return; } if (!isRegisterDataSettingObserver) { @@ -108,7 +100,6 @@ void ExtensionWrapper::CheckIfSetlocalSwitch() void ExtensionWrapper::SetlocalSwitch(std::string &enable) { if (setLocalSwitch_ == nullptr) { - ANS_LOGE("SetlocalSwitch wrapper symbol failed"); return; } bool status = (enable == "false" ? false : true); @@ -143,7 +134,6 @@ ErrCode ExtensionWrapper::SyncAdditionConfig(const std::string& key, const std:: void ExtensionWrapper::UpdateByCancel(const std::vector>& notifications, int deleteReason) { if (updateByCancel_ == nullptr) { - ANS_LOGE("updateUnifiedGroupByCancel wrapper symbol failed"); return; } int32_t deleteType = convertToDelType(deleteReason); @@ -153,7 +143,6 @@ void ExtensionWrapper::UpdateByCancel(const std::vector>& not ErrCode ExtensionWrapper::GetUnifiedGroupInfo(const sptr &request) { if (getUnifiedGroupInfo_ == nullptr) { - ANS_LOGE("getUnifiedGroupInfo wrapper symbol failed"); return 0; } return getUnifiedGroupInfo_(request); @@ -180,7 +169,6 @@ __attribute__((no_sanitize("cfi"))) int32_t ExtensionWrapper::LocalControl(const void ExtensionWrapper::UpdateByBundle(const std::string bundleName, int deleteReason) { if (updateByBundle_ == nullptr) { - ANS_LOGE("UpdateByBundle wrapper symbol failed"); return; } int32_t deleteType = convertToDelType(deleteReason); -- Gitee