From fffb1c5a57b3733f2e770c39708ddb9f216ff135 Mon Sep 17 00:00:00 2001 From: hyunho Date: Mon, 9 Sep 2019 14:45:26 +0900 Subject: [PATCH 01/16] Release version 1.6.11 Changes: - Delete meaningless configuration - Fix dbus conf Change-Id: Ie966fc97cb48babcf26a6dfabb013807d3838e85 Signed-off-by: hyunho --- packaging/data-provider-master.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 06b06d1..821b879 100755 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -2,7 +2,7 @@ Name: data-provider-master Summary: Master service provider for badge, shortcut, notification -Version: 1.6.10 +Version: 1.6.11 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 5c12deffd928dc38a6b597235b68cb991d7f127a Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Tue, 15 Oct 2019 13:17:51 +0900 Subject: [PATCH 02/16] Add default viewer launch feature for ex-noti Related change [notification] https://review.tizen.org/gerrit/#/c/platform/core/api/notification/+/215730/ Change-Id: I7136c3c59d7db5c1ccb4bccf4178355a3a87b273 Signed-off-by: Jusung Son --- src/notification_ex_service.cc | 46 +++++++++++++++++++++++-- src/notification_service.c | 76 +++++++++++++++++------------------------- 2 files changed, 74 insertions(+), 48 deletions(-) mode change 100755 => 100644 src/notification_ex_service.cc mode change 100755 => 100644 src/notification_service.c diff --git a/src/notification_ex_service.cc b/src/notification_ex_service.cc old mode 100755 new mode 100644 index b9f44f4..1d36b95 --- a/src/notification_ex_service.cc +++ b/src/notification_ex_service.cc @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include @@ -66,6 +68,38 @@ class DPMFacade { manager_->SendEvent(info, noti); } + void LaunchDefaultViewer(list> item, + notification_op_type_e status) { + int64_t priv_id; + if (item.size() == 0) + return; + + if (item.size() > 1) + priv_id = NOTIFICATION_PRIV_ID_NONE; + else + priv_id = static_pointer_cast( + item.front()->GetInfo())->GetPrivateId(); + + LaunchDefaultViewer(priv_id, status, + static_pointer_cast( + item.front()->GetInfo())->GetUid()); + } + void LaunchDefaultViewer(shared_ptr item, + notification_op_type_e status) { + LaunchDefaultViewer( + static_pointer_cast(item->GetInfo())->GetPrivateId(), + status, + static_pointer_cast(item->GetInfo())->GetUid()); + } + + void LaunchDefaultViewer(int64_t privId, notification_op_type_e status, + uid_t uid) { + int ret = notification_launch_default_viewer( + static_cast(privId), status, uid); + if (ret != ERROR_NONE) + ERR("Failed to launch default viewer [%d]", ret); + } + unique_ptr reporter_; unique_ptr manager_; map hide_map_; @@ -253,6 +287,7 @@ class DPMManager : public Manager { ret = DBManager::InsertNotification(addedItem); if (ret == ERROR_NONE) { facade_->DelegateReporterEvent(info, addedItem); + facade_->LaunchDefaultViewer(addedItem, NOTIFICATION_OP_INSERT); } else { DBG("SendError !!!"); SendError(info, static_cast(ret)); @@ -269,12 +304,13 @@ class DPMManager : public Manager { ret = DBManager::UpdateNotification(updatedItem); if (ret == ERROR_NONE) { facade_->DelegateReporterEvent(info, updatedItem); + facade_->LaunchDefaultViewer(updatedItem, NOTIFICATION_OP_UPDATE); } else { SendError(info, static_cast(ret)); } } - void DoDelete(const IEventInfo& info, + int DoDelete(const IEventInfo& info, shared_ptr deletedItem) { int ret = DBManager::DeleteNotification(deletedItem); if (ret == ERROR_NONE) { @@ -282,6 +318,7 @@ class DPMManager : public Manager { } else { SendError(info, static_cast(ret)); } + return ret; } void OnDelete(const IEventInfo& info, @@ -294,8 +331,11 @@ class DPMManager : public Manager { for (auto& i : noti_list) { DoDelete(info, i); } + facade_->LaunchDefaultViewer(noti_list, NOTIFICATION_OP_DELETE_ALL); } else { - DoDelete(info, deletedItem); + int ret = DoDelete(info, deletedItem); + if (ret == ERROR_NONE) + facade_->LaunchDefaultViewer(deletedItem, NOTIFICATION_OP_DELETE); } } @@ -330,6 +370,8 @@ HAPI int notification_ex_service_init() { unique_ptr(new DBusSender(Reporter::GetPath())), unique_ptr(new DBusEventListener(Manager::GetPath()))))); + notification_init_default_viewer(); + return ERROR_NONE; } diff --git a/src/notification_service.c b/src/notification_service.c old mode 100755 new mode 100644 index aeebd8a..73cbc87 --- a/src/notification_service.c +++ b/src/notification_service.c @@ -51,8 +51,6 @@ static GHashTable *_monitoring_hash; static GList *_dnd_alarm_id_list; -static char *default_viewer; - typedef struct _dnd_alarm_id { uid_t uid; alarm_id_t dnd_start_id; @@ -506,15 +504,14 @@ static int _add_noti(GVariant **reply_body, notification_h noti, uid_t uid) return ret; } - if (default_viewer != NULL) { - ret = notification_launch_default_viewer(default_viewer, - priv_id, NOTIFICATION_OP_INSERT, uid); - if (ret != NOTIFICATION_ERROR_NONE) { - ERR("Failed to launch default viewer [%d]", ret); - ret = NOTIFICATION_ERROR_NONE; - } + ret = notification_launch_default_viewer(priv_id, + NOTIFICATION_OP_INSERT, uid); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Failed to launch default viewer [%d]", ret); + ret = NOTIFICATION_ERROR_NONE; } + *reply_body = g_variant_new("(i)", priv_id); if (*reply_body == NULL) { ERR("Failed to make reply"); @@ -786,13 +783,11 @@ static int _update_noti(GVariant **reply_body, notification_h noti, uid_t uid) return ret; } - if (default_viewer != NULL) { - ret = notification_launch_default_viewer(default_viewer, - priv_id, NOTIFICATION_OP_UPDATE, uid); - if (ret != NOTIFICATION_ERROR_NONE) { - ERR("Failed to launch default viewer [%d]", ret); - ret = NOTIFICATION_ERROR_NONE; - } + ret = notification_launch_default_viewer(priv_id, + NOTIFICATION_OP_UPDATE, uid); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Failed to launch default viewer [%d]", ret); + ret = NOTIFICATION_ERROR_NONE; } *reply_body = g_variant_new("(i)", priv_id); @@ -1430,15 +1425,12 @@ static int _delete_noti(const char *app_id, int priv_id, uid_t uid) if (ret != NOTIFICATION_ERROR_NONE) return ret; - if (default_viewer != NULL) { - ret = notification_launch_default_viewer(default_viewer, - NOTIFICATION_PRIV_ID_NONE, - NOTIFICATION_OP_DELETE, - uid); - if (ret != NOTIFICATION_ERROR_NONE) { - ERR("Failed to launch default viewer [%d]", ret); - ret = NOTIFICATION_ERROR_NONE; - } + ret = notification_launch_default_viewer(NOTIFICATION_PRIV_ID_NONE, + NOTIFICATION_OP_DELETE, + uid); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Failed to launch default viewer [%d]", ret); + ret = NOTIFICATION_ERROR_NONE; } } @@ -1526,15 +1518,12 @@ int notification_del_noti_multiple(GVariant *parameters, GVariant **reply_body, free(list_deleted); - if (default_viewer != NULL) { - ret = notification_launch_default_viewer(default_viewer, - NOTIFICATION_PRIV_ID_NONE, - NOTIFICATION_OP_DELETE_ALL, - param_uid); - if (ret != NOTIFICATION_ERROR_NONE) { - ERR("Failed to launch default viewer [%d]", ret); - ret = NOTIFICATION_ERROR_NONE; - } + ret = notification_launch_default_viewer(NOTIFICATION_PRIV_ID_NONE, + NOTIFICATION_OP_DELETE_ALL, + param_uid); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Failed to launch default viewer [%d]", ret); + ret = NOTIFICATION_ERROR_NONE; } } @@ -1615,15 +1604,12 @@ int notification_del_noti_by_display_applist(GVariant *parameters, return ret; } - if (default_viewer != NULL) { - ret = notification_launch_default_viewer(default_viewer, - NOTIFICATION_PRIV_ID_NONE, - NOTIFICATION_OP_DELETE_ALL, - param_uid); - if (ret != NOTIFICATION_ERROR_NONE) { - ERR("Failed to launch default viewer [%d]", ret); - ret = NOTIFICATION_ERROR_NONE; - } + ret = notification_launch_default_viewer(NOTIFICATION_PRIV_ID_NONE, + NOTIFICATION_OP_DELETE_ALL, + param_uid); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Failed to launch default viewer [%d]", ret); + ret = NOTIFICATION_ERROR_NONE; } } @@ -2640,8 +2626,6 @@ static gboolean __refresh_setting_table(gpointer data) */ HAPI int notification_service_init(void) { -#define DEFAULT_VIEWER_CONF_FILE "/usr/share/notification/notification.ini" - int ret, i; int count = 0; uid_t *uids = NULL; @@ -2659,7 +2643,7 @@ HAPI int notification_service_init(void) return NOTIFICATION_ERROR_IO_ERROR; } - notification_get_default_viewer(DEFAULT_VIEWER_CONF_FILE, &default_viewer); + notification_init_default_viewer(); notification_noti_init_data(); notification_system_setting_init_system_setting_table(tzplatform_getuid(TZ_SYS_DEFAULT_USER)); -- 2.7.4 From a686a612c1d1f367e78c26455902d9c1475ab64d Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Thu, 17 Oct 2019 19:04:47 +0900 Subject: [PATCH 03/16] Fix data initialization bug - DPM only need to initialize the data when the device boots up Change-Id: I7411c3b1f6faadd3f6a10ab1b21d9492059bf6b8 Signed-off-by: Jusung Son --- include/notification_ex_service.h | 2 +- include/notification_service.h | 2 +- src/main.cc | 8 ++++---- src/notification_ex_service.cc | 12 ++++++++---- src/notification_service.c | 7 +++++-- 5 files changed, 19 insertions(+), 12 deletions(-) mode change 100644 => 100755 src/notification_service.c diff --git a/include/notification_ex_service.h b/include/notification_ex_service.h index c6b3477..9defe26 100644 --- a/include/notification_ex_service.h +++ b/include/notification_ex_service.h @@ -19,7 +19,7 @@ #ifndef NOTIFICATION_EX_SERVICE_H_ #define NOTIFICATION_EX_SERVICE_H_ -extern int notification_ex_service_init(void); +extern int notification_ex_service_init(int restart_count); extern int notification_ex_service_fini(void); extern GDBusConnection* notification_ex_service_get_gdbus_connection(void); diff --git a/include/notification_service.h b/include/notification_service.h index 6d2e44e..d4c411f 100755 --- a/include/notification_service.h +++ b/include/notification_service.h @@ -23,7 +23,7 @@ extern "C" { #endif -int notification_service_init(void); +int notification_service_init(int restart_count); int notification_service_fini(void); int notification_add_noti(GVariant *parameters, GVariant **reply_body, diff --git a/src/main.cc b/src/main.cc index eb33ba7..945c259 100755 --- a/src/main.cc +++ b/src/main.cc @@ -63,7 +63,7 @@ static void lang_key_changed_cb(keynode_t *node, void *first) } } -static inline int app_create(void) +static inline int app_create(int restart_count) { int ret; @@ -73,7 +73,7 @@ static inline int app_create(void) lang_key_changed_cb(NULL, NULL); - ret = notification_ex_service_init(); + ret = notification_ex_service_init(restart_count); if (ret < 0) WARN("notification_ex [%d]", ret); @@ -84,7 +84,7 @@ static inline int app_create(void) if (ret < 0) WARN("shortcut [%d]", ret); - ret = notification_service_init(); + ret = notification_service_init(restart_count); if (ret < 0) WARN("notification [%d]", ret); @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) vconf_get_int(VCONFKEY_MASTER_RESTART_COUNT, &restart_count); - app_create(); + app_create(restart_count); sd_notify(0, "READY=1"); restart_count++; diff --git a/src/notification_ex_service.cc b/src/notification_ex_service.cc index 1d36b95..67faf91 100644 --- a/src/notification_ex_service.cc +++ b/src/notification_ex_service.cc @@ -48,10 +48,13 @@ using namespace notification::item; class DPMFacade { public: - DPMFacade(unique_ptr reporter, unique_ptr manager) + DPMFacade(unique_ptr reporter, unique_ptr manager, int restartCount) : reporter_(move(reporter)), manager_(move(manager)) { DBManager::InitializeDB(); - DBManager::InitializeData(); + + if (restartCount == 0) + DBManager::InitializeData(); + hide_map_ = DBManager::GetHideMap(); } @@ -359,7 +362,7 @@ class DPMManager : public Manager { } }; -HAPI int notification_ex_service_init() { +HAPI int notification_ex_service_init(int restart_count) { facade_ = new DPMFacade( unique_ptr( new DPMReporter( @@ -368,7 +371,8 @@ HAPI int notification_ex_service_init() { unique_ptr( new DPMManager( unique_ptr(new DBusSender(Reporter::GetPath())), - unique_ptr(new DBusEventListener(Manager::GetPath()))))); + unique_ptr(new DBusEventListener(Manager::GetPath())))), + restart_count); notification_init_default_viewer(); diff --git a/src/notification_service.c b/src/notification_service.c old mode 100644 new mode 100755 index 73cbc87..f082d75 --- a/src/notification_service.c +++ b/src/notification_service.c @@ -2624,7 +2624,7 @@ static gboolean __refresh_setting_table(gpointer data) * MAIN THREAD * Do not try to do any other operation in these functions */ -HAPI int notification_service_init(void) +HAPI int notification_service_init(int restart_count) { int ret, i; int count = 0; @@ -2644,7 +2644,10 @@ HAPI int notification_service_init(void) } notification_init_default_viewer(); - notification_noti_init_data(); + + if (restart_count == 0) + notification_noti_init_data(); + notification_system_setting_init_system_setting_table(tzplatform_getuid(TZ_SYS_DEFAULT_USER)); ret = notification_system_setting_get_dnd_schedule_enabled_uid(&uids, &count); -- 2.7.4 From 2b49bfd0600cba498bc7f7189436cfb995733750 Mon Sep 17 00:00:00 2001 From: hyunho Date: Tue, 22 Oct 2019 18:02:32 +0900 Subject: [PATCH 04/16] Fix pass null to g_hash_table_contains bug Change-Id: Ia3267518428da15c419984b7aeff9ec7b89c3037 Signed-off-by: hyunho --- src/service_common.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/service_common.c b/src/service_common.c index 0396194..a79ddf6 100755 --- a/src/service_common.c +++ b/src/service_common.c @@ -421,6 +421,19 @@ out: return result; } +static int _init_pkg_privilege_info() { + + if (_noti_pkg_privilege_info != NULL) + return 0; + + _noti_pkg_privilege_info = + g_hash_table_new_full(g_str_hash, g_str_equal, free, NULL); + _badge_pkg_privilege_info = + g_hash_table_new_full(g_str_hash, g_str_equal, free, NULL); + DBG("init pkg privilege info done"); + return 0; +} + static int _package_install_cb(uid_t uid, const char *pkgname, enum pkgmgr_status status, double value, void *data) { int ret; @@ -433,6 +446,7 @@ static int _package_install_cb(uid_t uid, const char *pkgname, enum pkgmgr_statu if (uid == tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)) uid = tzplatform_getuid(TZ_SYS_DEFAULT_USER); + _init_pkg_privilege_info(); if (g_hash_table_contains(_noti_pkg_privilege_info, pkgname)) { tmp = g_hash_table_lookup(_noti_pkg_privilege_info, pkgname); privilege_info = GPOINTER_TO_UINT(tmp); @@ -479,11 +493,7 @@ static int _package_uninstall_cb(uid_t uid, const char *pkgname, enum pkgmgr_sta if (ret == PMINFO_R_OK) { pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo); - if (_noti_pkg_privilege_info == NULL) { - _noti_pkg_privilege_info = g_hash_table_new_full(g_str_hash, g_str_equal, free, NULL); - _badge_pkg_privilege_info = g_hash_table_new_full(g_str_hash, g_str_equal, free, NULL); - } - + _init_pkg_privilege_info(); ret = notification_setting_db_update_pkg_disabled(pkgname, true, uid); if (ret == NOTIFICATION_ERROR_NONE) g_hash_table_insert(_noti_pkg_privilege_info, strdup(pkgname), GUINT_TO_POINTER(1)); -- 2.7.4 From 48fe111156e55a03c4ef0d9a109ddb30d84c67e9 Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Wed, 30 Oct 2019 15:09:57 +0900 Subject: [PATCH 05/16] Release version 1.6.12 - Add default viewer launch feature for ex-noti Fix data initialization bug Fix pass null to g_hash_table_contains bug Change-Id: I6c73da121726a3262c84880bd33b2c62548070e9 Signed-off-by: mk5004.lee --- packaging/data-provider-master.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 821b879..925c836 100755 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -2,7 +2,7 @@ Name: data-provider-master Summary: Master service provider for badge, shortcut, notification -Version: 1.6.11 +Version: 1.6.12 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 429270068b077582b39f57af0e72582705ac653c Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Wed, 12 Jun 2019 18:54:15 +0900 Subject: [PATCH 06/16] Set/Unset private sharing Change-Id: I22f9382ca96cc76365a32d855a62ad65db8ef9b3 Signed-off-by: mk5004.lee --- CMakeLists.txt | 1 + packaging/data-provider-master.spec | 1 + src/notification_ex_service.cc | 52 ++++++++++++++++++++++++++++++++----- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bf8906..824361f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ pkg_check_modules(pkgs REQUIRED capi-appfw-app-manager alarm-service libtzplatform-config + security-manager ) FOREACH(flag ${pkgs_CFLAGS}) diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 925c836..96b1b9b 100755 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -30,6 +30,7 @@ BuildRequires: pkgconfig(shortcut) BuildRequires: pkgconfig(libsystemd-daemon) BuildRequires: pkgconfig(alarm-service) BuildRequires: pkgconfig(libtzplatform-config) +BuildRequires: pkgconfig(security-manager) Requires: notification-ex Requires(post): dbus diff --git a/src/notification_ex_service.cc b/src/notification_ex_service.cc index 67faf91..5bd97b4 100644 --- a/src/notification_ex_service.cc +++ b/src/notification_ex_service.cc @@ -38,6 +38,7 @@ #include #include #include +#include #include "debug.h" #include "notification_ex_service.h" @@ -58,7 +59,8 @@ class DPMFacade { hide_map_ = DBManager::GetHideMap(); } - void DelegateReporterEvent(const IEventInfo& info, shared_ptr item) { + void DelegateReporterEvent(const IEventInfo& info, + shared_ptr item) { reporter_->SendEvent(info, item); } @@ -67,7 +69,8 @@ class DPMFacade { reporter_->SendEvent(info, itemList); } - void DelegateManagerEvent(const IEventInfo& info, shared_ptr noti) { + void DelegateManagerEvent(const IEventInfo& info, + shared_ptr noti) { manager_->SendEvent(info, noti); } @@ -106,6 +109,8 @@ class DPMFacade { unique_ptr reporter_; unique_ptr manager_; map hide_map_; + multimap receiver_group_list_; + SharedFile shared_file_; }; static DPMFacade* facade_; @@ -148,6 +153,9 @@ class DPMReporter : public Reporter { /* noti to viewers */ facade_->DelegateReporterEvent(info, deletedItem); + + facade_->shared_file_.RemovePrivateSharing(deletedItem, + facade_->receiver_group_list_); } else { SendError(info, static_cast(ret)); } @@ -174,6 +182,9 @@ class DPMReporter : public Reporter { if (type == IEventInfo::EventType::DeleteAll) { OnDelete(info, nullptr); return; + } else if (type == IEventInfo::EventType::Register) { + OnRegister(info); + return; } for (auto& i : noti_list) { @@ -191,10 +202,17 @@ class DPMReporter : public Reporter { } list> OnRequestEvent(const IEventInfo& info) override { + list> item_list; + DBG("Get report !!! %s", info.GetItemId().c_str()); - return DBManager::GetNotificationList( - ((const IEventInfoInternal&)info).GetUid(), - ((const IEventInfoInternal&)info).GetChannel().c_str()); + item_list = DBManager::GetNotificationList( + ((const IEventInfoInternal&)info).GetUid(), + ((const IEventInfoInternal&)info).GetChannel().c_str()); + + facade_->shared_file_.SetPrivateSharing(item_list, + facade_->receiver_group_list_); + + return item_list; } int OnRequestNumber(const IEventInfo& info) override { @@ -249,6 +267,20 @@ class DPMReporter : public Reporter { return ERROR_NOT_EXIST_ID; } + void OnRegister(const IEventInfo& info) { + std::string receiver_group = info.GetChannel(); + std::string appid = info.GetOwner(); + + std::multimap::iterator it; + for(auto receiver_group_ : facade_->receiver_group_list_) { + if (receiver_group_.first.compare(receiver_group) == 0 && + receiver_group_.second.compare(appid) == 0) + return; + } + + facade_->receiver_group_list_.insert(make_pair(receiver_group, appid)); + } + public: DPMReporter(std::unique_ptr sender, std::unique_ptr listener) @@ -289,6 +321,8 @@ class DPMManager : public Manager { ret = DBManager::InsertNotification(addedItem); if (ret == ERROR_NONE) { + facade_->shared_file_.SetPrivateSharing(addedItem, + facade_->receiver_group_list_); facade_->DelegateReporterEvent(info, addedItem); facade_->LaunchDefaultViewer(addedItem, NOTIFICATION_OP_INSERT); } else { @@ -306,6 +340,8 @@ class DPMManager : public Manager { ret = DBManager::UpdateNotification(updatedItem); if (ret == ERROR_NONE) { + facade_->shared_file_.UpdatePrivateSharing(updatedItem, + facade_->receiver_group_list_); facade_->DelegateReporterEvent(info, updatedItem); facade_->LaunchDefaultViewer(updatedItem, NOTIFICATION_OP_UPDATE); } else { @@ -315,9 +351,13 @@ class DPMManager : public Manager { int DoDelete(const IEventInfo& info, shared_ptr deletedItem) { - int ret = DBManager::DeleteNotification(deletedItem); + int ret; + + ret = DBManager::DeleteNotification(deletedItem); if (ret == ERROR_NONE) { facade_->DelegateReporterEvent(info, deletedItem); + facade_->shared_file_.RemovePrivateSharing(deletedItem, + facade_->receiver_group_list_); } else { SendError(info, static_cast(ret)); } -- 2.7.4 From b56555038ee1377cbe7de8e3c1676b7f7385702b Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Mon, 2 Dec 2019 15:48:04 +0900 Subject: [PATCH 07/16] Set indirect request info Requires: - https://review.tizen.org/gerrit/#/c/platform/core/api/notification/+/219120/ Change-Id: Ib3d8bee5af78c133e5af67e0c4ae79a457028253 Signed-off-by: Jusung Son --- src/notification_ex_service.cc | 69 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/src/notification_ex_service.cc b/src/notification_ex_service.cc index 5bd97b4..79199d4 100644 --- a/src/notification_ex_service.cc +++ b/src/notification_ex_service.cc @@ -19,6 +19,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include @@ -39,10 +44,14 @@ #include #include #include +#include +#include #include "debug.h" #include "notification_ex_service.h" +#define NORMAL_UID_BASE 5000 + using namespace std; using namespace notification; using namespace notification::item; @@ -319,6 +328,8 @@ class DPMManager : public Manager { DBG("Add !!!"); int ret; + SetIndirectRequest(info, addedItem); + ret = DBManager::InsertNotification(addedItem); if (ret == ERROR_NONE) { facade_->shared_file_.SetPrivateSharing(addedItem, @@ -337,6 +348,7 @@ class DPMManager : public Manager { int ret; UpdateHideApp(updatedItem); + SetIndirectRequest(info, updatedItem); ret = DBManager::UpdateNotification(updatedItem); if (ret == ERROR_NONE) { @@ -395,6 +407,63 @@ class DPMManager : public Manager { } } + void SetIndirectRequest(const IEventInfo& info, + list> addedItem) { + for (auto& i : addedItem) + SetIndirectRequest(info, i); + } + + void SetIndirectRequest(const IEventInfo& info, + shared_ptr addedItem) { + SetIndirectRequest(info, addedItem->GetAction()); + + if (addedItem->GetType() != AbstractItem::Type::Group) + return; + + auto item_group = static_pointer_cast(addedItem); + auto children_list = item_group->GetChildren(); + for (auto& i : children_list) + SetIndirectRequest(info, i); + } + + void SetIndirectRequest(const IEventInfo& info, shared_ptraction) { + if (action == nullptr || action->GetType() != AbstractAction::Type::AppControl) + return; + + uid_t uid = static_cast(info).GetValidatedUid(); + if (uid < NORMAL_UID_BASE) + return; + + string owner = static_cast(info).GetValidatedOwner(); + app_control_h appcontrol = static_pointer_cast(action)->GetAppControl(); + bundle* b = nullptr; + app_control_export_as_bundle(appcontrol, &b); + + bundle_del(b, AUL_K_REQUEST_TYPE); + bundle_add(b, AUL_K_REQUEST_TYPE, "indirect-request"); + + bundle_del(b, AUL_K_ORG_CALLER_UID); + bundle_add(b, AUL_K_ORG_CALLER_UID, std::to_string(uid).c_str()); + + bundle_del(b, AUL_K_ORG_CALLER_APPID); + bundle_add(b, AUL_K_ORG_CALLER_APPID, owner.c_str()); + + pkgmgrinfo_appinfo_h handle; + int r = pkgmgrinfo_appinfo_get_usr_appinfo(owner.c_str(), uid, &handle); + if (r == PMINFO_R_OK) { + char* pkgid = nullptr; + pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid); + if (pkgid) { + bundle_del(b, AUL_K_ORG_CALLER_PKGID); + bundle_add(b, AUL_K_ORG_CALLER_PKGID, pkgid); + } + pkgmgrinfo_appinfo_destroy_appinfo(handle); + } + + app_control_import_from_bundle(appcontrol, b); + bundle_free(b); + } + public: DPMManager(std::unique_ptr sender, std::unique_ptr listener) -- 2.7.4 From 3b1b2943028ebe3334c299f619416e80e156579c Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Tue, 3 Dec 2019 18:57:12 +0900 Subject: [PATCH 08/16] Add uid validation for notification-ex Change-Id: Id46391654986c7eb09ae276182b710bc84b24a69 Signed-off-by: Jusung Son --- src/notification_ex_service.cc | 65 +++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 11 deletions(-) diff --git a/src/notification_ex_service.cc b/src/notification_ex_service.cc index 79199d4..7eb32f2 100644 --- a/src/notification_ex_service.cc +++ b/src/notification_ex_service.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -115,6 +116,13 @@ class DPMFacade { ERR("Failed to launch default viewer [%d]", ret); } + uid_t GetUid(const IEventInfo& info) { + uid_t validated_uid = + static_cast(info).GetValidatedUid(); + + return validated_uid > NORMAL_UID_BASE ? + validated_uid : tzplatform_getuid(TZ_SYS_DEFAULT_USER); + } unique_ptr reporter_; unique_ptr manager_; map hide_map_; @@ -175,7 +183,7 @@ class DPMReporter : public Reporter { DBG("Delete !!!"); if (info.GetEventType() == IEventInfo::EventType::DeleteAll) { list> noti_list = - DBManager::GetNotificationList(((const IEventInfoInternal&)info).GetUid()); + DBManager::GetNotificationList(facade_->GetUid(info)); for (auto& i : noti_list) { DoDelete(info, i); } @@ -214,8 +222,7 @@ class DPMReporter : public Reporter { list> item_list; DBG("Get report !!! %s", info.GetItemId().c_str()); - item_list = DBManager::GetNotificationList( - ((const IEventInfoInternal&)info).GetUid(), + item_list = DBManager::GetNotificationList(facade_->GetUid(info), ((const IEventInfoInternal&)info).GetChannel().c_str()); facade_->shared_file_.SetPrivateSharing(item_list, @@ -226,8 +233,7 @@ class DPMReporter : public Reporter { int OnRequestNumber(const IEventInfo& info) override { DBG("Get count !!! %s", info.GetItemId().c_str()); - return DBManager::GetNotificationList( - ((const IEventInfoInternal&)info).GetUid()).size(); + return DBManager::GetNotificationList(facade_->GetUid(info)).size(); } int UpdateHideApp(shared_ptr updatedItem) { @@ -328,6 +334,12 @@ class DPMManager : public Manager { DBG("Add !!!"); int ret; + ret = ValidateUid(info, addedItem); + if (ret != ERROR_NONE) { + SendError(info, static_cast(ret)); + return; + } + SetIndirectRequest(info, addedItem); ret = DBManager::InsertNotification(addedItem); @@ -347,6 +359,12 @@ class DPMManager : public Manager { DBG("Update !!!"); int ret; + ret = ValidateUid(info, updatedItem); + if (ret != ERROR_NONE) { + SendError(info, static_cast(ret)); + return; + } + UpdateHideApp(updatedItem); SetIndirectRequest(info, updatedItem); @@ -381,8 +399,7 @@ class DPMManager : public Manager { DBG("Delete !!!"); if (info.GetEventType() == IEventInfo::EventType::DeleteAll) { list> noti_list = - DBManager::GetNotificationList(info.GetOwner(), - ((const IEventInfoInternal&)info).GetUid()); + DBManager::GetNotificationList(info.GetOwner(), facade_->GetUid(info)); for (auto& i : noti_list) { DoDelete(info, i); } @@ -396,14 +413,13 @@ class DPMManager : public Manager { list> OnRequestEvent(const IEventInfo& info) override { DBG("Get !!! %s", info.GetOwner().c_str()); + uid_t uid = facade_->GetUid(info); if (info.GetItemId().empty()) { /* get */ - return DBManager::GetNotificationList(info.GetOwner(), - ((const IEventInfoInternal&)info).GetUid()); + return DBManager::GetNotificationList(info.GetOwner(), uid); } else { /* FindByRootID */ - return DBManager::GetNotificationList(info.GetOwner(), info.GetItemId(), - ((const IEventInfoInternal&)info).GetUid()); + return DBManager::GetNotificationList(info.GetOwner(), info.GetItemId(), uid); } } @@ -464,6 +480,33 @@ class DPMManager : public Manager { bundle_free(b); } + int ValidateUid(const IEventInfo& info, list> addedItem) { + int ret; + for (auto& i : addedItem) { + ret = ValidateUid(info, i); + if (ret != ERROR_NONE) + return ret; + } + + return ERROR_NONE; + } + + int ValidateUid(const IEventInfo& info, shared_ptr addedItem) { + uid_t validated_uid = static_cast(info).GetValidatedUid(); + uid_t item_uid = static_pointer_cast + (addedItem->GetInfo())->GetUid(); + + if (validated_uid <= NORMAL_UID_BASE) { + static_pointer_cast + (addedItem->GetInfo())->SetUid(tzplatform_getuid(TZ_SYS_DEFAULT_USER)); + } else if (validated_uid != item_uid) { + ERR("Invalid sender uid[%d] noti_uid[%d]", validated_uid, item_uid); + return ERROR_INVALID_PARAMETER; + } + + return ERROR_NONE; + } + public: DPMManager(std::unique_ptr sender, std::unique_ptr listener) -- 2.7.4 From 53f054f47bdcdd8169876794fcd9842476bbf178 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Fri, 6 Dec 2019 17:19:13 +0900 Subject: [PATCH 09/16] Add translate localized text feature Requires: - https://review.tizen.org/gerrit/#/c/platform/core/api/notification/+/219600/ Change-Id: Ib5bf4249ee761d46b508e8ad81d39c10e77b7cb1 Signed-off-by: Jusung Son --- src/notification_ex_service.cc | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/src/notification_ex_service.cc b/src/notification_ex_service.cc index 7eb32f2..4792f2b 100644 --- a/src/notification_ex_service.cc +++ b/src/notification_ex_service.cc @@ -123,6 +123,26 @@ class DPMFacade { return validated_uid > NORMAL_UID_BASE ? validated_uid : tzplatform_getuid(TZ_SYS_DEFAULT_USER); } + + void TranslateText(list> item) { + for (auto& i : item) + TranslateText(i); + } + + void TranslateText(shared_ptr item) { + if (item->GetMultiLanguage() != nullptr) + item->GetMultiLanguage()->UpdateString(); + + if (item->GetType() != AbstractItem::Type::Group) + return; + + auto item_group = static_pointer_cast(item); + auto children_list = item_group->GetChildren(); + + for (auto& i : children_list) + TranslateText(i); + } + unique_ptr reporter_; unique_ptr manager_; map hide_map_; @@ -151,6 +171,7 @@ class DPMReporter : public Reporter { ret = DBManager::UpdateNotification(updatedItem); if (ret == ERROR_NONE) { + facade_->TranslateText(updatedItem); /* noti owner */ facade_->DelegateManagerEvent(info, updatedItem); @@ -228,6 +249,8 @@ class DPMReporter : public Reporter { facade_->shared_file_.SetPrivateSharing(item_list, facade_->receiver_group_list_); + facade_->TranslateText(item_list); + return item_list; } @@ -346,6 +369,7 @@ class DPMManager : public Manager { if (ret == ERROR_NONE) { facade_->shared_file_.SetPrivateSharing(addedItem, facade_->receiver_group_list_); + facade_->TranslateText(addedItem); facade_->DelegateReporterEvent(info, addedItem); facade_->LaunchDefaultViewer(addedItem, NOTIFICATION_OP_INSERT); } else { @@ -372,6 +396,7 @@ class DPMManager : public Manager { if (ret == ERROR_NONE) { facade_->shared_file_.UpdatePrivateSharing(updatedItem, facade_->receiver_group_list_); + facade_->TranslateText(updatedItem); facade_->DelegateReporterEvent(info, updatedItem); facade_->LaunchDefaultViewer(updatedItem, NOTIFICATION_OP_UPDATE); } else { @@ -413,13 +438,20 @@ class DPMManager : public Manager { list> OnRequestEvent(const IEventInfo& info) override { DBG("Get !!! %s", info.GetOwner().c_str()); + list> item_list; uid_t uid = facade_->GetUid(info); if (info.GetItemId().empty()) { /* get */ - return DBManager::GetNotificationList(info.GetOwner(), uid); + item_list = DBManager::GetNotificationList(info.GetOwner(), uid); + facade_->TranslateText(item_list); + + return item_list; } else { /* FindByRootID */ - return DBManager::GetNotificationList(info.GetOwner(), info.GetItemId(), uid); + item_list = DBManager::GetNotificationList(info.GetOwner(), info.GetItemId(), uid); + facade_->TranslateText(item_list); + + return item_list; } } -- 2.7.4 From 01ef87cf6c41aaea093fe5dfd6d08c694c5087e6 Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Thu, 30 Jan 2020 10:30:36 +0900 Subject: [PATCH 10/16] Release version 1.6.13 - Add translate localized text feature Add uid validation for notification-ex Set indirect request info Set/Unset private sharing Change-Id: I3e6ef8ef5e1f054fb973aa6267e32d9ddd415f16 Signed-off-by: mk5004.lee --- packaging/data-provider-master.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 96b1b9b..f4f4515 100755 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -2,7 +2,7 @@ Name: data-provider-master Summary: Master service provider for badge, shortcut, notification -Version: 1.6.12 +Version: 1.6.13 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 9860e1ae547705bd4fa602ecaaa68455d84b8a1d Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Thu, 12 Dec 2019 14:00:26 +0900 Subject: [PATCH 11/16] Apply system setting to notification-ex Change-Id: I17b448bb288e3a884e0d9e589625b0ae7cff87f9 Signed-off-by: Jusung Son --- src/notification_ex_service.cc | 174 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) diff --git a/src/notification_ex_service.cc b/src/notification_ex_service.cc index 4792f2b..d4c1bcf 100644 --- a/src/notification_ex_service.cc +++ b/src/notification_ex_service.cc @@ -25,12 +25,16 @@ #include #include #include +#include +#include +#include #include #include #include #include +#include #include #include #include @@ -143,6 +147,164 @@ class DPMFacade { TranslateText(i); } + bool CheckAllowedToNotify(list> item) { + auto iter = item.begin(); + + while (iter != item.end()) { + if (CheckAllowedToNotify(*iter) == false) + iter = item.erase(iter); + else + iter++; + } + + if (item.size() == 0) + return false; + else + return true; + } + + bool CheckAllowedToNotify(shared_ptr item) { + notification_setting_h setting; + int ret; + bool allow_to_notify, app_disabled; + uid_t uid = static_pointer_cast(item->GetInfo())->GetUid(); + + ret = noti_setting_service_get_setting_by_app_id(item->GetSenderAppId().c_str(), + &setting, uid); + if (ret != NOTIFICATION_ERROR_NONE) + return true; + + notification_setting_get_allow_to_notify(setting, &allow_to_notify); + notification_setting_get_app_disabled(setting, &app_disabled); + notification_setting_free_notification(setting); + + if (!allow_to_notify || app_disabled) { + ERR("[%s] is not allowed to notify[%d,%d]", item->GetSenderAppId().c_str(), + allow_to_notify, app_disabled); + return false; + } + + return true; + } + bool CheckDoNoDisturbStatus(uid_t uid, const string& owner) { + int ret; + bool do_not_disturb = false; + bool do_not_disturb_exception; + notification_setting_h setting = nullptr; + notification_system_setting_h system_setting = nullptr; + + ret = noti_system_setting_load_system_setting(&system_setting, uid); + if (ret != NOTIFICATION_ERROR_NONE) { + WARN("Failed to load system setting [%d]", ret); + goto out; + } + + ret = notification_system_setting_get_do_not_disturb(system_setting, &do_not_disturb); + if (ret != NOTIFICATION_ERROR_NONE) { + WARN("Failed to get do_not_disturb [%d]", ret); + goto out; + } + + if (do_not_disturb) { + do_not_disturb = false; + /* Check exception option of the caller app_id */ + ret = noti_setting_service_get_setting_by_app_id(owner.c_str(), &setting, uid); + if (ret != NOTIFICATION_ERROR_NONE) { + WARN("Failed to get setting by app_id [%d]", ret); + goto out; + } + + ret = notification_setting_get_do_not_disturb_except(setting, &do_not_disturb_exception); + if (ret != NOTIFICATION_ERROR_NONE) { + WARN("Failed to get do_not_disturb_exception [%d]", ret); + goto out; + } + + if (do_not_disturb_exception == false) + do_not_disturb = true; + } + +out: + DBG("do_not_disturb [%d]", do_not_disturb); + if (system_setting) + notification_system_setting_free_system_setting(system_setting); + + if (setting) + notification_setting_free_notification(setting); + + return do_not_disturb; + } + + void SetDoNoDisturbPolicy(list> item) { + for (auto& i : item) + SetDoNoDisturbPolicy(i); + } + + void SetDoNoDisturbPolicy(shared_ptr item) { + uid_t uid = static_pointer_cast(item->GetInfo())->GetUid(); + if (CheckDoNoDisturbStatus(uid, item->GetSenderAppId()) == false) + return; + + item->SetSoundPath(""); + item->SetVibrationPath(""); + item->SetLEDInfo(nullptr); + + std::list receiver_list = item->GetReceiverList(); + if (receiver_list.size() == 0) { + item->AddReceiver(NOTI_EX_RECEIVER_GROUP_PANEL); + item->AddReceiver(NOTI_EX_RECEIVER_GROUP_INDICATOR); + } else { + auto iter = receiver_list.begin(); + + while (iter != receiver_list.end()) { + if ((*iter).compare(NOTI_EX_RECEIVER_GROUP_PANEL) != 0 + && (*iter).compare(NOTI_EX_RECEIVER_GROUP_INDICATOR) != 0) + iter = receiver_list.erase(iter); + else + iter++; + } + } + } + + void SetPopUpPolicy(list> item) { + for (auto& i : item) + SetPopUpPolicy(i); + } + + void SetPopUpPolicy(shared_ptr item) { + notification_setting_h setting; + int ret; + bool is_pop_up; + uid_t uid = static_pointer_cast(item->GetInfo())->GetUid(); + ret = noti_setting_service_get_setting_by_app_id(item->GetSenderAppId().c_str(), + &setting, uid); + if (ret != NOTIFICATION_ERROR_NONE) { + WARN("Failed get the setting for [%s] [%x]", item->GetSenderAppId().c_str(), ret); + return; + } + + notification_setting_get_pop_up_notification(setting, &is_pop_up); + notification_setting_free_notification(setting); + if (is_pop_up == true) + return; + + std::list receiver_list = item->GetReceiverList(); + if (receiver_list.size() == 0) { + item->AddReceiver(NOTI_EX_RECEIVER_GROUP_PANEL); + item->AddReceiver(NOTI_EX_RECEIVER_GROUP_TICKER); + item->AddReceiver(NOTI_EX_RECEIVER_GROUP_LOCKSCREEN); + item->AddReceiver(NOTI_EX_RECEIVER_GROUP_INDICATOR); + } else { + auto iter = receiver_list.begin(); + + while (iter != receiver_list.end()) { + if ((*iter).compare(NOTI_EX_RECEIVER_GROUP_POPUP) == 0) + iter = receiver_list.erase(iter); + else + iter++; + } + } + } unique_ptr reporter_; unique_ptr manager_; map hide_map_; @@ -365,6 +527,12 @@ class DPMManager : public Manager { SetIndirectRequest(info, addedItem); + if (facade_->CheckAllowedToNotify(addedItem) == false) + return; + + facade_->SetDoNoDisturbPolicy(addedItem); + facade_->SetPopUpPolicy(addedItem); + ret = DBManager::InsertNotification(addedItem); if (ret == ERROR_NONE) { facade_->shared_file_.SetPrivateSharing(addedItem, @@ -392,6 +560,12 @@ class DPMManager : public Manager { UpdateHideApp(updatedItem); SetIndirectRequest(info, updatedItem); + if (facade_->CheckAllowedToNotify(updatedItem) == false) + return; + + facade_->SetDoNoDisturbPolicy(updatedItem); + facade_->SetPopUpPolicy(updatedItem); + ret = DBManager::UpdateNotification(updatedItem); if (ret == ERROR_NONE) { facade_->shared_file_.UpdatePrivateSharing(updatedItem, -- 2.7.4 From 85d4f0d763db082155b9ee4b98114f0c9855f4c1 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Fri, 31 Jan 2020 09:16:39 +0900 Subject: [PATCH 12/16] Release version 1.6.14 - Apply system setting to notification-ex Change-Id: Ibbcddeb4edd4910b910200dea65d22212f72b623 Signed-off-by: Jusung Son --- packaging/data-provider-master.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 packaging/data-provider-master.spec diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec old mode 100755 new mode 100644 index f4f4515..05d908c --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -2,7 +2,7 @@ Name: data-provider-master Summary: Master service provider for badge, shortcut, notification -Version: 1.6.13 +Version: 1.6.14 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From f61d9237387044b47991e4ad34e37c976ca8b3c3 Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Mon, 24 Feb 2020 18:06:40 +0900 Subject: [PATCH 13/16] Add to check the channel when delete all Change-Id: Ia76a79417dd5df9fe8cc02f470b3c485b227236a Signed-off-by: mk5004.lee --- src/notification_ex_service.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/notification_ex_service.cc b/src/notification_ex_service.cc index d4c1bcf..1982098 100644 --- a/src/notification_ex_service.cc +++ b/src/notification_ex_service.cc @@ -366,7 +366,7 @@ class DPMReporter : public Reporter { DBG("Delete !!!"); if (info.GetEventType() == IEventInfo::EventType::DeleteAll) { list> noti_list = - DBManager::GetNotificationList(facade_->GetUid(info)); + DBManager::GetNotificationList(facade_->GetUid(info), info.GetChannel()); for (auto& i : noti_list) { DoDelete(info, i); } @@ -598,10 +598,10 @@ class DPMManager : public Manager { DBG("Delete !!!"); if (info.GetEventType() == IEventInfo::EventType::DeleteAll) { list> noti_list = - DBManager::GetNotificationList(info.GetOwner(), facade_->GetUid(info)); - for (auto& i : noti_list) { + DBManager::GetNotificationList(info.GetOwner(), facade_->GetUid(info), + info.GetChannel()); + for (auto& i : noti_list) DoDelete(info, i); - } facade_->LaunchDefaultViewer(noti_list, NOTIFICATION_OP_DELETE_ALL); } else { int ret = DoDelete(info, deletedItem); -- 2.7.4 From 63cb055d8dca30942010c923918cc29a7988f683 Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Tue, 25 Feb 2020 13:21:50 +0900 Subject: [PATCH 14/16] Release version 1.6.15 - Add to check the channel when delete all Change-Id: I5ff0d0d4e5f34506e4ebd7e3565d59b9ad56f205 Signed-off-by: mk5004.lee --- packaging/data-provider-master.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 05d908c..6db87e4 100644 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -2,7 +2,7 @@ Name: data-provider-master Summary: Master service provider for badge, shortcut, notification -Version: 1.6.14 +Version: 1.6.15 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 1de84cfd63923e5321f70c32836aafd15dce1ad5 Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Wed, 4 Mar 2020 18:36:05 +0900 Subject: [PATCH 15/16] Add conditional statement to check the channel - OnReueestEvent - To suport reporter_get_by_channel, get_all Change-Id: I7423210a1c18544ca89deea52f04b9f2080d2fbd Signed-off-by: mk5004.lee --- src/badge_service.c | 0 src/main.cc | 0 src/notification_ex_service.cc | 17 +++++++++++------ src/notification_service.c | 0 src/pkgmgr.c | 0 src/service_common.c | 0 src/shortcut_service.c | 0 7 files changed, 11 insertions(+), 6 deletions(-) mode change 100755 => 100644 src/badge_service.c mode change 100755 => 100644 src/main.cc mode change 100755 => 100644 src/notification_service.c mode change 100755 => 100644 src/pkgmgr.c mode change 100755 => 100644 src/service_common.c mode change 100755 => 100644 src/shortcut_service.c diff --git a/src/badge_service.c b/src/badge_service.c old mode 100755 new mode 100644 diff --git a/src/main.cc b/src/main.cc old mode 100755 new mode 100644 diff --git a/src/notification_ex_service.cc b/src/notification_ex_service.cc index 1982098..50fefef 100644 --- a/src/notification_ex_service.cc +++ b/src/notification_ex_service.cc @@ -615,16 +615,21 @@ class DPMManager : public Manager { list> item_list; uid_t uid = facade_->GetUid(info); if (info.GetItemId().empty()) { - /* get */ - item_list = DBManager::GetNotificationList(info.GetOwner(), uid); - facade_->TranslateText(item_list); - - return item_list; + if (!info.GetChannel().empty()) { + /* get by channel */ + item_list = DBManager::GetNotificationList(info.GetOwner(), uid, info.GetChannel()); + facade_->TranslateText(item_list); + return item_list; + } else { + /* get all*/ + item_list = DBManager::GetNotificationList(info.GetOwner(), uid); + facade_->TranslateText(item_list); + return item_list; + } } else { /* FindByRootID */ item_list = DBManager::GetNotificationList(info.GetOwner(), info.GetItemId(), uid); facade_->TranslateText(item_list); - return item_list; } } diff --git a/src/notification_service.c b/src/notification_service.c old mode 100755 new mode 100644 diff --git a/src/pkgmgr.c b/src/pkgmgr.c old mode 100755 new mode 100644 diff --git a/src/service_common.c b/src/service_common.c old mode 100755 new mode 100644 diff --git a/src/shortcut_service.c b/src/shortcut_service.c old mode 100755 new mode 100644 -- 2.7.4 From e10d486484ec288323a635fe0c68c4048f5c9996 Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Fri, 6 Mar 2020 16:28:22 +0900 Subject: [PATCH 16/16] Release version 1.6.16 Add conditional statement to check the channel Change-Id: I9b4719454116df968b0f668437add3fa8f3c41c7 Signed-off-by: mk5004.lee --- packaging/data-provider-master.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 6db87e4..a259ddc 100644 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -2,7 +2,7 @@ Name: data-provider-master Summary: Master service provider for badge, shortcut, notification -Version: 1.6.15 +Version: 1.6.16 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4