To test user consent in HERE Maps engine 35/138035/3 accepted/tizen/unified/20170711.181232 submit/tizen/20170711.060944
authorchanywa <cbible.kim@samsung.com>
Tue, 11 Jul 2017 01:48:27 +0000 (10:48 +0900)
committerchanywa <cbible.kim@samsung.com>
Tue, 11 Jul 2017 04:33:49 +0000 (13:33 +0900)
Change-Id: If2e762e9012569a5101d5473aabafb3decc43bf1

12 files changed:
inc/engine/common/ApplicationContext.h
lib/aarch64/libheremaps-engine.so.1
lib/aarch64/libheremaps-engine.so.1.0.6_31 [moved from lib/aarch64/libheremaps-engine.so.1.0.6_30 with 67% similarity]
lib/armv7l/libheremaps-engine.so.1
lib/armv7l/libheremaps-engine.so.1.0.6_31 [moved from lib/armv7l/libheremaps-engine.so.1.0.6_30 with 64% similarity]
lib/i586/libheremaps-engine.so.1
lib/i586/libheremaps-engine.so.1.0.6_31 [moved from lib/i586/libheremaps-engine.so.1.0.6_30 with 65% similarity]
lib/x86_64/libheremaps-engine.so.1
lib/x86_64/libheremaps-engine.so.1.0.6_31 [moved from lib/x86_64/libheremaps-engine.so.1.0.6_30 with 67% similarity]
packaging/maps-plugin-here.spec
src/here_api.cpp
src/here_userconsent.cpp

index 2ac89f7..e2b726f 100644 (file)
@@ -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, <code>true</code> to indicate that a
      *        high-resolution map is to be used, otherwise <code>false</code>.
      */
@@ -139,12 +139,30 @@ public:
 
     /**
      * This method retrieves a Boolean value indicating whether a high-resolution map is used.
-     * 
+     *
      * @return A Boolean, <code>true</code> to indicate that a
      *        high-resolution map is (to be) used, otherwise <code>false</code>.
      */
     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, <code>true</code> to indicate that a
+     *        the user has consented to use HERE solution, otherwise <code>false</code>.
+     */
+    bool GetUserConsent();
+
+    /**
+     * This method sets a flag to indicate whether the user has consented to use HERE solution.
+     *
+     * @param consented A Boolean, <code>true</code> to indicate that a
+     *        the user has consented to use HERE solution, otherwise <code>false</code>.
+     */
+    void SetUserConsent(bool consented);
+#endif
+
 private:
     /**
      * This method is a private constructor for the singleton.
index 359e6e0..33d96e9 120000 (symlink)
@@ -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
similarity index 67%
rename from lib/aarch64/libheremaps-engine.so.1.0.6_30
rename to lib/aarch64/libheremaps-engine.so.1.0.6_31
index cabf4a5..4c0fae0 100755 (executable)
Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_30 and b/lib/aarch64/libheremaps-engine.so.1.0.6_31 differ
index 359e6e0..33d96e9 120000 (symlink)
@@ -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
similarity index 64%
rename from lib/armv7l/libheremaps-engine.so.1.0.6_30
rename to lib/armv7l/libheremaps-engine.so.1.0.6_31
index 87183b6..bfbf8e1 100755 (executable)
Binary files a/lib/armv7l/libheremaps-engine.so.1.0.6_30 and b/lib/armv7l/libheremaps-engine.so.1.0.6_31 differ
index 359e6e0..33d96e9 120000 (symlink)
@@ -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
similarity index 65%
rename from lib/i586/libheremaps-engine.so.1.0.6_30
rename to lib/i586/libheremaps-engine.so.1.0.6_31
index ca84840..638b455 100755 (executable)
Binary files a/lib/i586/libheremaps-engine.so.1.0.6_30 and b/lib/i586/libheremaps-engine.so.1.0.6_31 differ
index 359e6e0..33d96e9 120000 (symlink)
@@ -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
similarity index 67%
rename from lib/x86_64/libheremaps-engine.so.1.0.6_30
rename to lib/x86_64/libheremaps-engine.so.1.0.6_31
index f587775..9d5c4f4 100755 (executable)
Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_30 and b/lib/x86_64/libheremaps-engine.so.1.0.6_31 differ
index 8408684..c4041bc 100644 (file)
@@ -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
index 00ba53b..7cca9fa 100644 (file)
@@ -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();
 
index 706b639..683c3c0 100644 (file)
@@ -20,6 +20,8 @@
 #include <vconf.h>
 #include <vconf-internal-location-keys.h>
 
+#include <common/ApplicationContext.h>
+
 #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;
 }