diff options
author | Ilho Kim <ilho159.kim@samsung.com> | 2024-09-30 13:46:29 +0900 |
---|---|---|
committer | Ilho Kim <ilho159.kim@samsung.com> | 2024-09-30 13:46:45 +0900 |
commit | 12d184f5ca3aedda895ad10c98cb25a669109711 (patch) | |
tree | f58a214dbedf802294167dd7f4d93527ea855914 | |
parent | 97e96fd454e662afe0c7ab13feb586090a4e5157 (diff) | |
download | slp-pkgmgr-12d184f5ca3aedda895ad10c98cb25a669109711.tar.gz slp-pkgmgr-12d184f5ca3aedda895ad10c98cb25a669109711.tar.bz2 slp-pkgmgr-12d184f5ca3aedda895ad10c98cb25a669109711.zip |
Remove app-event dependency
Include error handling of modified tidl code
Change-Id: I7547885f7866368bbb1765621a8a382501928102
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
-rw-r--r-- | installer/pkgmgr-installer.pc.in | 2 | ||||
-rw-r--r-- | installer/src/PkgSignal.cc | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/installer/pkgmgr-installer.pc.in b/installer/pkgmgr-installer.pc.in index fe02345..f812a3b 100644 --- a/installer/pkgmgr-installer.pc.in +++ b/installer/pkgmgr-installer.pc.in @@ -11,6 +11,6 @@ includedir=@INCLUDEDIR@ Name: package manager installer library Description: SLP package manager's installer lib for each backends Version: @FULLVER@ -Requires: capi-appfw-event +Requires: Libs: -L${libdir} -lpkgmgr_installer Cflags: -I${includedir}/pkgmgr diff --git a/installer/src/PkgSignal.cc b/installer/src/PkgSignal.cc index dc28b37..83494b3 100644 --- a/installer/src/PkgSignal.cc +++ b/installer/src/PkgSignal.cc @@ -309,6 +309,11 @@ PkgSignal::~PkgSignal() { Unsubscribe(); } void PkgSignal::Subscribe() { std::lock_guard<std::recursive_mutex> lock(mutex_); + if (!event_add_event_handler) { + _E("Function symbol(event_add_event_handler) did not initialized"); + throw InvalidIOException(); + } + int ret = event_add_event_handler(GetEventName().c_str(), EventCb, this, &event_handler_); if (ret != 0) { @@ -319,7 +324,8 @@ void PkgSignal::Subscribe() { void PkgSignal::Unsubscribe() { std::lock_guard<std::recursive_mutex> lock(mutex_); if (event_handler_) { - event_remove_event_handler(event_handler_); + if (event_remove_event_handler) + event_remove_event_handler(event_handler_); event_handler_ = nullptr; } } @@ -475,6 +481,10 @@ void PkgSignal::AsyncResult(std::string signal, int targetUid, } std::lock_guard<std::recursive_mutex> lock(mutex_); + if (!event_publish_app_event) { + _E("Function symbol(event_publish_app_event) did not initialized"); + throw InvalidIOException(); + } int ret = event_publish_app_event(GetEventName().c_str(), b); if (ret != 0) { _E("Failed to publish event. result(%d)", ret); @@ -513,6 +523,10 @@ void PkgSignal::AsyncResultForResource(std::string signal, int targetUid, } std::lock_guard<std::recursive_mutex> lock(mutex_); + if (!event_publish_app_event) { + _E("Function symbol(event_publish_app_event) did not initialized"); + throw InvalidIOException(); + } int ret = event_publish_app_event(GetEventName().c_str(), b); if (ret != 0) { _E("Failed to publish event. result(%d)", ret); @@ -545,6 +559,10 @@ void PkgSignal::AsyncResultForPkgUpgrade(std::string signal, int progress) { } std::lock_guard<std::recursive_mutex> lock(mutex_); + if (!event_publish_app_event) { + _E("Function symbol(event_publish_app_event) did not initialized"); + throw InvalidIOException(); + } int ret = event_publish_app_event(GetEventName().c_str(), b); if (ret != 0) { _E("Failed to publish event. result(%d)", ret); |