static void __on_ambient_changed(int ambient, void *data);
static void __on_time_tick(void *watchtime, void *data);
+static bool __check_feature(void)
+{
+ static bool is_checked = false;
+ static bool is_supported = false;
+
+ if (is_checked)
+ return is_supported;
+ if (!system_info_get_platform_bool(WATCH_APP_FEATURE, &is_supported)) {
+ is_checked = true;
+ if (!is_supported) {
+ LOGE("[%s] feature is disabled", WATCH_APP_FEATURE);
+ return false;
+ }
+ }
+ return is_supported;
+}
+
static void __alarm_init(void)
{
int r = 0;
appcore_efl_base_ops ops = appcore_efl_base_get_default_ops();
char *viewer_visibility_str = NULL;
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
/* override methods */
ops.ui_base.base.create = __on_create;
{
app_event_handler_h handler;
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (event_handler == NULL || callback == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
int ret;
app_event_type_e type;
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (event_handler == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
{
struct _watch_time_s *time_info;
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_delete(watch_time_h watch_time)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_year(watch_time_h watch_time, int *year)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_month(watch_time_h watch_time, int *month)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_day(watch_time_h watch_time, int *day)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_day_of_week(watch_time_h watch_time,
int *day_of_week)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_hour(watch_time_h watch_time, int *hour)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_hour24(watch_time_h watch_time, int *hour24)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_minute(watch_time_h watch_time, int *minute)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_second(watch_time_h watch_time, int *second)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_millisecond(watch_time_h watch_time,
int *millisecond)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
{
time_t timestamp;
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL || utc_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_utc_timestamp(watch_time_h watch_time,
time_t *utc_timestamp)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_time_zone(watch_time_h watch_time,
char **time_zone_id)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL || watch_time->timezone == NULL
|| time_zone_id == NULL)
EXPORT_API int watch_time_get_dst_status(watch_time_h watch_time, bool *status)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (watch_time == NULL || status == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
EXPORT_API int watch_time_get_daylight_time_status(watch_time_h watch_time, bool *daylight)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
return watch_time_get_dst_status(watch_time, daylight);
}
Ecore_Wl_Window *wl_win;
char buffer[256];
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (win == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_app_set_ambient_tick_type(watch_app_ambient_tick_type_e type)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (type < WATCH_APP_AMBIENT_TICK_NO_TICK || type > WATCH_APP_AMBIENT_TICK_EVERY_DAY)
return APP_ERROR_INVALID_PARAMETER;
EXPORT_API int watch_app_get_ambient_tick_type(watch_app_ambient_tick_type_e *type)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (type == NULL)
return APP_ERROR_INVALID_PARAMETER;
EXPORT_API int watch_app_set_time_tick_frequency(int ticks, watch_app_time_tick_resolution_e type)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (type < WATCH_APP_TIME_TICKS_PER_SECOND || type > WATCH_APP_TIME_TICKS_PER_HOUR)
return APP_ERROR_INVALID_PARAMETER;
EXPORT_API int watch_app_get_time_tick_frequency(int *ticks, watch_app_time_tick_resolution_e *type)
{
- CHECK_WATCH_APP_FEATURE();
+ if (!__check_feature())
+ return APP_ERROR_NOT_SUPPORTED;
if (type == NULL || ticks == NULL)
return APP_ERROR_INVALID_PARAMETER;