Add Account Support Macro 90/141890/1 accepted/tizen/4.0/unified/20170816.011829 accepted/tizen/4.0/unified/20170816.014945 accepted/tizen/unified/20170803.075305 submit/tizen/20170802.024424 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>
Wed, 2 Aug 2017 02:24:59 +0000 (11:24 +0900)
committerJooseok Song <seogii.song@samsung.com>
Wed, 2 Aug 2017 02:24:59 +0000 (11:24 +0900)
Change-Id: I393bb4b0087786b19f11311e6625b3d40a93445a

src/account.c

index dcb2d10898c995184bc3135a585eeb89615b492a..9a30a107cb28e04348b20ebea7e103f2b0d5620f 100644 (file)
@@ -27,6 +27,7 @@
 #include <pthread.h>
 #include <vconf.h>
 #include <pkgmgr_installer_info.h>
+#include <system_info.h>
 
 #include <dbg.h>
 #include <account-private.h>
 
 #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)
+
 #define ACCOUNT_DB_OPEN_READONLY 0
 #define ACCOUNT_DB_OPEN_READWRITE 1