static int __set_notification(notification_h noti_handle, app_control_h app_control)
{
int ret = 0;
- char *mode = NULL;
- char *noti_text[2][2] = {
- {"IDS_TPLATFORM_HEADER_SEPARATE_ZONE_ABB", "IDS_TPLATFORM_SBODY_TAP_HERE_TO_CREATE_PS_ABB"},
- {"IDS_TPLATFORM_HEADER_SEPARATE_ZONE_ABB", "IDS_TPLATFORM_SBODY_TAP_HERE_TO_DELETE_PS_ABB"}
- };
- char **text = NULL;
+ char *mode = NULL;
+ char *noti_text[2][2] = {
+ {"IDS_TPLATFORM_HEADER_SEPARATE_ZONE_ABB", "IDS_TPLATFORM_SBODY_TAP_HERE_TO_CREATE_PS_ABB"},
+ {"IDS_TPLATFORM_HEADER_SEPARATE_ZONE_ABB", "IDS_TPLATFORM_SBODY_TAP_HERE_TO_DELETE_PS_ABB"}
+ };
+ char **text = NULL;
char noti_content_text[PATH_MAX] = "";
char *krate_name = NULL;
- if (app_control_get_extra_data(app_control, "mode", &mode) != APP_CONTROL_ERROR_NONE)
- return -1;
+ if (app_control_get_extra_data(app_control, "mode", &mode) != APP_CONTROL_ERROR_NONE)
+ return -1;
- if (!strcmp(mode, "create"))
- text = noti_text[0];
- else
- text = noti_text[1];
+ if (!strcmp(mode, "create"))
+ text = noti_text[0];
+ else
+ text = noti_text[1];
- ret = notification_set_text(noti_handle, NOTIFICATION_TEXT_TYPE_TITLE, __(text[0]), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- if (ret != NOTIFICATION_ERROR_NONE)
- return -1;
+ ret = notification_set_text(noti_handle, NOTIFICATION_TEXT_TYPE_TITLE, __(text[0]), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+ if (ret != NOTIFICATION_ERROR_NONE)
+ return -1;
ret = app_control_get_extra_data(app_control, "krate", &krate_name);
if (ret != APP_CONTROL_ERROR_NONE)
snprintf(noti_content_text, PATH_MAX, __(text[1]), krate_name);
- ret = notification_set_text(noti_handle, NOTIFICATION_TEXT_TYPE_CONTENT, noti_content_text, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- if (ret != NOTIFICATION_ERROR_NONE)
- return -1;
+ ret = notification_set_text(noti_handle, NOTIFICATION_TEXT_TYPE_CONTENT, noti_content_text, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+ if (ret != NOTIFICATION_ERROR_NONE)
+ return -1;
- ret = notification_set_display_applist(noti_handle, NOTIFICATION_DISPLAY_APP_ALL);
- if (ret != NOTIFICATION_ERROR_NONE)
- return -1;
+ ret = notification_set_display_applist(noti_handle, NOTIFICATION_DISPLAY_APP_ALL);
+ if (ret != NOTIFICATION_ERROR_NONE)
+ return -1;
- ret = notification_set_image(noti_handle, NOTIFICATION_IMAGE_TYPE_THUMBNAIL, DPM_SYSPOPUP_ICON_PATH);
- if (ret != NOTIFICATION_ERROR_NONE)
- return -1;
+ ret = notification_set_image(noti_handle, NOTIFICATION_IMAGE_TYPE_THUMBNAIL, DPM_SYSPOPUP_ICON_PATH);
+ if (ret != NOTIFICATION_ERROR_NONE)
+ return -1;
- ret = notification_set_launch_option(noti_handle, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, app_control);
- if (ret != NOTIFICATION_ERROR_NONE)
- return -1;
+ ret = notification_set_launch_option(noti_handle, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, app_control);
+ if (ret != NOTIFICATION_ERROR_NONE)
+ return -1;
- return ret;
+ return ret;
}
void _create_notification(app_control_h app_control)
{
notification_h noti_handle = NULL;
- int ret = 0;
+ int ret = 0;
- noti_handle = notification_create(NOTIFICATION_TYPE_NOTI);
+ noti_handle = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = __set_notification(noti_handle, app_control);
- if (ret != NOTIFICATION_ERROR_NONE) {
- notification_free(noti_handle);
- app_control_destroy(app_control);
- return;
- }
+ ret = __set_notification(noti_handle, app_control);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti_handle);
+ app_control_destroy(app_control);
+ return;
+ }
- notification_post(noti_handle);
- notification_free(noti_handle);
- app_control_destroy(app_control);
+ notification_post(noti_handle);
+ notification_free(noti_handle);
+ app_control_destroy(app_control);
- return;
+ return;
}