Add Account Support Macro 92/141892/1 accepted/tizen/3.0/common/20170803.140539 accepted/tizen/3.0/ivi/20170803.011058 accepted/tizen/3.0/mobile/20170803.011049 accepted/tizen/3.0/wearable/20170803.011053 submit/tizen_3.0/20170802.024401
authorJooseok Song <seogii.song@samsung.com>
Wed, 2 Aug 2017 02:26:24 +0000 (11:26 +0900)
committerJooseok Song <seogii.song@samsung.com>
Wed, 2 Aug 2017 02:26:24 +0000 (11:26 +0900)
Change-Id: Ia551f033684413fa83c96342a21dc07bbdd92b41

src/account.c

index 9f04dcc..d93f861 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>
 #include "account_private_client.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