Add not supported error exception 32/139032/2 accepted/tizen/4.0/unified/20170816.013602 accepted/tizen/4.0/unified/20170816.020038 accepted/tizen/unified/20170731.020727 submit/tizen/20170728.003408 submit/tizen/20170728.041240 submit/tizen/20170728.074836 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0_unified/20170814.115522
authorJooseok Song <seogii.song@samsung.com>
Mon, 17 Jul 2017 04:30:14 +0000 (13:30 +0900)
committerJooseok Song <seogii.song@samsung.com>
Mon, 17 Jul 2017 04:40:23 +0000 (04:40 +0000)
Change-Id: I457429517333e916c96f236b33876a03f4609aa5

common/CMakeLists.txt
common/include/account-private.h
packaging/account-common.spec

index e739228edd2589f2f033edae1175facd83ee11c3..c2989bfd8050bd673926baf598a576e107f4fcf5 100644 (file)
@@ -16,6 +16,7 @@ pkg_check_modules(clientpkgs REQUIRED
                glib-2.0
                gio-unix-2.0
                capi-base-common
+               capi-system-info
                db-util
                vconf
                pkgmgr-info
index 0a5906b3d785ed5225235d012e26a2533369df33..82ab7cdd33a1d863899ce7ae01f5b1f572b77e34 100644 (file)
@@ -32,6 +32,7 @@ extern "C"
 
 #include <glib.h>
 #include <dlog.h>
+#include <system_info.h>
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -314,6 +315,23 @@ typedef struct GSList account_iterator_s;
 /* Used by both accounts and gtme. However as of now, gtme does not have any dependency on account, so duplicating the same */
 #define MAX_SYS_CONTEXT_SIZE 1024
 
+#define ACCOUNT_FEATURE "http://tizen.org/feature/account"
+
+#define CHECK_ACCOUNT_SUPPORTED(feature_name) \
+do { \
+       bool is_supported = false; \
+       if (!system_info_get_platform_bool(feature_name, &is_supported)) { \
+               if (is_supported == false) { \
+                       LOGE("[%s] feature is disabled", feature_name); \
+                       return ACCOUNT_ERROR_NOT_SUPPORTED; \
+               } \
+       } else { \
+               LOGE("Error - Feature getting from System Info"); \
+               return ACCOUNT_ERROR_OPERATION_FAIL; \
+       } \
+} while (0)
+
+
 #ifdef __cplusplus
 }
 #endif
index 4e4bed73ea6258bb26fcffe5f640aba4609ce3a4..9ae8ab5b5d125fd82eaa3586c5ce5ad258521bc1 100644 (file)
@@ -1,6 +1,6 @@
 Name:       account-common
 Summary:    Account common library
-Version:    0.1.12
+Version:    0.1.13
 Release:    1
 Group:      Social & Content/API
 License:    Apache-2.0
@@ -9,6 +9,7 @@ Source0:    account-common-%{version}.tar.gz
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(capi-base-common)
+BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(glib-2.0) >= 2.26
 BuildRequires:  pkgconfig(gio-unix-2.0)
 BuildRequires:  pkgconfig(db-util)