Merged what to check privilege in previous Tizen 33/80133/1
authorchanywa <cbible.kim@samsung.com>
Thu, 14 Jul 2016 23:53:57 +0000 (08:53 +0900)
committerchanywa <cbible.kim@samsung.com>
Thu, 14 Jul 2016 23:53:57 +0000 (08:53 +0900)
Change-Id: Id1a42c7b0ed2e6e0eebf385aed0956d27caf3d7d

CMakeLists.txt
include/maps_view.h
packaging/capi-maps-service.spec
src/api/maps_condition.cpp

index 43ecd82..e4d0323 100644 (file)
@@ -33,7 +33,7 @@ SET(dependents
        capi-media-image-util
 )
 
-IF(${TIZEN_VER} LESS 300)
+IF(${TIZEN_VER} LESS 240)
        SET(dependents
                ${dependents}
                # Privilege check
@@ -41,7 +41,14 @@ IF(${TIZEN_VER} LESS 300)
                pkgmgr-info
                capi-security-privilege-manager
        )
-ENDIF(${TIZEN_VER} LESS 300)
+ELSEIF(${TIZEN_VER} LESS 300)
+       SET(dependents
+               ${dependents}
+               # Privilege check
+               security-privilege-checker
+       )
+ENDIF(${TIZEN_VER} LESS 240)
+
 
 SET(pc_dependents "capi-base-common evas")
 
index ef98a2f..b56e7c7 100755 (executable)
@@ -919,8 +919,8 @@ int maps_view_get_screen_location(const maps_view_h view, int *x, int *y, int *w
  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
  *
  * @param[in]  view    The view handle
- * @param[in]  x       The new new width, in screen units
- * @param[in]  y       The new new height, in screen units
+ * @param[in]  x       The new x position, in screen units
+ * @param[in]  y       The new y position, in screen units
  * @return     0 on success, otherwise a negative error value
  * @retval     #MAPS_ERROR_NONE Successful
  * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
index 3b36de0..90ce76e 100644 (file)
@@ -15,6 +15,14 @@ BuildRequires: pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(capi-system-info)
 
+# Privilege check for Tizen 2.3.2
+#BuildRequires: pkgconfig(capi-appfw-app-manager)
+#BuildRequires: pkgconfig(pkgmgr-info)
+#BuildRequires: pkgconfig(capi-security-privilege-manager)
+
+# Privilege check for Tizen 2.4
+#BuildRequires: pkgconfig(security-privilege-checker)
+
 # Mapping API dependencies
 BuildRequires: pkgconfig(eina)
 BuildRequires: pkgconfig(evas)
@@ -58,7 +66,7 @@ cp LICENSE %{buildroot}/usr/share/license/%{name}
 
 %post
 mkdir -p %{_libdir}/maps/plugins
-# privilege mapping
+# privilege mapping for Tizen 3.x
 chgrp priv_mapservice %{_libdir}/maps/plugins
 chmod g+rw %{_libdir}/maps/plugins
 chmod o= %{_libdir}/maps/plugins
index 997c641..40c64ca 100644 (file)
 
 #include <glib.h>
 #include <unistd.h>
-#if TIZEN_VER < 300
+#if TIZEN_VER < 240
 #include <app_manager.h>
 #include <pkgmgr-info.h>
 #include <privilege_checker.h> /* privilege */
+#elif TIZEN_VER < 300
+#include <privilege_checker.h> /* privilege */
 #endif
 #include <system_info.h>               /* system_info_get_platform_bool */
 #include <maps_util.h>                 /* log */
@@ -31,7 +33,7 @@
 #define INTERNET_FEATURE               "http://tizen.org/feature/network.internet"
 
 
-#if TIZEN_VER < 300
+#if TIZEN_VER < 240
 static char* __maps_condition_get_package_id(char **package_id)
 {
        int ret = 0;
@@ -73,7 +75,7 @@ static char* __maps_condition_get_package_id(char **package_id)
 bool maps_condition_check_privilege(void)
 {
        bool is_permitted = true;
-#if TIZEN_VER < 300
+#if TIZEN_VER < 240
        /* to check for Tizen 2.x privilege */
        char *package_id = NULL;
        if (!__maps_condition_get_package_id(&package_id))
@@ -82,6 +84,9 @@ bool maps_condition_check_privilege(void)
        int ret = privilege_checker_check_package_privilege(package_id, MAPSERVICE_PRIVILEGE);
        is_permitted = (ret == PRIV_CHECKER_ERR_NONE);
        g_free(package_id);
+#elif TIZEN_VER < 300
+       int ret = privilege_checker_check_privilege(MAPSERVICE_PRIVILEGE);
+       is_permitted = (ret == PRIVILEGE_CHECKER_ERR_NONE);
 #else
        /* to check for Tizen 3.x privilege */
        extern const char *MAPS_PLUGINS_PATH_PREFIX;