Synchronized Tizen 2.4: Supported MAPS_ERROR_SERVICE_NOT_AVAILABLE in the maps_servic... 39/56439/3
authorYoung-Ae Kang <youngae.kang@samsung.com>
Fri, 8 Jan 2016 03:07:27 +0000 (12:07 +0900)
committerYoungae Kang <youngae.kang@samsung.com>
Wed, 20 Jan 2016 08:59:35 +0000 (00:59 -0800)
Change-Id: Ibcb157af97206b7539e3791ee7417affef579854

packaging/capi-maps-service.spec
src/api/maps_service.cpp
src/plugin/module.cpp
src/plugin/module.h
src/session/command.cpp
src/session/command.h

index d3c2b16..ea8a2d8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-maps-service
 Summary:    Tizen Maps Service API
-Version:    0.5.1
+Version:    0.5.2
 Release:    1
 Group:      Location/API
 License:    Apache-2.0
index 12afd5b..1d7c6f5 100755 (executable)
@@ -119,11 +119,10 @@ EXPORT_API int maps_service_create(const char *maps_provider,
        if (!__has_maps_service_privilege())
                return MAPS_ERROR_PERMISSION_DENIED;
 
-       maps_error_e error = MAPS_ERROR_NOT_SUPPORTED;
+       int error = MAPS_ERROR_NOT_SUPPORTED;
 
        do {
                /* 0. Find the plugin, requested by the user */
-
                const plugin::provider_info info =
                        plugin::find_by_names(string(maps_provider));
 
@@ -146,9 +145,11 @@ EXPORT_API int maps_service_create(const char *maps_provider,
                }
 
                /* 3. Initialize the requested plugin */
-               maps_plugin_h plugin_h = plugin::binary_extractor().init(info);
+               int init_error = MAPS_ERROR_NONE; /* Storage for init error code */
+
+               maps_plugin_h plugin_h = plugin::binary_extractor().init(info, &init_error);
                if (!plugin_h) {
-                       error = MAPS_ERROR_NOT_SUPPORTED;
+                       error = init_error;
                        MAPS_LOGE("ERROR! Plugin init failed");
                        break;
                }
@@ -161,8 +162,7 @@ EXPORT_API int maps_service_create(const char *maps_provider,
 
                /* 5. Set status of completely correct plugin initialization */
                error = MAPS_ERROR_NONE;
-
-       } while(false);
+       } while (false);
 
        if (error != MAPS_ERROR_NONE)
                maps_service_destroy(*maps);
index 830065c..16a3d4e 100755 (executable)
@@ -45,7 +45,7 @@ plugin::provider_info plugin::binary_extractor::get_plugin_info(const
        if (file_name.empty())
                return provider_info::empty_instance;
 
-       /* 1.Init plugin */
+       /* 1.Initialize plugin */
        GMod *plugin = gmod_new(file_name, FALSE);
        if (!plugin)
                return provider_info::empty_instance;
@@ -76,12 +76,15 @@ plugin::provider_info plugin::binary_extractor::get_plugin_info(const
        return info;
 }
 
-maps_plugin_h plugin::binary_extractor::init(const provider_info &info)
+maps_plugin_h plugin::binary_extractor::init(const provider_info &info,
+                                            int *init_error)
 {
-       /* 1.Init plugin */
-       if (info.file.empty())
+       /* 1.Initialize plugin */
+       if (info.file.empty() || !init_error)
                return NULL;
 
+       *init_error = MAPS_ERROR_NONE;
+
        GMod *plugin = gmod_new(info.file, TRUE);
        if (!plugin) {
                MAPS_LOGE("Open Module Failed: %s", info.file.c_str());
index e0deb45..4a05587 100644 (file)
@@ -216,8 +216,8 @@ namespace plugin {
                {
                }
        public:
-                provider_info get_plugin_info(const string &file_name) const;
-               maps_plugin_h init(const provider_info &info);
+               provider_info get_plugin_info(const string &file_name) const;
+               maps_plugin_h init(const provider_info &info, int *init_error);
                void shutdown(maps_plugin_h plugin_h);
        private:
                 GMod *gmod_new(const string &module_file,
index 016381b..e81a913 100644 (file)
@@ -23,7 +23,8 @@ extern plugin::plugin_s *__extract_plugin(maps_service_h maps);
 volatile int session::command::command_request_id = 1;
 session::command session::command::empty_instance;
 
-session::command::command(maps_service_h ms) : m(ms), my_req_id(0)
+session::command::command(maps_service_h ms)
+       : m(ms), my_req_id(0), error(MAPS_ERROR_NONE)
 {
 }
 
@@ -41,6 +42,7 @@ session::command &session::command::operator =(const command &src)
        if (this != (&src)) {
                m = src.m;
                my_req_id = src.my_req_id;
+               error = src.error;
        }
        return *this;
 }
index 1caad94..81a0bcb 100644 (file)
@@ -31,12 +31,15 @@ namespace session
                maps_service_h m;
        protected:
                int my_req_id;
+       protected:
+               int error;
        public:
                static volatile int command_request_id;
        public:
                static command empty_instance;
        private:
                command()
+                       : m(NULL), my_req_id(-1), error(0)
                {
                }               /* Please, do not construct an empty object */
        public: