Set first sync complete 50/229150/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 30 Mar 2020 05:46:28 +0000 (14:46 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 30 Mar 2020 05:46:54 +0000 (14:46 +0900)
Change-Id: I71eebf7c1caa0667f283da1bf042238488116f98
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
receiver/src/ft.cpp

index 1408aa7..8f81c0a 100644 (file)
 #define STICKER_SEND_STOP_REQ  "sticker-send-stop-req"
 #define STICKER_SEND_STOP_RSP  "sticker-send-stop-rsp"
 
+#ifndef VCONFKEY_STICKER_SYNC_COMPLETE_DONE
+#define VCONFKEY_STICKER_SYNC_COMPLETE_DONE 0x1
+#endif
+
 using namespace std;
 
 enum {
@@ -571,21 +575,30 @@ on_data_received(sap_socket_h socket, unsigned short int channel_id, unsigned in
         }
         else {
             int complete_flags = 0;
-            if (vconf_get_int(VCONFKEY_STICKER_SYNC_COMPLETE, &complete_flags) == 0) {
-                if (sticker_data.group == string("arsticker"))
-                    complete_flags |= 0x1;
-                else if (sticker_data.group == string("bitmoji"))
-                    complete_flags |= 0x2;
-
-                LOGD("sync complete flag : %x", complete_flags);
-
-                if (vconf_set_int(VCONFKEY_STICKER_SYNC_COMPLETE, complete_flags) == 0)
-                    LOGD("Succeed to set sync complete");
-                else
-                    LOGW("Fail to set sync complete");
-            }
-            else {
-                LOGW("Failed to get sticker sync flags");
+
+            int feature_flag = 0;
+            if (vconf_get_int(VCONFKEY_STICKER_SYNC_COMPLETE, &complete_flags) == 0 && complete_flags == 0) {
+#ifdef VCONFKEY_STICKER_SUPPORTED_FEATURE
+                if (vconf_get_int(VCONFKEY_STICKER_SUPPORTED_FEATURE, &feature_flag) == 0) {
+                    if (feature_flag == VCONFKEY_STICKER_FEATURE_AREMOJI) {
+                        if (sticker_data.group == string("arsticker")) {
+                            complete_flags = VCONFKEY_STICKER_SYNC_COMPLETE_DONE;
+                        }
+                    }
+                    else if (feature_flag & VCONFKEY_STICKER_FEATURE_BITMOJI) {
+                        if (sticker_data.group == string("bitmoji")) {
+                            complete_flags = VCONFKEY_STICKER_SYNC_COMPLETE_DONE;
+                        }
+                    }
+
+                    LOGD("sync complete flag : %x", complete_flags);
+
+                    if (vconf_set_int(VCONFKEY_STICKER_SYNC_COMPLETE, complete_flags) == 0)
+                        LOGD("Succeed to set sync complete");
+                    else
+                        LOGW("Fail to set sync complete");
+                }
+#endif /* VCONFKEY_STICKER_SUPPORTED_FEATURE */
             }
 
             json_object_set_string_member(j_object, "result", "success");