From 94a46fbd63e3ea1abfdc5f518be311d4b979194d Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 11 Aug 2020 21:03:44 +0900 Subject: [PATCH] Fix bug not to send sticker count in manual request mode Change-Id: I08d4ac51189d9637f525be0a6fd24830faa11e35 Signed-off-by: Jihoon Kim --- receiver/src/main.cpp | 109 ++++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/receiver/src/main.cpp b/receiver/src/main.cpp index 07e6a24..7fa1a9f 100644 --- a/receiver/src/main.cpp +++ b/receiver/src/main.cpp @@ -195,10 +195,15 @@ static void app_control(app_control_h app_control, void *data) request_sticker_feature(); request_auto_sync(); } + else { + if (!get_job_progress()) { + STLOGD("exit"); + service_app_exit(); + } + } } else { - if (!get_job_progress()) - { + if (!get_job_progress()) { STLOGD("exit"); service_app_exit(); } @@ -215,63 +220,63 @@ static void app_control(app_control_h app_control, void *data) } } else if (strcmp(operation, APP_CONTROL_OPERATION_DEFAULT) == 0) { -#ifdef VCONFKEY_STICKER_SUPPORTED_FEATURE - // Check whether oobe has been done - int feature_flag = 0; - if (vconf_get_int(VCONFKEY_STICKER_SUPPORTED_FEATURE, &feature_flag) == 0 && feature_flag == 0) { - STLOGD("Request to get sticker feature"); - initialize_sap(); - request_sticker_feature(); - } - else { - if (!is_init_sap()) - service_app_exit(); - } -#endif - } - } - else { - STLOGW("Failed to get operation. error : %d", ret); - } - - // sync request - res = app_control_get_extra_data(app_control, "request", &request); - if (APP_CONTROL_ERROR_NONE == res && NULL != request) { - if (strcmp(request, "sync") == 0) { - bool param_error = false; - if (app_control_get_extra_data(app_control, "mode", &mode) != APP_CONTROL_ERROR_NONE) { - STLOGE("No given mode"); - param_error = true; - } + // sync request + res = app_control_get_extra_data(app_control, "request", &request); + if (APP_CONTROL_ERROR_NONE == res && NULL != request) { + if (strcmp(request, "sync") == 0) { + bool param_error = false; + if (app_control_get_extra_data(app_control, "mode", &mode) != APP_CONTROL_ERROR_NONE) { + STLOGE("No given mode"); + param_error = true; + } - if (app_control_get_extra_data(app_control, "type", &type) != APP_CONTROL_ERROR_NONE) { - STLOGE("No given type"); - param_error = true; - } + if (app_control_get_extra_data(app_control, "type", &type) != APP_CONTROL_ERROR_NONE) { + STLOGE("No given type"); + param_error = true; + } - STLOGI("[sync request] mode : %s, type : %s", mode, type); - if (param_error) - goto cleanup; + STLOGI("[sync request] mode : %s, type : %s", mode, type); + if (param_error) + goto cleanup; - if (mode && type) { - if (!is_init_sap()) { + if (mode && type) { + if (!is_init_sap()) { + initialize_sap(); + request_all_sticker_data(mode, type); + } + } + } + else if (strcmp(request, "oobe") == 0) { initialize_sap(); - request_all_sticker_data(mode, type); + request_sticker_feature(); + } + else { + STLOGW("Unknown command : %s", request); + if (!is_init_sap()) { + service_app_exit(); + } + } + } // end of request + else { + STLOGD("booting"); +#ifdef VCONFKEY_STICKER_SUPPORTED_FEATURE + // Check whether oobe has been done + int feature_flag = 0; + if (vconf_get_int(VCONFKEY_STICKER_SUPPORTED_FEATURE, &feature_flag) == 0 && feature_flag == 0) { + STLOGD("Request to get sticker feature"); + initialize_sap(); + request_sticker_feature(); + } + else { + if (!is_init_sap()) + service_app_exit(); } } +#endif } - else if (strcmp(request, "oobe") == 0) { - initialize_sap(); - request_sticker_feature(); - } - else - { - STLOGW("Unknown command : %s", request); - if (!is_init_sap()) - { - service_app_exit(); - } - } + } + else { + STLOGW("Failed to get operation. error : %d", ret); } cleanup: -- 2.7.4