1.Updated heremaps-uc app. 77/56677/3
authorchanywa <cbible.kim@samsung.com>
Tue, 12 Jan 2016 02:38:20 +0000 (11:38 +0900)
committerchanywa <cbible.kim@samsung.com>
Wed, 10 Feb 2016 23:29:52 +0000 (08:29 +0900)
2.Fixed to convert distance values with the distance unit in preference.
3.Rearranged some apis for search_place.
4.Updated engine libraries to heremaps-engine_1.0.6_9

Change-Id: I2d772991d63be8f9d6c375faa9d75c1ceae45c1b

heremaps-uc/src/heremaps-uc.c
inc/engine/routes/GeoRouteQuery.h
lib/aarch64/libheremaps-engine.so.1
lib/aarch64/libheremaps-engine.so.1.0.6_9 [moved from lib/aarch64/libheremaps-engine.so.1.0.6_8 with 83% similarity]
lib/arm/libheremaps-engine.so.1
lib/arm/libheremaps-engine.so.1.0.6_9 [moved from lib/arm/libheremaps-engine.so.1.0.6_8 with 77% similarity]
lib/i586/libheremaps-engine.so.1
lib/i586/libheremaps-engine.so.1.0.6_9 [moved from lib/i586/libheremaps-engine.so.1.0.6_8 with 78% similarity]
lib/x86_64/libheremaps-engine.so.1
lib/x86_64/libheremaps-engine.so.1.0.6_9 [moved from lib/x86_64/libheremaps-engine.so.1.0.6_8 with 80% similarity]
src/here_place.cpp

index f4bde77..2621092 100644 (file)
@@ -60,6 +60,43 @@ static void win_del(void *data, Evas_Object * obj, void *event)
        elm_exit();
 }
 
+static void read_file(heremaps_uc_app_data *ad)
+{
+       LS_FUNC_ENTER
+       FILE *fp = fopen(UC_FILE, "r");
+       char buf[15] = {};
+       char *data = NULL, *save_token = NULL;
+       app_control_h reply;
+       int ret = 0;
+
+       if (fp == NULL)
+               LS_LOGE("UC_FILE open fail");
+       else {
+               ret = fread(buf, 15, 1, fp);
+               fclose(fp);
+
+               if (ret > 0)
+               {
+                       data = strtok_r(buf, "=", &save_token);
+                       data = strtok_r(NULL, "=", &save_token);
+               }
+               else
+                       LS_LOGE("UC_FILE read fail");
+       }
+
+       app_control_create(&reply);
+       if (data == NULL)
+               app_control_add_extra_data(reply, "result", "No");
+       else if ((strcmp(data, "Yes") == 0) || (strcmp(data, "No") == 0))
+               app_control_add_extra_data(reply, "result", data);
+       else
+               app_control_add_extra_data(reply, "result", "No");
+       ret = app_control_reply_to_launch_request(reply, ad->app_control, APP_CONTROL_RESULT_SUCCEEDED);
+       if (ret != APP_CONTROL_ERROR_NONE)
+               LS_LOGE("app_control_reply_to_launch_request fail. err=%d", ret);
+       app_control_destroy(reply);
+}
+
 static void save_file(char *data, heremaps_uc_app_data *ad)
 {
        FILE *fp = fopen(UC_FILE, "w+");
@@ -67,12 +104,20 @@ static void save_file(char *data, heremaps_uc_app_data *ad)
        app_control_h reply;
        int ret = 0;
 
-       snprintf(buf, sizeof(buf)-1, "Agree=%s", data);
-       fwrite(buf, strlen(buf), 1, fp);
+       app_control_create(&reply);
 
-       fclose(fp);
+       if (fp == NULL) {
+               LS_LOGE("UC_FILE open fail");
+               app_control_add_extra_data(reply, "result", "No");
+       } else {
+               snprintf(buf, sizeof(buf)-1, "Agree=%s", data);
+               fwrite(buf, strlen(buf), 1, fp);
+               fclose(fp);
+               LS_LOGE("result of save_file() is %s", data);
+
+               app_control_add_extra_data(reply, "result", strdup(data));
+       }
 
-       app_control_create(&reply);
        ret = app_control_reply_to_launch_request(reply, ad->app_control, APP_CONTROL_RESULT_SUCCEEDED);
        if (ret != APP_CONTROL_ERROR_NONE)
                LS_LOGE("app_control_reply_to_launch_request fail. err=%d", ret);
@@ -99,6 +144,15 @@ static void agree_btn_cb(void *data, Evas_Object * obj, void *event)
        elm_exit();
 }
 
+static void back_btn_cb(void *data, Evas_Object * obj, void *event)
+{
+       LS_FUNC_ENTER
+       heremaps_uc_app_data *ad = (heremaps_uc_app_data *) data;
+
+       read_file(ad);
+       elm_exit();
+}
+
 static Evas_Object *create_win(const char *name)
 {
        LS_FUNC_ENTER
@@ -126,7 +180,7 @@ static Evas_Object *create_popup(Evas_Object *layout, heremaps_uc_app_data *ad)
        /* popup */
        popup = elm_popup_add(layout);
        elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
-       eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, win_del, layout);
+       eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, back_btn_cb, ad);
        evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        elm_object_part_text_set(popup, "title,text", P_("IDS_POSITIONING_CONSENT_TITLE"));
@@ -181,20 +235,29 @@ static void _app_control_cb(app_control_h app_control, void *user_data)
 
        gboolean ret = FALSE;
        heremaps_uc_app_data *ad = (heremaps_uc_app_data *) user_data;
+       char *action = NULL;
        char *data = NULL;
        LS_RETURN_IF_FAILED(ad);
 
-       app_control_get_extra_data(app_control, "value", &data);
-       LS_LOGE("DATA = %s", data);
-
        ret = app_control_clone(&(ad->app_control), app_control);
        if (ret == FALSE)
                LS_LOGE("app_control_clone. err=%d", ret);
 
-       if (data != NULL) {
-               if ((strcmp(data, "Yes") == 0) || (strcmp(data, "No") == 0)) {
-                       save_file(data, ad);
+       app_control_get_extra_data(app_control, "action", &action);
+       if (action != NULL) {
+               if (strcmp(action, "Get") == 0) {
+                       read_file(ad);
                        elm_exit();
+               } else if (strcmp(action, "Set") == 0) {
+                       app_control_get_extra_data(app_control, "value", &data);
+                       LS_LOGE("DATA = %s", data);
+
+                        if (data != NULL) {
+                               if ((strcmp(data, "Yes") == 0) || (strcmp(data, "No") == 0)) {
+                                       save_file(data, ad);
+                                       elm_exit();
+                               }
+                       }
                }
        }
 
index f3af232..e9ed415 100755 (executable)
@@ -119,8 +119,8 @@ public:
      * This enumeration defines identifiers for route MetricSystem specifiers.
      */
     enum MetricSystem {
-        DIST_imperial = 0x0000,      ///< Indicates that MetricSystem is miles
-        DIST_metric = 0x0001         ///< Indicates that MetricSystem is m & km
+        DIST_metric = 0x0000,        ///< Indicates that MetricSystem is m & km
+        DIST_imperial = 0x0001       ///< Indicates that MetricSystem is miles
     };
 #endif
 
index e36a8f8..ece39bd 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_8
\ No newline at end of file
+libheremaps-engine.so.1.0.6_9
\ No newline at end of file
similarity index 83%
rename from lib/aarch64/libheremaps-engine.so.1.0.6_8
rename to lib/aarch64/libheremaps-engine.so.1.0.6_9
index d2446f5..dec06a3 100755 (executable)
Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_8 and b/lib/aarch64/libheremaps-engine.so.1.0.6_9 differ
index e36a8f8..ece39bd 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_8
\ No newline at end of file
+libheremaps-engine.so.1.0.6_9
\ No newline at end of file
similarity index 77%
rename from lib/arm/libheremaps-engine.so.1.0.6_8
rename to lib/arm/libheremaps-engine.so.1.0.6_9
index 33a0c4f..bb449cb 100755 (executable)
Binary files a/lib/arm/libheremaps-engine.so.1.0.6_8 and b/lib/arm/libheremaps-engine.so.1.0.6_9 differ
index e36a8f8..ece39bd 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_8
\ No newline at end of file
+libheremaps-engine.so.1.0.6_9
\ No newline at end of file
similarity index 78%
rename from lib/i586/libheremaps-engine.so.1.0.6_8
rename to lib/i586/libheremaps-engine.so.1.0.6_9
index 4ab209d..46f5e30 100755 (executable)
Binary files a/lib/i586/libheremaps-engine.so.1.0.6_8 and b/lib/i586/libheremaps-engine.so.1.0.6_9 differ
index e36a8f8..ece39bd 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_8
\ No newline at end of file
+libheremaps-engine.so.1.0.6_9
\ No newline at end of file
similarity index 80%
rename from lib/x86_64/libheremaps-engine.so.1.0.6_8
rename to lib/x86_64/libheremaps-engine.so.1.0.6_9
index 3dda9f2..7f478d9 100755 (executable)
Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_8 and b/lib/x86_64/libheremaps-engine.so.1.0.6_9 differ
index 4bc9f39..69d3f95 100644 (file)
@@ -200,7 +200,6 @@ here_error_e HerePlace::StartDiscoveryPlace(maps_area_h hArea, const char *szAdd
                return HERE_ERROR_OUT_OF_MEMORY;
 
 
-
        typedef enum {
                PLACE_CMD_TEXT,
                PLACE_CMD_CENTER,
@@ -223,7 +222,6 @@ here_error_e HerePlace::StartDiscoveryPlace(maps_area_h hArea, const char *szAdd
        }
        m_pDiscoveryQuery->SetSearchText(szSearchText);
 
-
        /* Decide command type */
        if (!szSearchText.empty())
        {
@@ -238,7 +236,6 @@ here_error_e HerePlace::StartDiscoveryPlace(maps_area_h hArea, const char *szAdd
                cmdType = PLACE_CMD_AREA;
        }
 
-
        /* Get proximity with area */
        if (cmdType == PLACE_CMD_TEXT || cmdType == PLACE_CMD_CENTER)
        {
@@ -281,7 +278,6 @@ here_error_e HerePlace::StartDiscoveryPlace(maps_area_h hArea, const char *szAdd
                        return HERE_ERROR_INVALID_PARAMETER;
        }
 
-
        /* Set properties */
        if (cmdType == PLACE_CMD_TEXT)
        {