From 88cbe6f237989c3902c09107b1431e3a8a239adf Mon Sep 17 00:00:00 2001 From: Yunjin Lee Date: Wed, 7 Dec 2016 16:32:04 +0900 Subject: [PATCH] Add DISABLE_ASKUSER definition for profiles not using it Change-Id: Iaf37662cc564544cc4756f02f6f0ccafd9dbe917 Signed-off-by: Yunjin Lee --- capi/CMakeLists.txt | 9 +++++++++ capi/src/privilege_info.c | 4 ++-- packaging/privilege-checker.spec | 6 ++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/capi/CMakeLists.txt b/capi/CMakeLists.txt index 2ad95d3..13b99a2 100644 --- a/capi/CMakeLists.txt +++ b/capi/CMakeLists.txt @@ -38,6 +38,15 @@ ELSEIF("${PROFILE_TYPE}" STREQUAL "TV") ADD_DEFINITIONS("-DPROFILE_TYPE_TV") ENDIF() +MESSAGE("PROFILE = ${PROFILE}") +IF("${PROFILE}" STREQUAL "WEARABLE") + ADD_DEFINITIONS("-DENABLE_ASKUSER") +ELSEIF("${PROFILE}" STREQUAL "MOBILE") + ADD_DEFINITIONS("-DENABLE_ASKUSER") +ELSE() + ADD_DEFINITIONS("-DDISABLE_ASKUSER") +ENDIF() + SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}") aux_source_directory(src SOURCES) diff --git a/capi/src/privilege_info.c b/capi/src/privilege_info.c index 7dc7619..02e7251 100755 --- a/capi/src/privilege_info.c +++ b/capi/src/privilege_info.c @@ -507,7 +507,7 @@ int privilege_info_get_privilege_description(const char *privilege, char **descr int privilege_info_is_privacy(const char* privilege) { TryReturn(privilege != NULL, , PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] privilege is NULL"); -#ifdef PROFILE_TYPE_TV +#ifdef DISABLE_ASKUSER return 0; #else int ret = privilege_db_manager_is('p', privilege); @@ -523,7 +523,7 @@ int privilege_info_is_privacy2(const char* label, const char* privilege) TryReturn(privilege != NULL, , PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] privilege is NULL"); if (label == NULL) return privilege_info_is_privacy(privilege); -#ifdef PROFILE_TYPE_TV +#ifdef DISABLE_ASKUSER return 0; #else int ret = privilege_db_manager_is('p', privilege); diff --git a/packaging/privilege-checker.spec b/packaging/privilege-checker.spec index 22c07a2..5080e64 100644 --- a/packaging/privilege-checker.spec +++ b/packaging/privilege-checker.spec @@ -95,7 +95,8 @@ echo cmake . -DPREFIX=%{_prefix} \ -DVERSION=%{version} \ -DDPL_LOG="ON" \ -DDATADIR=%{_datadir} \ - -DPROFILE_TYPE="${__PROFILE_TYPE}" + -DPROFILE_TYPE="${__PROFILE_TYPE}" \ + -DPROFILE=%{?profile} cmake . -DPREFIX=%{_prefix} \ -DEXEC_PREFIX=%{_exec_prefix} \ @@ -105,7 +106,8 @@ cmake . -DPREFIX=%{_prefix} \ -DVERSION=%{version} \ -DDPL_LOG="ON" \ -DDATADIR=%{_datadir} \ - -DPROFILE_TYPE="${__PROFILE_TYPE}" + -DPROFILE_TYPE="${__PROFILE_TYPE}" \ + -DPROFILE=%{?profile} make %{?jobs:-j%jobs} -- 2.7.4