ret = notification_load_detail_list(parameters, &reply_body, uid);
else if (g_strcmp0(method_name, "get_setting_array") == 0)
ret = notification_get_setting_array(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "get_setting_by_package_name") == 0)
- ret = notification_get_setting_by_package_name(parameters, &reply_body, uid);
+ else if (g_strcmp0(method_name, "get_setting_by_appid") == 0)
+ ret = notification_get_setting_by_appid(parameters, &reply_body, uid);
else if (g_strcmp0(method_name, "load_system_setting") == 0)
ret = notification_load_system_setting(parameters, &reply_body, uid);
else if (g_strcmp0(method_name, "save_as_template") == 0)
" <method name='update_noti_setting'>"
" <arg type='s' name='pkgname' direction='in'/>"
+ " <arg type='s' name='appid' direction='in'/>"
" <arg type='i' name='allow_to_notify' direction='in'/>"
" <arg type='i' name='do_not_disturb_except' direction='in'/>"
" <arg type='i' name='visibility_class' direction='in'/>"
" <arg type='a(v)' name='setting_arr' direction='out'/>"
" </method>"
- " <method name='get_setting_by_package_name'>"
- " <arg type='s' name='pkgname' direction='in'/>"
+ " <method name='get_setting_by_appid'>"
+ " <arg type='s' name='appid' direction='in'/>"
" <arg type='i' name='uid' direction='in'/>"
" <arg type='v' name='setting' direction='out'/>"
" </method>"
" </method>"
" <method name='get_noti_block_state'>"
- " <arg type='s' name='pkgname' direction='in'/>"
+ " <arg type='s' name='appid' direction='in'/>"
" <arg type='i' name='uid' direction='in'/>"
" <arg type='v' name='state' direction='out'/>"
" </method>"
if (temp->package_name)
free(temp->package_name);
+ if (temp->appid)
+ free(temp->appid);
}
free(setting_array);
}
return ret;
}
-/* get_setting_array */
-int notification_get_setting_by_package_name(GVariant *parameters, GVariant **reply_body, uid_t uid)
+/* get_setting_by_appid */
+int notification_get_setting_by_appid(GVariant *parameters, GVariant **reply_body, uid_t uid)
{
int ret;
GVariant *body;
- char *pkgname = NULL;
+ char *appid = NULL;
notification_setting_h setting = NULL;
uid_t param_uid;
- g_variant_get(parameters, "(&si)", &pkgname, ¶m_uid);
+ g_variant_get(parameters, "(&si)", &appid, ¶m_uid);
ret = _validate_and_set_param_uid_with_uid(uid, ¶m_uid);
if (ret != NOTIFICATION_ERROR_NONE)
return ret;
- DbgPrint("get setting by pkgname : %s", pkgname);
+ DbgPrint("get setting by appid : %s uid : %d", appid, param_uid);
- ret = noti_setting_service_get_setting_by_package_name(pkgname, &setting, param_uid);
+ ret = noti_setting_service_get_setting_by_appid(appid, &setting, param_uid);
if (ret == NOTIFICATION_ERROR_NONE) {
body = notification_ipc_make_gvariant_from_setting(setting);
notification_setting_free_notification(setting);
{
int ret;
char *pkgname = NULL;
+ char *appid = NULL;
int allow_to_notify = 0;
int do_not_disturb_except = 0;
int visivility_class = 0;
int lock_screen_content_level = 0;
uid_t param_uid;
- g_variant_get(parameters, "(&siiiiii)",
+ g_variant_get(parameters, "(&s&siiiiii)",
&pkgname,
+ &appid,
&allow_to_notify,
&do_not_disturb_except,
&visivility_class,
if (ret != NOTIFICATION_ERROR_NONE)
return ret;
- DbgPrint("package_name: [%s] allow_to_notify: [%d] do_not_disturb_except: [%d] visivility_class: [%d] pop_up_notification: [%d] lock_screen_content_level: [%d]\n",
- pkgname, allow_to_notify, do_not_disturb_except, visivility_class, pop_up_notification, lock_screen_content_level);
+ DbgPrint("package_name: [%s] appid: [%s] allow_to_notify: [%d] do_not_disturb_except: [%d] visivility_class: [%d] pop_up_notification: [%d] lock_screen_content_level: [%d]\n",
+ pkgname, appid, allow_to_notify, do_not_disturb_except, visivility_class, pop_up_notification, lock_screen_content_level);
- ret = notification_setting_db_update(pkgname, allow_to_notify, do_not_disturb_except, visivility_class,
+ ret = notification_setting_db_update(pkgname, appid, allow_to_notify, do_not_disturb_except, visivility_class,
pop_up_notification, lock_screen_content_level, param_uid);
if (ret != NOTIFICATION_ERROR_NONE) {
ErrPrint("failed to setting db update : %d\n", ret);
int dnd;
int dnd_except;
int allow_to_notify;
- char *pkgname;
+ char *appid;
uid_t param_uid;
GVariant *body = NULL;
- g_variant_get(parameters, "(&si)", &pkgname, ¶m_uid);
+ g_variant_get(parameters, "(&si)", &appid, ¶m_uid);
ret = _validate_and_set_param_uid_with_uid(uid, ¶m_uid);
if (ret != NOTIFICATION_ERROR_NONE) {
return NOTIFICATION_ERROR_IO_ERROR;
}
- ret = notification_get_dnd_and_allow_to_notify(pkgname, &dnd, &dnd_except, &allow_to_notify, param_uid);
+ ret = notification_get_dnd_and_allow_to_notify(appid, &dnd, &dnd_except, &allow_to_notify, param_uid);
if (ret != NOTIFICATION_ERROR_NONE) {
ErrPrint("failed to get_dnd_and_allow_to_notify : %d\n", ret);
return ret;
static int _package_install_cb(uid_t uid, const char *pkgname, enum pkgmgr_status status, double value, void *data)
{
- notification_setting_insert_package_for_uid(pkgname, uid);
+ if (status == PKGMGR_STATUS_END)
+ notification_setting_insert_package_for_uid(pkgname, uid);
return 0;
}
static int _package_uninstall_cb(uid_t uid, const char *pkgname, enum pkgmgr_status status, double value, void *data)
{
- notification_setting_delete_package_for_uid(pkgname, uid);
- notification_noti_delete_template(pkgname);
+ if (status == PKGMGR_STATUS_END) {
+ notification_setting_delete_package_for_uid(pkgname, uid);
+ notification_noti_delete_template(pkgname);
+ }
return 0;
}