TSAM-9601[SE][Ref.App][Tizen_3.0_Public_Final_RC1][Mobile][Email][MenuTree] Default... 03/104203/2 submit/tizen_3.0/20161213.095618
authorIgor Olshevskyi <i.olshevskyi@samsung.com>
Mon, 12 Dec 2016 15:56:27 +0000 (17:56 +0200)
committerIgor Olshevskyi <i.olshevskyi@samsung.com>
Tue, 13 Dec 2016 09:21:49 +0000 (01:21 -0800)
Change-Id: Ie165a3e5953ac00ad36ccb40ea36449561498c87

modules/setting/inc/email-setting.h
modules/setting/src/email-view-notification.c

index 41e94ce..5181ee7 100644 (file)
@@ -41,7 +41,7 @@
 
 #define _EDJ(o) elm_layout_edje_get(o)
 
-#define DEFAULT_EMAIL_RINGTONE_PATH "/opt/usr/share/settings/Alerts/Postman(Default_Email).ogg"
+#define DEFAULT_EMAIL_RINGTONE_PATH "/opt/share/settings/Alerts/General notification_sdk.wav"
 
 enum _ViewType {
        VIEW_SETTING = 1000,
index 7de555b..b8243e5 100644 (file)
@@ -76,11 +76,12 @@ typedef struct _ListItemData {
        EmailSettingView *view;
 } ListItemData;
 
-#define SETTING_DEFAULT_ALERT_PATH    "/opt/usr/share/settings/Alerts"
-#define MYFILE_SILENT_RINGTON_VALUE   "silent"
+#define SETTING_DEFAULT_ALERT_PATH       "/opt/share/settings/Alerts"
+#define SETTING_SILENT_RINGTON_VALUE     "silent"
+#define SETTING_DATA_DEF_SUBSTITUTION    "default_substitution"
 
-#define APP_CONTROL_RINGTONE_IS_DEFAULT "is_default"
-#define APP_CONTROL_RINGTONE_TRUE       "true"
+#define SETTING_APP_CONTROL_RINGTONE_IS_DEF "is_default"
+#define SETTING_APP_CONTROL_RINGTONE_TRUE   "true"
 
 void create_notification_setting_view(EmailSettingModule *module)
 {
@@ -314,9 +315,11 @@ static void _alert_ringtone_setup_cb(void *data, Evas_Object *obj, void *event_i
        email_params_h params = NULL;
        const char *alert_folder_path = SETTING_DEFAULT_ALERT_PATH;
        const char *ringtone_file_path = view->account_data->options.alert_ringtone_path;
+       const char *def_ringtone_file_path = DEFAULT_EMAIL_RINGTONE_PATH;
 
        if (email_params_create(&params)
                        && email_params_add_str_array(params, APP_CONTROL_DATA_PATH, &alert_folder_path, 1)
+                       && email_params_add_str(params, SETTING_DATA_DEF_SUBSTITUTION, def_ringtone_file_path)
                        && (view->account_data->options.default_ringtone_status || !STR_VALID(ringtone_file_path)
                                                        || email_params_add_str_array(params, APP_CONTROL_DATA_SELECTED, &ringtone_file_path, 1))) {
                email_launched_app_listener_t listener = { 0 };
@@ -358,17 +361,17 @@ static void _ringtone_app_reply_cb(void *data, app_control_result_e result, emai
        debug_secure("ringtone_path: %s", ringtone_path);
 
        const char *is_ringtone_def = NULL;
-       if (!email_params_get_str(reply, APP_CONTROL_RINGTONE_IS_DEFAULT, &is_ringtone_def)) {
+       if (!email_params_get_str(reply, SETTING_APP_CONTROL_RINGTONE_IS_DEF, &is_ringtone_def)) {
                debug_log("ringtone is not default");
        }
 
-       if (!g_strcmp0(APP_CONTROL_RINGTONE_TRUE, is_ringtone_def)) {
+       if (!g_strcmp0(SETTING_APP_CONTROL_RINGTONE_TRUE, is_ringtone_def)) {
                if (li->index == ALERT_RINGTONE_LIST_ITEM) {
                        view->account_data->options.default_ringtone_status = 1;
                        FREE(view->account_data->options.alert_ringtone_path);
                        view->account_data->options.alert_ringtone_path = strdup(DEFAULT_EMAIL_RINGTONE_PATH);
                }
-       } else if (!g_strcmp0(MYFILE_SILENT_RINGTON_VALUE, ringtone_path)) {
+       } else if (!g_strcmp0(SETTING_SILENT_RINGTON_VALUE, ringtone_path)) {
                if (li->index == ALERT_RINGTONE_LIST_ITEM) {
                        view->account_data->options.default_ringtone_status = 0;
                        FREE(view->account_data->options.alert_ringtone_path);