Change rt for tech item. 71/162271/2
authorhhk86.heo <hhk86.heo@samsung.com>
Thu, 30 Nov 2017 05:29:37 +0000 (14:29 +0900)
committerSang-Hun Chung <sanghun.chung@samsung.com>
Mon, 4 Dec 2017 07:44:04 +0000 (07:44 +0000)
Change-Id: I673c2bcaafbc016c19648267fb1e2a3454d65875

inc/fmwup_resource_internal.h
src/fmwup_resource.c
src/fmwup_resource_internal.c

index d06a09498829a7ce06321d175ed6140f3d9fcdab..41f4a9c9c5d2bc937e3e35ff75a857304c5afdfd 100644 (file)
@@ -20,7 +20,8 @@
 
 #define OC_RSRVD_FIRMWARE_URI          "/firmware"
 //#ifdef _USE_WWST_
-#define OC_RSRVD_FIRMWARE_RES_TYPE                     "oic.r.firmware"
+//#define OC_RSRVD_FIRMWARE_RES_TYPE                   "oic.r.firmware"
+#define OC_RSRVD_FIRMWARE_RES_TYPE                     "x.samsung.firmware"
 //#else
 //#define OC_RSRVD_FIRMWARE_RES_TYPE                   "x.samsung.firmware"
 //#endif
index 496de1749b77f7deba02c684c918c0aeb4d8ef26..044b31c6f3d1b363b136f82c04938cdc93347732 100644 (file)
@@ -205,6 +205,9 @@ int fmwup_check_firmware_upgraded(void)
                FWR_LOGD("***Firmware Upgrade Done***");
 
                /* Initialize - new firmware information - */
+               g_free(g_firmware_resource->current_version);
+               g_firmware_resource->current_version = g_strdup(g_firmware_resource->new_version);
+
                g_free(g_firmware_resource->new_version);
                g_firmware_resource->new_version = g_strdup("");
                vconf_set_str(VCONF_FIRMWARE_UPDATE_PACKAGE_NEW_VERSION, "");
index 6dc9f486b2408ce168642c241b9d458752b8d4c0..a49468bbce9fbf6d0caef794d261b59a841f69c9 100644 (file)
@@ -127,12 +127,12 @@ void _handle_update_command(int64_t update_type)
 {
        FWR_ENTER
        int result = FMWUP_RESULT_INITIAL;
+       char *download_path = NULL;
 #ifdef _USE_WWST_
        char *res_header = NULL;
        char *res_body = NULL;
        char *request_uri = NULL;
        char *sec_download_url = NULL;
-       char *download_path = NULL;
 #endif
 
        if (g_strcmp0(g_firmware_resource->package_uri, "") == 0 ||
@@ -150,12 +150,12 @@ void _handle_update_command(int64_t update_type)
                FWR_LOGD("***Downloading image from [%s] ***", g_firmware_resource->package_uri);
                fmwup_propagate_firmware_status_resource(FMWUP_STATE_DOWNLOADING, FMWUP_RESULT_INITIAL, true);
 
+               download_path = g_strconcat(g_download_path, FIRMWARE_FILE_NAME, NULL);
 #ifdef _USE_WWST_
 
                //request_uri = g_strconcat(g_firmware_resource->package_uri, REST_API_DOWNLOAD_URL, CURRENT_VERSION,
                //                                      g_firmware_resource->current_version, TOKEN, TOKEN_KEY_TEMP, NULL);
                request_uri = g_strconcat(g_firmware_resource->package_uri, NULL);
-               download_path = g_strconcat(g_download_path, FIRMWARE_FILE_NAME, NULL);
 
                FWR_LOGI("request_uri[%s]", request_uri);
 
@@ -184,7 +184,7 @@ void _handle_update_command(int64_t update_type)
                }
 
 #else
-               if (fmwup_http_download_file(g_firmware_resource->package_uri, (const char *)g_download_path) != 0) {
+               if (fmwup_http_download_file(g_firmware_resource->package_uri, (const char *)download_path) != 0) {
                        FWR_LOGE("fmwup_http_download_file failed");
                        result = FMWUP_RESULT_INVALID_URL;
                        goto _END_OF_FUNC_;
@@ -200,7 +200,7 @@ void _handle_update_command(int64_t update_type)
                fmwup_propagate_firmware_status_resource(FMWUP_STATE_UPDATING, FMWUP_RESULT_INITIAL, true);
 
                /* request to update by dbus (fota client) */
-               if (fmwup_dbus_exec_update(g_download_path) != 0) {
+               if (fmwup_dbus_exec_update(download_path) != 0) {
                        FWR_LOGE("Fota client update failed");
                        result = FMWUP_RESULT_UPDATE_FAILED;
                        goto _END_OF_FUNC_;
@@ -216,10 +216,10 @@ _END_OF_FUNC_:
 #ifdef _USE_WWST_
        g_free(res_header);
        g_free(res_body);
-       g_free(download_path);
        g_free(sec_download_url);
        g_free(request_uri);
 #endif
+       g_free(download_path);
 
        FWR_EXIT
        return;
@@ -524,18 +524,23 @@ void fmwup_get_firmware_info(fmwup_s *firmware_info)
 #else
        if (system_info_get_platform_string("http://tizen.org/system/manufacturer", &manufacturer)
                != SYSTEM_INFO_ERROR_NONE) {
-               FWR_LOGD("system_info_get_platform_string() is failed");
+               FWR_LOGD("system_info_get_platform_string() manufacturer is failed");
        }
 
        if (system_info_get_platform_string("http://tizen.org/system/model_name", &model_name)
                != SYSTEM_INFO_ERROR_NONE) {
-               FWR_LOGD("system_info_get_platform_string() is failed");
+               FWR_LOGD("system_info_get_platform_string() model_name is failed");
        }
 
-       if (system_info_get_platform_string("http://tizen.org/system/build.version.release", &cur_firmware_ver)
-               != SYSTEM_INFO_ERROR_NONE) {
-               FWR_LOGD("system_info_get_platform_string() is failed");
+       if (system_info_get_platform_string("http://tizen.org/system/build.date", &cur_firmware_ver)
+                       != SYSTEM_INFO_ERROR_NONE) {
+               FWR_LOGD("system_info_get_platform_string() build.date is failed");
        }
+
+//     if (system_info_get_platform_string("http://tizen.org/system/build.version.release", &cur_firmware_ver)
+//             != SYSTEM_INFO_ERROR_NONE) {
+//             FWR_LOGD("system_info_get_platform_string() is failed");
+//     }
 #endif
 
        if (vconf_get_int(VCONF_FIRMWARE_UPDATE_STATE, &update_state) != 0) {