if (ret != BADGE_ERROR_NONE)
return ret;
- if (pkgname != NULL)
+ if (pkgname != NULL) {
+ if (need_to_reload_pkginfo_for_badge) {
+ badge_setting_refresh_setting_table(tzplatform_getuid(TZ_SYS_DEFAULT_USER));
+ need_to_reload_pkginfo_for_badge = 0;
+ }
ret = badge_db_is_existing(pkgname, &existing, param_uid);
- else
+ } else {
return BADGE_ERROR_INVALID_PARAMETER;
+ }
if (ret != BADGE_ERROR_NONE) {
ErrPrint("failed to get badge existing :%d\n", ret);
if (ret != BADGE_ERROR_NONE)
return ret;
- if (pkgname != NULL && writable_pkg != NULL && caller != NULL)
+ if (pkgname != NULL && writable_pkg != NULL && caller != NULL) {
+ if (need_to_reload_pkginfo_for_badge) {
+ badge_setting_refresh_setting_table(tzplatform_getuid(TZ_SYS_DEFAULT_USER));
+ need_to_reload_pkginfo_for_badge = 0;
+ }
ret = badge_db_insert(pkgname, writable_pkg, caller, param_uid);
- else
+ } else {
return BADGE_ERROR_INVALID_PARAMETER;
+ }
if (ret != BADGE_ERROR_NONE) {
ErrPrint("failed to insert badge :%d\n", ret);
return ret;
}
- if (need_to_reload_pkginfo_for_badge) {
- badge_setting_refresh_setting_table(tzplatform_getuid(TZ_SYS_DEFAULT_USER));
- need_to_reload_pkginfo_for_badge = 0;
- }
+
ret = badge_db_get_allow_to_display_by_appid(pkgname, &allow_to_display, param_uid);
if (ret != BADGE_ERROR_NONE) {
if (ret != BADGE_ERROR_NONE)
return ret;
- if (pkgname != NULL && caller != NULL)
+ if (pkgname != NULL && caller != NULL) {
+ if (need_to_reload_pkginfo_for_badge) {
+ badge_setting_refresh_setting_table(tzplatform_getuid(TZ_SYS_DEFAULT_USER));
+ need_to_reload_pkginfo_for_badge = 0;
+ }
ret = badge_db_set_count(pkgname, caller, count, param_uid);
- else
+ } else {
return BADGE_ERROR_INVALID_PARAMETER;
+ }
if (ret != BADGE_ERROR_NONE) {
ErrPrint("failed to set badge :%d\n", ret);
#include <notification_noti.h>
#include <badge_setting.h>
#include <badge_setting_service.h>
+#include <badge_db.h>
#include <package-manager.h>
#include <tzplatform_config.h>
if (uid == tzplatform_getuid(TZ_SYS_GLOBALAPP_USER))
uid = tzplatform_getuid(TZ_SYS_DEFAULT_USER);
notification_setting_delete_package_for_uid(pkgname, uid);
+ badge_db_delete_by_pkgname(pkgname, uid);
badge_setting_delete_package_for_uid(pkgname, uid);
notification_noti_delete_template(pkgname);
}