Remove tv profile dependency for cynara 39/139739/1 accepted/tizen/4.0/unified/20170816.013813 accepted/tizen/4.0/unified/20170816.015534 accepted/tizen/4.0/unified/20170829.020414 accepted/tizen/unified/20170721.024533 submit/tizen/20170720.084709 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004 submit/tizen_4.0_unified/20170814.115522
authorkj7.sung <kj7.sung@samsung.com>
Thu, 20 Jul 2017 08:36:51 +0000 (17:36 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Thu, 20 Jul 2017 08:36:51 +0000 (17:36 +0900)
Change-Id: I2df0ba93412a89ea1d82fa0fa0f13c2fb840bdc1
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
CMakeLists.txt
location/CMakeLists.txt
location/manager/location-common-util.c
location/manager/location-common-util.h
location/manager/location-gps.c
location/manager/location-privacy.h
location/manager/location.c
location/module/module-internal.c
packaging/liblbs-location.spec

index cb7fe72..469a8ad 100755 (executable)
@@ -9,18 +9,8 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 # Set required packages
 INCLUDE(FindPkgConfig)
 
-IF(TIZEN_PRODUCT_TV_OPTIMIZATION)
-        MESSAGE("<<< TV Product Optimization >>>")
-        ADD_DEFINITIONS("-DTIZEN_PRODUCT_TV_OPTIMIZATION")
-       SET(PRIVACY_PKG "")
-ELSE(TIZEN_PRODUCT_TV_OPTIMIZATION)
-        MESSAGE("<<< Non-TV Profile >>>")
-       SET(PRIVACY_PKG "cynara-client cynara-session")
-ENDIF(TIZEN_PRODUCT_TV_OPTIMIZATION)
-
 pkg_check_modules(pkgs REQUIRED glib-2.0 gthread-2.0 gobject-2.0 gmodule-2.0 capi-appfw-app-manager
-               dlog vconf json-glib-1.0 bundle eventsystem libtzplatform-config capi-system-sensor
-               capi-system-info ${PRIVACY_PKG})
+               dlog vconf json-glib-1.0 bundle eventsystem libtzplatform-config capi-system-sensor cynara-client cynara-session)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -44,6 +34,4 @@ MESSAGE(${CMAKE_EXE_LINKER_FLAGS})
 CONFIGURE_FILE(lbs-location.pc.in lbs-location.pc @ONLY)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lbs-location.pc DESTINATION ${LIBDIR}/pkgconfig)
 
-#INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME liblbs-location)
-
 ADD_SUBDIRECTORY(location)
index 83b66a6..550d2df 100644 (file)
@@ -6,12 +6,6 @@ SET(INC_DIR "include")
 SET(MANAGER_DIR "manager")
 SET(MODULE_DIR "module")
 
-IF(TIZEN_PRODUCT_TV_OPTIMIZATION)
-       SET (PRIVACY_SRC "")
-ELSE(TIZEN_PRODUCT_TV_OPTIMIZATION)
-       SET (PRIVACY_SRC "${MANAGER_DIR}/location-privacy.c")
-ENDIF(TIZEN_PRODUCT_TV_OPTIMIZATION)
-
 ADD_DEFINITIONS("-DLIBDIR=\"${LIBDIR}\"")
 
 INCLUDE_DIRECTORIES(
@@ -38,7 +32,7 @@ SET(SRCS
        ${MANAGER_DIR}/location-wps.c
        ${MANAGER_DIR}/location-passive.c
        ${MANAGER_DIR}/location-fused.c
-       ${PRIVACY_SRC}
+       ${MANAGER_DIR}/location-privacy.c
 
        ${MODULE_DIR}/module-internal.c
 )
index f546b06..e7aa284 100644 (file)
 #include <string.h>
 #include <sys/types.h>
 #include <unistd.h>
-#include <stdlib.h>
 
 #include "location.h"
 #include "location-common-util.h"
 #include "location-setting.h"
 #include "location-log.h"
 #include <app_manager.h>
-#include <system_info.h>
 
 
 int location_application_get_authority(void)
@@ -275,36 +273,3 @@ const char* err_msg(int err)
        default: return "LOCATION_ERROR_UNKNOWN";
        }
 }
-
-tizen_profile_t _get_tizen_profile()
-{
-       static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
-       if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
-               return profile;
-
-       char *profileName;
-       system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
-       switch (*profileName) {
-       case 'm':
-       case 'M':
-               profile = TIZEN_PROFILE_MOBILE;
-               break;
-       case 'w':
-       case 'W':
-               profile = TIZEN_PROFILE_WEARABLE;
-               break;
-       case 't':
-       case 'T':
-               profile = TIZEN_PROFILE_TV;
-               break;
-       case 'i':
-       case 'I':
-               profile = TIZEN_PROFILE_IVI;
-               break;
-       default: /* common or unknown ==> ALL ARE COMMON. */
-               profile = TIZEN_PROFILE_COMMON;
-       }
-       free(profileName);
-
-       return profile;
-}
index eddfc44..f43c364 100644 (file)
@@ -82,13 +82,4 @@ const char* err_msg(int err);
 
 G_END_DECLS
 
-typedef enum {
-       TIZEN_PROFILE_UNKNOWN = 0,
-       TIZEN_PROFILE_MOBILE = 0x1,
-       TIZEN_PROFILE_WEARABLE = 0x2,
-       TIZEN_PROFILE_TV = 0x4,
-       TIZEN_PROFILE_IVI = 0x8,
-       TIZEN_PROFILE_COMMON = 0x10,
-} tizen_profile_t;
-extern tizen_profile_t _get_tizen_profile();
 #endif
index 1247d1c..8df47ae 100644 (file)
@@ -448,8 +448,7 @@ static int location_gps_start_batch(LocationGps *self)
 #endif
 
 #if defined(TIZEN_DEVICE)
-               if (_get_tizen_profile() != TIZEN_PROFILE_TV)
-                       return  __set_sensor_batch(self, priv->batch_interval);
+               return  __set_sensor_batch(self, priv->batch_interval);
 #endif
        }
 
@@ -468,27 +467,23 @@ static int location_gps_stop_batch(LocationGps *self)
        int ret = LOCATION_ERROR_NONE;
 
 #if defined(TIZEN_DEVICE)
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = sensor_listener_stop(priv->sensor_listener);
-               LOC_IF_FAIL(ret, _E, "Fail to listener_stop [%s]", err_msg(LOCATION_ERROR_NOT_AVAILABLE));
+       ret = sensor_listener_stop(priv->sensor_listener);
+       LOC_IF_FAIL(ret, _E, "Fail to listener_stop [%s]", err_msg(LOCATION_ERROR_NOT_AVAILABLE));
 
-               ret = sensor_listener_unset_event_cb(priv->sensor_listener);
-               LOC_IF_FAIL_LOG(ret, _E, "Fail to listener_unset_event_cb [%s]", err_msg(ret));
+       ret = sensor_listener_unset_event_cb(priv->sensor_listener);
+       LOC_IF_FAIL_LOG(ret, _E, "Fail to listener_unset_event_cb [%s]", err_msg(ret));
 
-               ret = sensor_destroy_listener(priv->sensor_listener);
-               LOC_IF_FAIL_LOG(ret, _E, "Fail to destroy_listener [%s]", err_msg(ret));
-       } else {
+       ret = sensor_destroy_listener(priv->sensor_listener);
+       LOC_IF_FAIL_LOG(ret, _E, "Fail to destroy_listener [%s]", err_msg(ret));
 #else
-       if (1) {
-#endif
-               if (__get_started(self) == TRUE) {
-                       __set_started(self, FALSE);
-                       ret = priv->mod->ops.stop_batch(priv->mod->handler);
-                       LOC_IF_FAIL_LOG(ret, _E, "Failed to stop_batch [%s]", err_msg(ret));
-               } else {
-                       return LOCATION_ERROR_NONE;
-               }
+       if (__get_started(self) == TRUE) {
+               __set_started(self, FALSE);
+               ret = priv->mod->ops.stop_batch(priv->mod->handler);
+               LOC_IF_FAIL_LOG(ret, _E, "Failed to stop_batch [%s]", err_msg(ret));
+       } else {
+               return LOCATION_ERROR_NONE;
        }
+#endif
 
        __reset_pos_data_from_priv(priv);
 
@@ -1168,10 +1163,8 @@ static void location_gps_init(LocationGps *self)
        priv->loc_timeout = 0;
 
 #if defined(TIZEN_DEVICE)
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               priv->sensor = NULL;
-               priv->sensor_listener = NULL;
-       }
+       priv->sensor = NULL;
+       priv->sensor_listener = NULL;
 #endif
 
        priv->app_type = location_get_app_type(NULL);
index 7532c2c..06b5dc0 100644 (file)
 #ifndef __LOCATION_PRIVACY_H__
 #define __LOCATION_PRIVACY_H__
 
-#ifndef TIZEN_PRODUCT_TV_OPTIMIZATION
 extern int location_check_cynara(const char *privilege_name);
-#else
-static int location_check_cynara(const char *privilege_name)
-{
-       return 0;
-}
-#endif
 
 
 #endif /* __LOCATION_PRIVACY_H__ */
index caca551..c201883 100644 (file)
@@ -157,11 +157,9 @@ location_request_single_location(LocationObject *obj, int timeout)
 {
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
+
        ret = location_ielement_request_single_location(LOCATION_IELEMENT(obj), timeout);
        LOC_IF_FAIL(ret, _E, "Fail to request single location [%s]", err_msg(ret));
 
@@ -173,11 +171,8 @@ location_cancel_single_location(LocationObject *obj)
 {
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_cancel_single_location(LOCATION_IELEMENT(obj));
        if (ret != LOCATION_ERROR_NONE)
@@ -191,11 +186,8 @@ location_start(LocationObject *obj)
 {
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_start(LOCATION_IELEMENT(obj));
        LOC_IF_FAIL(ret, _E, "Fail to start [%s]", err_msg(ret));
@@ -219,12 +211,9 @@ EXPORT_API int
 location_start_batch(LocationObject *obj)
 {
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
-       int ret = LOCATION_ERROR_NONE;
 
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_start_batch(LOCATION_IELEMENT(obj));
        LOC_IF_FAIL(ret, _E, "Fail to start_batch [%s]", err_msg(ret));
@@ -300,13 +289,10 @@ location_is_enabled_method(LocationMethod method, int *is_enabled)
 EXPORT_API int
 location_enable_method(const LocationMethod method, const int enable)
 {
-       int ret = 0;
        char *_key = NULL;
 
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        if (location_setting_get_int(VCONFKEY_LOCATION_RESTRICT) > RESTRICT_OFF) {
                LOCATION_SECLOG("Location setting is denied by DPM");
@@ -402,12 +388,8 @@ location_get_position(LocationObject *obj, LocationPosition **position, Location
        g_return_val_if_fail(position, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(accuracy, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_get_position(LOCATION_IELEMENT(obj), position, accuracy);
        LOC_COND_RET(ret != LOCATION_ERROR_NONE, ret, _E, "Fail to get_position [%s]", err_msg(ret));
@@ -423,12 +405,8 @@ location_get_position_ext(LocationObject *obj, LocationPosition **position, Loca
        g_return_val_if_fail(velocity, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(accuracy, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_get_position_ext(LOCATION_IELEMENT(obj), position, velocity, accuracy);
        LOC_IF_FAIL(ret, _E, "Fail to get_position_ext [%s]", err_msg(ret));
@@ -443,12 +421,8 @@ location_get_last_position(LocationObject *obj, LocationPosition **position, Loc
        g_return_val_if_fail(position, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(accuracy, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_get_last_position(LOCATION_IELEMENT(obj), position, accuracy);
        LOC_IF_FAIL(ret, _E, "Fail to get_last_position [%s]", err_msg(ret));
@@ -464,12 +438,8 @@ location_get_last_position_ext(LocationObject *obj, LocationPosition **position,
        g_return_val_if_fail(velocity, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(accuracy, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_get_last_position_ext(LOCATION_IELEMENT(obj), position, velocity, accuracy);
        LOC_IF_FAIL(ret, _E, "Fail to get_last_position_ext [%s]", err_msg(ret));
@@ -497,12 +467,8 @@ location_get_satellite(LocationObject *obj, LocationSatellite **satellite)
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(satellite, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_get_satellite(LOCATION_IELEMENT(obj), satellite);
        LOC_IF_FAIL(ret, _E, "Fail to get_satellite [%s]", err_msg(ret));
@@ -516,12 +482,8 @@ location_get_batch(LocationObject *obj, LocationBatch **batch)
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(batch, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_get_batch(LOCATION_IELEMENT(obj), batch);
        LOC_IF_FAIL(ret, _E, "Fail to get_batch [%s]", err_msg(ret));
@@ -535,12 +497,8 @@ location_get_last_satellite(LocationObject *obj, LocationSatellite **satellite)
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(satellite, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_get_last_satellite(LOCATION_IELEMENT(obj), satellite);
        LOC_IF_FAIL(ret, _E, "Fail to get_last_satellite [%s]", err_msg(ret));
@@ -555,12 +513,8 @@ location_get_velocity(LocationObject *obj, LocationVelocity **velocity, Location
        g_return_val_if_fail(velocity, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(accuracy, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_get_velocity(LOCATION_IELEMENT(obj), velocity, accuracy);
        LOC_IF_FAIL(ret, _E, "Fail to get_velocity [%s]", err_msg(ret));
@@ -575,12 +529,8 @@ location_get_last_velocity(LocationObject *obj, LocationVelocity **velocity, Loc
        g_return_val_if_fail(velocity, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(accuracy, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_get_last_velocity(LOCATION_IELEMENT(obj), velocity, accuracy);
        LOC_IF_FAIL(ret, _E, "Fail to get_last_velocity [%s]", err_msg(ret));
@@ -591,17 +541,13 @@ location_get_last_velocity(LocationObject *obj, LocationVelocity **velocity, Loc
 EXPORT_API int
 location_get_accessibility_state(LocationAccessState *state)
 {
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
 
-               if (ret == LOCATION_ERROR_NONE) {
-                       *state = LOCATION_ACCESS_ALLOWED;
-               } else {
-                       *state = LOCATION_ACCESS_DENIED;
-                       LOCATION_LOGE("Cannot use location service for privacy[%d]", ret);
-               }
-       } else {
+       if (ret == LOCATION_ERROR_NONE) {
                *state = LOCATION_ACCESS_ALLOWED;
+       } else {
+               *state = LOCATION_ACCESS_DENIED;
+               LOCATION_LOGE("Cannot use location service for privacy[%d]", ret);
        }
 
        return LOCATION_ERROR_NONE;
@@ -641,12 +587,9 @@ EXPORT_API int
 location_set_option(LocationObject *obj, const char *option)
 {
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
-       int ret = LOCATION_ERROR_NONE;
 
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_set_option(LOCATION_IELEMENT(obj), option);
        LOC_IF_FAIL(ret, _E, "Fail to get_velocity [%s]", err_msg(ret));
@@ -660,12 +603,8 @@ location_set_option(LocationObject *obj, const char *option)
 EXPORT_API int
 location_enable_mock(const int enable)
 {
-       int ret = LOCATION_ERROR_NONE;
-
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
 #if 0 /* Tizen platform didn't turn developer option on */
        gboolean developer_option = FALSE;
@@ -691,11 +630,8 @@ location_set_mock_location(LocationObject *obj, const LocationPosition *position
        g_return_val_if_fail(velocity, LOCATION_ERROR_PARAMETER);
        g_return_val_if_fail(accuracy, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_set_mock_location(LOCATION_IELEMENT(obj), position, velocity, accuracy);
        LOC_IF_FAIL(ret, _E, "Fail to set_mock_location [%s]", err_msg(ret));
@@ -708,11 +644,8 @@ location_clear_mock_location(LocationObject *obj)
 {
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
 
-       int ret = LOCATION_ERROR_NONE;
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
+       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
        ret = location_ielement_clear_mock_location(LOCATION_IELEMENT(obj));
        LOC_IF_FAIL(ret, _E, "Fail to clear_mock_location [%s]", err_msg(ret));
@@ -735,13 +668,10 @@ location_set_fused_mode(LocationObject *obj, LocationFusedMode mode)
 EXPORT_API int
 location_enable_restriction(const int enable)
 {
-       int ret = LOCATION_ERROR_NONE;
        int restriction = 0;
+       int ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
+       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
 
-       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
-               ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
-               LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-       }
        if (enable) {
                int value = 0;
                ret = vconf_get_int(VCONFKEY_LOCATION_RESTRICT, &restriction);
index 8f6a648..8027cb5 100755 (executable)
@@ -31,7 +31,6 @@
 #define MAX_MODULE_INDEX 4
 
 #define MODULE_PATH_PREFIX LIBDIR"/location/module"
-/* const char *MODULE_PATH_PREFIX = "/usr/lib/location/module"; */
 
 static GMod *gmod_new(const char *module_name, gboolean is_resident)
 {
index 85b1bd6..1a0f800 100755 (executable)
@@ -1,6 +1,6 @@
 Name: liblbs-location
 Summary: Location Based Service Library
-Version: 1.4.1
+Version: 1.4.2
 Release: 1
 Group: Location/Libraries
 License: Apache-2.0
@@ -14,16 +14,13 @@ BuildRequires:  pkgconfig(gmodule-2.0)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(capi-appfw-app-manager)
-%if "%{TIZEN_PRODUCT_TV}" != "1"
 BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-session)
-%endif
 BuildRequires:  pkgconfig(json-glib-1.0)
 BuildRequires:  pkgconfig(bundle)
 BuildRequires:  pkgconfig(eventsystem)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(capi-system-sensor)
-BuildRequires:  pkgconfig(capi-system-info)
 
 %description
 Location Based Service Library
@@ -45,10 +42,6 @@ cp %{SOURCE1001} .
 
 
 %build
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
-export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-
 %ifarch %arm aarch64
 export CFLAGS="$CFLAGS -DTIZEN_DEVICE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEVICE"
@@ -59,9 +52,6 @@ export FFLAGS="$FFLAGS -DTIZEN_DEVICE"
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir} \
 -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
-%if "%{TIZEN_PRODUCT_TV}" == "1"
-       -DTIZEN_PRODUCT_TV_OPTIMIZATION:BOOL=ON
-%endif
 
 make %{?jobs:-j%jobs}