From 19e7d871b85c88511a37a23f75efad60fe99fb58 Mon Sep 17 00:00:00 2001 From: chanywa Date: Fri, 15 Jul 2016 08:53:57 +0900 Subject: [PATCH] Merged what to check privilege in previous Tizen Change-Id: Id1a42c7b0ed2e6e0eebf385aed0956d27caf3d7d --- CMakeLists.txt | 11 +++++++++-- include/maps_view.h | 4 ++-- packaging/capi-maps-service.spec | 10 +++++++++- src/api/maps_condition.cpp | 11 ++++++++--- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43ecd82..e4d0323 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/include/maps_view.h b/include/maps_view.h index ef98a2f..b56e7c7 100755 --- a/include/maps_view.h +++ b/include/maps_view.h @@ -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 diff --git a/packaging/capi-maps-service.spec b/packaging/capi-maps-service.spec index 3b36de0..90ce76e 100644 --- a/packaging/capi-maps-service.spec +++ b/packaging/capi-maps-service.spec @@ -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 diff --git a/src/api/maps_condition.cpp b/src/api/maps_condition.cpp index 997c641..40c64ca 100644 --- a/src/api/maps_condition.cpp +++ b/src/api/maps_condition.cpp @@ -16,10 +16,12 @@ #include #include -#if TIZEN_VER < 300 +#if TIZEN_VER < 240 #include #include #include /* privilege */ +#elif TIZEN_VER < 300 +#include /* privilege */ #endif #include /* system_info_get_platform_bool */ #include /* 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; -- 2.34.1