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;
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);
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));