Remove Profile Build Dependency 38/98438/3 accepted/tizen/common/20161124.170040 accepted/tizen/ivi/20161125.003440 accepted/tizen/mobile/20161125.003342 accepted/tizen/tv/20161125.003354 accepted/tizen/wearable/20161125.003420 submit/tizen/20161123.082735 submit/tizen/20161123.234422
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 17 Nov 2016 09:26:13 +0000 (18:26 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Tue, 22 Nov 2016 07:12:09 +0000 (16:12 +0900)
- This is for Tizen 4.0.
  (4.0 Configurability & Building Blocks requires not to use
  profile macro soon.)

- Disabling cynara-usage is now limited to TV Product only
 because they are for optimization, not correctness.

Change-Id: Id60e194059eb260a2b88c391a50471f5fee73e10
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
CMakeLists.txt
location/CMakeLists.txt
location/manager/location-batch.c
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
packaging/liblbs-location.changes
packaging/liblbs-location.spec

index cdd8e96..cb7fe72 100755 (executable)
@@ -9,22 +9,18 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 # Set required packages
 INCLUDE(FindPkgConfig)
 
-IF(FEATURE_PROFILE_TV)
-        MESSAGE("<<< TV Profile >>>")
-        ADD_DEFINITIONS("-DTIZEN_PROFILE_TV")
+IF(TIZEN_PRODUCT_TV_OPTIMIZATION)
+        MESSAGE("<<< TV Product Optimization >>>")
+        ADD_DEFINITIONS("-DTIZEN_PRODUCT_TV_OPTIMIZATION")
        SET(PRIVACY_PKG "")
-ELSE(FEATURE_PROFILE_TV)
+ELSE(TIZEN_PRODUCT_TV_OPTIMIZATION)
+        MESSAGE("<<< Non-TV Profile >>>")
        SET(PRIVACY_PKG "cynara-client cynara-session")
-
-       IF(FEATURE_PROFILE_WEARABLE)
-               MESSAGE("<<< Wearable Profile >>>")
-       ELSE(FEATURE_PROFILE_WEARABLE)
-               MESSAGE("<<< Mobile Profile >>>")
-       ENDIF(FEATURE_PROFILE_WEARABLE)
-ENDIF(FEATURE_PROFILE_TV)
+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 ${PRIVACY_PKG})
+               dlog vconf json-glib-1.0 bundle eventsystem libtzplatform-config capi-system-sensor
+               capi-system-info ${PRIVACY_PKG})
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 8c5e42a..7e0eb09 100644 (file)
@@ -6,17 +6,11 @@ SET(INC_DIR "include")
 SET(MANAGER_DIR "manager")
 SET(MODULE_DIR "module")
 
-IF(FEATURE_PROFILE_TV)
+IF(TIZEN_PRODUCT_TV_OPTIMIZATION)
        SET (PRIVACY_SRC "")
-ELSE(FEATURE_PROFILE_TV)
+ELSE(TIZEN_PRODUCT_TV_OPTIMIZATION)
        SET (PRIVACY_SRC "${MANAGER_DIR}/location-privacy.c")
-ENDIF(FEATURE_PROFILE_TV)
-
-IF(FEATURE_PROFILE_WEARABLE)
-       MESSAGE("<<< Wearable Profile >>>")
-ELSE(FEATURE_PROFILE_WEARABLE)
-       MESSAGE("<<< Mobile Profile >>>")
-ENDIF(FEATURE_PROFILE_WEARABLE)
+ENDIF(TIZEN_PRODUCT_TV_OPTIMIZATION)
 
 ADD_DEFINITIONS("-DLIBDIR=\"${LIBDIR}\"")
 
index 66e86d1..ed4c366 100755 (executable)
@@ -128,7 +128,7 @@ location_get_batch_file(int num_of_location)
        return batch;
 }
 
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
+#if defined(TIZEN_DEVICE)
 EXPORT_API gboolean location_set_sensor_batch(LocationBatch *batch, sensor_event_s *event)
 {
        g_return_val_if_fail(batch, FALSE);
index b03bc00..2a7a538 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)
@@ -276,3 +278,36 @@ 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 3491a46..eefacb5 100644 (file)
@@ -85,4 +85,13 @@ 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 afc1f6b..3e53c9f 100755 (executable)
@@ -70,7 +70,7 @@ typedef struct _LocationGpsPrivate {
        LocationAccuracy        *acc;
        LocationSatellite       *sat;
        GList                           *boundary_list;
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
+#if defined(TIZEN_DEVICE)
        sensor_h sensor;
        sensor_listener_h sensor_listener;
 #endif
@@ -345,7 +345,7 @@ static int location_gps_stop(LocationGps *self)
        return ret;
 }
 
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
+#if defined(TIZEN_DEVICE)
 static void __sensor_event_cb(sensor_h s, sensor_event_s *event, void *data)
 {
        LocationGpsPrivate *priv = GET_PRIVATE(data);
@@ -453,8 +453,9 @@ static int location_gps_start_batch(LocationGps *self)
                }
 #endif
 
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
-               return  __set_sensor_batch(self, priv->batch_interval);
+#if defined(TIZEN_DEVICE)
+               if (_get_tizen_profile() != TIZEN_PROFILE_TV)
+                       return  __set_sensor_batch(self, priv->batch_interval);
 #endif
        }
 
@@ -472,24 +473,28 @@ static int location_gps_stop_batch(LocationGps *self)
 
        int ret = LOCATION_ERROR_NONE;
 
-#if defined(TIZEN_DEVICE) && !defined(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));
+#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_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
-       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));
+               ret = sensor_destroy_listener(priv->sensor_listener);
+               LOC_IF_FAIL_LOG(ret, _E, "Fail to destroy_listener [%s]", err_msg(ret));
        } else {
-               return LOCATION_ERROR_NONE;
-       }
+#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;
+               }
+       }
 
        __reset_pos_data_from_priv(priv);
 
@@ -1128,9 +1133,11 @@ static void location_gps_init(LocationGps *self)
        priv->boundary_list = NULL;
        priv->loc_timeout = 0;
 
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
-       priv->sensor = NULL;
-       priv->sensor_listener = NULL;
+#if defined(TIZEN_DEVICE)
+       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
+               priv->sensor = NULL;
+               priv->sensor_listener = NULL;
+       }
 #endif
 
        priv->app_type = location_get_app_type(NULL);
index 6927ab6..ef0876b 100644 (file)
 #ifndef __LOCATION_PRIVACY_H__
 #define __LOCATION_PRIVACY_H__
 
-int location_check_cynara(const char *privilege_name);
+#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 fa83b32..da8f8ba 100755 (executable)
@@ -38,9 +38,7 @@
 #include "location-position.h"
 #include "module-internal.h"
 #include "location-common-util.h"
-#ifndef TIZEN_PROFILE_TV
 #include "location-privacy.h"
-#endif
 
 #define LOCATION_PRIVILEGE                     "http://tizen.org/privilege/location"
 #define LOCATION_ENABLE_PRIVILEGE      "http://tizen.org/privilege/location.enable"
@@ -228,10 +226,10 @@ location_start(LocationObject *obj)
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
 
        int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        ret = location_ielement_start(LOCATION_IELEMENT(obj));
        LOC_IF_FAIL(ret, _E, "Fail to start [%s]", err_msg(ret));
@@ -257,10 +255,10 @@ location_start_batch(LocationObject *obj)
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        ret = location_ielement_start_batch(LOCATION_IELEMENT(obj));
        LOC_IF_FAIL(ret, _E, "Fail to start_batch [%s]", err_msg(ret));
@@ -336,10 +334,10 @@ location_enable_method(const LocationMethod method, const int enable)
        int ret = 0;
        char *_key = NULL;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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 (location_setting_get_int(VCONFKEY_LOCATION_RESTRICT) > RESTRICT_OFF) {
                LOCATION_SECLOG("Location setting is denied by DPM");
@@ -437,10 +435,10 @@ location_get_position(LocationObject *obj, LocationPosition **position, Location
 
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        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));
@@ -458,10 +456,10 @@ location_get_position_ext(LocationObject *obj, LocationPosition **position, Loca
 
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        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));
@@ -478,10 +476,10 @@ location_get_last_position(LocationObject *obj, LocationPosition **position, Loc
 
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        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));
@@ -499,10 +497,10 @@ location_get_last_position_ext(LocationObject *obj, LocationPosition **position,
 
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        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));
@@ -532,10 +530,10 @@ location_get_satellite(LocationObject *obj, LocationSatellite **satellite)
 
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        ret = location_ielement_get_satellite(LOCATION_IELEMENT(obj), satellite);
        LOC_IF_FAIL(ret, _E, "Fail to get_satellite [%s]", err_msg(ret));
@@ -551,10 +549,10 @@ location_get_batch(LocationObject *obj, LocationBatch **batch)
 
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        ret = location_ielement_get_batch(LOCATION_IELEMENT(obj), batch);
        LOC_IF_FAIL(ret, _E, "Fail to get_batch [%s]", err_msg(ret));
@@ -570,10 +568,10 @@ location_get_last_satellite(LocationObject *obj, LocationSatellite **satellite)
 
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        ret = location_ielement_get_last_satellite(LOCATION_IELEMENT(obj), satellite);
        LOC_IF_FAIL(ret, _E, "Fail to get_last_satellite [%s]", err_msg(ret));
@@ -590,10 +588,10 @@ location_get_velocity(LocationObject *obj, LocationVelocity **velocity, Location
 
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        ret = location_ielement_get_velocity(LOCATION_IELEMENT(obj), velocity, accuracy);
        LOC_IF_FAIL(ret, _E, "Fail to get_velocity [%s]", err_msg(ret));
@@ -610,10 +608,10 @@ location_get_last_velocity(LocationObject *obj, LocationVelocity **velocity, Loc
 
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        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));
@@ -624,18 +622,18 @@ location_get_last_velocity(LocationObject *obj, LocationVelocity **velocity, Loc
 EXPORT_API int
 location_get_accessibility_state(LocationAccessState *state)
 {
-#ifndef TIZEN_PROFILE_TV
-       int ret = location_check_cynara(LOCATION_PRIVILEGE);
+       if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
+               int ret = location_check_cynara(LOCATION_PRIVILEGE);
 
-       if (ret == LOCATION_ERROR_NONE) {
-               *state = LOCATION_ACCESS_ALLOWED;
+               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 {
-               *state = LOCATION_ACCESS_DENIED;
-               LOCATION_LOGE("Cannot use location service for privacy[%d]", ret);
+               *state = LOCATION_ACCESS_ALLOWED;
        }
-#else
-       *state = LOCATION_ACCESS_ALLOWED;
-#endif
 
        return LOCATION_ERROR_NONE;
 }
@@ -676,10 +674,10 @@ location_set_option(LocationObject *obj, const char *option)
        g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
        ret = location_ielement_set_option(LOCATION_IELEMENT(obj), option);
        LOC_IF_FAIL(ret, _E, "Fail to get_velocity [%s]", err_msg(ret));
@@ -695,10 +693,10 @@ location_enable_mock(const int enable)
 {
        int ret = LOCATION_ERROR_NONE;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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));
+       }
 
 #if 0 /* Tizen platform didn't turn developer option on */
        gboolean developer_option = FALSE;
@@ -749,10 +747,10 @@ location_enable_restriction(const int enable)
        int ret = LOCATION_ERROR_NONE;
        int restriction = 0;
 
-#ifndef TIZEN_PROFILE_TV
-       ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
-       LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+       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 46169db..80c7ae2 100644 (file)
@@ -1,3 +1,9 @@
+[Version]      libslp-location_1.3.6
+[Date]         22 Nov 2016
+[Changes]      Remove Profile Build Dependency
+[Developer]    Kyoungjun Sung <kj7.sung@samsung.com>
+
+================================================================================
 [Version]      libslp-location_1.3.5
 [Date]         28 Oct 2016
 [Changes]      Dynamic interval table for multi handle
index e29c2cf..c3543ae 100755 (executable)
@@ -1,6 +1,6 @@
 Name: liblbs-location
 Summary: Location Based Service Library
-Version: 1.3.5
+Version: 1.3.6
 Release: 1
 Group: Location/Libraries
 License: Apache-2.0
@@ -14,7 +14,7 @@ BuildRequires:  pkgconfig(gmodule-2.0)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(capi-appfw-app-manager)
-%if "%{profile}" != "tv"
+%if "%{TIZEN_PRODUCT_TV}" != "1"
 BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-session)
 %endif
@@ -23,6 +23,7 @@ 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
@@ -58,14 +59,9 @@ 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 "%{profile}" == "wearable"
-       -DFEATURE_PROFILE_WEARABLE:BOOL=ON \
+%if "%{TIZEN_PRODUCT_TV}" == "1"
+       -DTIZEN_PRODUCT_TV_OPTIMIZATION:BOOL=ON
 %endif
-%if "%{profile}" == "tv"
-       -DFEATURE_PROFILE_TV:BOOL=ON
-%endif
-
-
 
 make %{?jobs:-j%jobs}