Fix bug not to send sticker count in manual request mode 01/240801/3
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 11 Aug 2020 12:03:44 +0000 (21:03 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 11 Aug 2020 12:22:03 +0000 (21:22 +0900)
Change-Id: I08d4ac51189d9637f525be0a6fd24830faa11e35
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
receiver/src/main.cpp

index 07e6a24..7fa1a9f 100644 (file)
@@ -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: