diff options
author | Hyunho Kang <hhstark.kang@samsung.com> | 2016-03-02 12:05:30 +0900 |
---|---|---|
committer | Hyunho Kang <hhstark.kang@samsung.com> | 2016-03-02 12:57:19 +0900 |
commit | 9d69417ba43851c4d3cbd7aefc47e768b0d088de (patch) | |
tree | 1d56ece279f7e0aa9567e9579f3fe23bcd585365 /src/badge.c | |
parent | 7a921c23eda65df846950442e7f2d284d2c51b13 (diff) | |
parent | 9aa2bf03acb3ef7bb53cc06ad5eb508bb4d5ad1f (diff) | |
download | badge-9d69417ba43851c4d3cbd7aefc47e768b0d088de.tar.gz badge-9d69417ba43851c4d3cbd7aefc47e768b0d088de.tar.bz2 badge-9d69417ba43851c4d3cbd7aefc47e768b0d088de.zip |
Merge remote-tracking branch 'origin/tizen_3.0_dbus' into tizen
Change-Id: Iead6d3307ec8cd81ff24cfaac07695a74880a959
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
Diffstat (limited to 'src/badge.c')
-rwxr-xr-x | src/badge.c | 58 |
1 files changed, 49 insertions, 9 deletions
diff --git a/src/badge.c b/src/badge.c index f333dde..eb47465 100755 --- a/src/badge.c +++ b/src/badge.c @@ -114,6 +114,19 @@ int badge_remove(const char *app_id) if (app_id == NULL) return BADGE_ERROR_INVALID_PARAMETER; + result = _badge_is_existing(app_id, &existing); + + if (result != BADGE_ERROR_NONE) { + ERR("_badge_is_existing failed [%x]", result); + goto out; + } + + if (existing == false) { + ERR("app_id is not exist [%s]", app_id); + result = BADGE_ERROR_NOT_EXIST; + goto out; + } + caller = _badge_get_pkgname_by_pid(); if (!caller) { ERR("fail to get caller pkgname"); @@ -135,13 +148,6 @@ int badge_is_existing(const char *app_id, bool *existing) return _badge_is_existing(app_id, existing); } - -EXPORT_API -int badge_foreach_existed(badge_cb callback, void *data) -{ - return _badge_foreach_existed((badge_foreach_cb)callback, data); -} - EXPORT_API int badge_foreach(badge_foreach_cb callback, void *user_data) { @@ -158,6 +164,21 @@ int badge_set_count(const char *app_id, unsigned int count) if (app_id == NULL) return BADGE_ERROR_INVALID_PARAMETER; + DBG("app_id %s, count %d", app_id, count); + + result = _badge_is_existing(app_id, &existing); + + if (result != BADGE_ERROR_NONE) { + ERR("_badge_is_existing failed [%x]", result); + goto out; + } + + if (existing == false) { + ERR("app_id is not exist [%s]", app_id); + result = BADGE_ERROR_NOT_EXIST; + goto out; + } + caller = _badge_get_pkgname_by_pid(); if (!caller) { ERR("fail to get caller pkgname"); @@ -175,7 +196,10 @@ out: EXPORT_API int badge_get_count(const char *app_id, unsigned int *count) { - return _badget_get_count(app_id, count); + if (app_id == NULL || count == NULL) + return BADGE_ERROR_INVALID_PARAMETER; + + return badge_ipc_request_get_count(app_id, count); } EXPORT_API @@ -188,6 +212,19 @@ int badge_set_display(const char *app_id, unsigned int is_display) if (app_id == NULL) return BADGE_ERROR_INVALID_PARAMETER; + result = _badge_is_existing(app_id, &existing); + + if (result != BADGE_ERROR_NONE) { + ERR("_badge_is_existing failed [%x]", result); + goto out; + } + + if (existing == false) { + ERR("app_id is not exist [%s]", app_id); + result = BADGE_ERROR_NOT_EXIST; + goto out; + } + caller = _badge_get_pkgname_by_pid(); if (!caller) { ERR("fail to get caller pkgname"); @@ -206,7 +243,10 @@ out: EXPORT_API int badge_get_display(const char *app_id, unsigned int *is_display) { - return _badget_get_display(app_id, is_display); + if (app_id == NULL || is_display == NULL) + return BADGE_ERROR_INVALID_PARAMETER; + + return badge_ipc_request_get_display(app_id, is_display); } EXPORT_API |