From: chanywa Date: Tue, 11 Jul 2017 01:48:27 +0000 (+0900) Subject: To test user consent in HERE Maps engine X-Git-Tag: submit/tizen/20170711.060944^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F35%2F138035%2F3;p=platform%2Fcore%2Flocation%2Fmaps-plugin-here.git To test user consent in HERE Maps engine Change-Id: If2e762e9012569a5101d5473aabafb3decc43bf1 --- diff --git a/inc/engine/common/ApplicationContext.h b/inc/engine/common/ApplicationContext.h index 2ac89f7..e2b726f 100644 --- a/inc/engine/common/ApplicationContext.h +++ b/inc/engine/common/ApplicationContext.h @@ -40,7 +40,7 @@ public: /** * This method sets the preferred language, using a two-letter BCP-47 code - * supplied by the caller. + * supplied by the caller. * * @param sLanguage A const reference to a string containing a two-letter * code identifying the preferred map language. @@ -131,7 +131,7 @@ public: /** * This method sets a flag to indicate whether a high-resolution map is to be used. - * + * * @param haveHighResolution A Boolean, true to indicate that a * high-resolution map is to be used, otherwise false. */ @@ -139,12 +139,30 @@ public: /** * This method retrieves a Boolean value indicating whether a high-resolution map is used. - * + * * @return A Boolean, true to indicate that a * high-resolution map is (to be) used, otherwise false. */ bool HaveHighResolutionMap() const; +#ifdef TIZEN_MIGRATION + /** + * This method retrieves a Boolean value indicating whether the user has consented to use HERE solution. + * + * @return A Boolean, true to indicate that a + * the user has consented to use HERE solution, otherwise false. + */ + bool GetUserConsent(); + + /** + * This method sets a flag to indicate whether the user has consented to use HERE solution. + * + * @param consented A Boolean, true to indicate that a + * the user has consented to use HERE solution, otherwise false. + */ + void SetUserConsent(bool consented); +#endif + private: /** * This method is a private constructor for the singleton. diff --git a/lib/aarch64/libheremaps-engine.so.1 b/lib/aarch64/libheremaps-engine.so.1 index 359e6e0..33d96e9 120000 --- a/lib/aarch64/libheremaps-engine.so.1 +++ b/lib/aarch64/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_30 \ No newline at end of file +libheremaps-engine.so.1.0.6_31 \ No newline at end of file diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_30 b/lib/aarch64/libheremaps-engine.so.1.0.6_30 deleted file mode 100755 index cabf4a5..0000000 Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_30 and /dev/null differ diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_31 b/lib/aarch64/libheremaps-engine.so.1.0.6_31 new file mode 100755 index 0000000..4c0fae0 Binary files /dev/null and b/lib/aarch64/libheremaps-engine.so.1.0.6_31 differ diff --git a/lib/armv7l/libheremaps-engine.so.1 b/lib/armv7l/libheremaps-engine.so.1 index 359e6e0..33d96e9 120000 --- a/lib/armv7l/libheremaps-engine.so.1 +++ b/lib/armv7l/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_30 \ No newline at end of file +libheremaps-engine.so.1.0.6_31 \ No newline at end of file diff --git a/lib/armv7l/libheremaps-engine.so.1.0.6_30 b/lib/armv7l/libheremaps-engine.so.1.0.6_30 deleted file mode 100755 index 87183b6..0000000 Binary files a/lib/armv7l/libheremaps-engine.so.1.0.6_30 and /dev/null differ diff --git a/lib/armv7l/libheremaps-engine.so.1.0.6_31 b/lib/armv7l/libheremaps-engine.so.1.0.6_31 new file mode 100755 index 0000000..bfbf8e1 Binary files /dev/null and b/lib/armv7l/libheremaps-engine.so.1.0.6_31 differ diff --git a/lib/i586/libheremaps-engine.so.1 b/lib/i586/libheremaps-engine.so.1 index 359e6e0..33d96e9 120000 --- a/lib/i586/libheremaps-engine.so.1 +++ b/lib/i586/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_30 \ No newline at end of file +libheremaps-engine.so.1.0.6_31 \ No newline at end of file diff --git a/lib/i586/libheremaps-engine.so.1.0.6_30 b/lib/i586/libheremaps-engine.so.1.0.6_30 deleted file mode 100755 index ca84840..0000000 Binary files a/lib/i586/libheremaps-engine.so.1.0.6_30 and /dev/null differ diff --git a/lib/i586/libheremaps-engine.so.1.0.6_31 b/lib/i586/libheremaps-engine.so.1.0.6_31 new file mode 100755 index 0000000..638b455 Binary files /dev/null and b/lib/i586/libheremaps-engine.so.1.0.6_31 differ diff --git a/lib/x86_64/libheremaps-engine.so.1 b/lib/x86_64/libheremaps-engine.so.1 index 359e6e0..33d96e9 120000 --- a/lib/x86_64/libheremaps-engine.so.1 +++ b/lib/x86_64/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_30 \ No newline at end of file +libheremaps-engine.so.1.0.6_31 \ No newline at end of file diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_30 b/lib/x86_64/libheremaps-engine.so.1.0.6_30 deleted file mode 100755 index f587775..0000000 Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_30 and /dev/null differ diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_31 b/lib/x86_64/libheremaps-engine.so.1.0.6_31 new file mode 100755 index 0000000..9d5c4f4 Binary files /dev/null and b/lib/x86_64/libheremaps-engine.so.1.0.6_31 differ diff --git a/packaging/maps-plugin-here.spec b/packaging/maps-plugin-here.spec index 8408684..c4041bc 100644 --- a/packaging/maps-plugin-here.spec +++ b/packaging/maps-plugin-here.spec @@ -1,6 +1,6 @@ Name: maps-plugin-here Summary: Tizen HERE Maps Plug-in Library -Version: 0.3.22 +Version: 0.3.23 Release: 1 Group: Location/Libraries License: Apache-2.0 and HERE diff --git a/src/here_api.cpp b/src/here_api.cpp index 00ba53b..7cca9fa 100644 --- a/src/here_api.cpp +++ b/src/here_api.cpp @@ -34,14 +34,13 @@ int HerePluginInit(maps_plugin_h *hPlugin, const char *module) if (!hPlugin) return HERE_ERROR_INVALID_PARAMETER; - if (!module || strcmp(module, "NOUC") != 0) { - bool consent = false; - here_error_e error = HereUserConsent::GetUserConsent(&consent); - if (error != HERE_ERROR_NONE) - return error; - if (consent != true) - return HERE_ERROR_USER_NOT_CONSENTED; - } + bool consent = false; + here_error_e error = HereUserConsent::GetUserConsent(&consent); + if (error != HERE_ERROR_NONE) + return error; + + if (consent == false && (!module || strcmp(module, "NOUC") != 0)) + return HERE_ERROR_USER_NOT_CONSENTED; HereManager::Create(); diff --git a/src/here_userconsent.cpp b/src/here_userconsent.cpp index 706b639..683c3c0 100644 --- a/src/here_userconsent.cpp +++ b/src/here_userconsent.cpp @@ -20,6 +20,8 @@ #include #include +#include + #include "heremaps-uc-dbus.h" #include "here_userconsent.h" @@ -45,6 +47,8 @@ static void UserConsentChangedCb(keynode_t *node EINA_UNUSED, void *user_data) pUserConsent->isSetVconfCb = false; MAPS_LOGD("Vconf value of HereMaps is %d", enabled); + ApplicationContext::GetInstance().SetUserConsent(enabled); + if (pUserConsent->m_provider) ((maps_service_request_user_consent_cb)pUserConsent->m_pCbFunc)((bool)enabled, pUserConsent->m_provider, pUserConsent->m_pUserData); else @@ -112,6 +116,7 @@ here_error_e HereUserConsent::GetUserConsent(bool *consent) g_free(strAppId); } *consent = (enabled == 1); + ApplicationContext::GetInstance().SetUserConsent(*consent); return HERE_ERROR_NONE; } @@ -127,7 +132,7 @@ here_error_e HereUserConsent::SetUserConsent(bool consent) MAPS_LOGD("Fail to set vconf value"); return HERE_ERROR_SERVICE_NOT_AVAILABLE; } - + ApplicationContext::GetInstance().SetUserConsent(enabled); return HERE_ERROR_NONE; }