Add feature check for vc_widget 67/167967/1
authorsungrae jo <seongrae.jo@samsung.com>
Fri, 19 Jan 2018 08:18:15 +0000 (17:18 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Tue, 23 Jan 2018 06:06:22 +0000 (06:06 +0000)
Change-Id: If44f3a47174b9320748116798412cba11caf626a
Signed-off-by: sungrae jo <seongrae.jo@samsung.com>
(cherry picked from commit 29d4307edf01b7361bf0a72327ae405bc84d0508)

client/vc_widget.c

index 7fd9c4a..89426e1 100644 (file)
@@ -256,6 +256,11 @@ int vc_widget_deinitialize(vc_h vc_w)
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Deinitialize");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (false == vc_widget_client_is_valid(vc_w)) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] NOT initialized");
                SLOG(LOG_DEBUG, TAG_VCW, "@@@");
@@ -411,6 +416,11 @@ int vc_widget_prepare(vc_h vc_w)
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Prepare");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        vc_state_e state;
        if (0 != vc_widget_client_get_state(vc_w, &state)) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] A handle is not available");
@@ -443,6 +453,11 @@ int vc_widget_unprepare(vc_h vc_w)
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Unprepare");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        vc_state_e state;
        if (0 != vc_widget_client_get_state(vc_w, &state)) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] A handle is not available");
@@ -471,6 +486,11 @@ int vc_widget_enable_asr_result(vc_h vc_w, bool enable)
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Enable asr result");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        vc_state_e state;
        if (0 != vc_widget_client_get_state(vc_w, &state)) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] A handle is not available");
@@ -517,6 +537,11 @@ int vc_widget_foreach_supported_languages(vc_h vc_w, vc_supported_language_cb ca
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Foreach Supported Language");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == callback) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                SLOG(LOG_DEBUG, TAG_VCW, "@@@");
@@ -546,6 +571,11 @@ int vc_widget_get_current_language(vc_h vc_w, char** language)
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Get Current Language");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == language) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                SLOG(LOG_DEBUG, TAG_VCW, "@@@");
@@ -575,6 +605,11 @@ int vc_widget_get_state(vc_h vc_w, vc_state_e* state)
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Get State");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == state) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -605,6 +640,11 @@ int vc_widget_get_service_state(vc_h vc_w, vc_service_state_e* state)
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Get Service State");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == state) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -649,6 +689,11 @@ int vc_widget_set_foreground(vc_h vc_w, bool value)
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Set foreground state");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        vc_state_e state;
        if (0 != vc_widget_client_get_state(vc_w, &state)) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] A handle is not valid");
@@ -881,6 +926,11 @@ int vc_widget_cancel(vc_h vc_w)
 {
        SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Cancel Recognition");
 
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        vc_state_e state;
        if (0 != vc_widget_client_get_state(vc_w, &state)) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] A handle is not available");
@@ -1270,6 +1320,11 @@ static Eina_Bool __vc_widget_notify_state_changed(void *data)
 
 int vc_widget_set_result_cb(vc_h vc_w, vc_result_cb callback, void* user_data)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1297,6 +1352,11 @@ int vc_widget_set_result_cb(vc_h vc_w, vc_result_cb callback, void* user_data)
 
 int vc_widget_unset_result_cb(vc_h vc_w)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1322,6 +1382,11 @@ int vc_widget_unset_result_cb(vc_h vc_w)
 
 int vc_widget_set_show_tooltip_cb(vc_h vc_w, vc_widget_show_tooltip_cb callback, void* user_data)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1350,6 +1415,11 @@ int vc_widget_set_show_tooltip_cb(vc_h vc_w, vc_widget_show_tooltip_cb callback,
 
 int vc_widget_unset_show_tooltip_cb(vc_h vc_w)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1375,6 +1445,11 @@ int vc_widget_unset_show_tooltip_cb(vc_h vc_w)
 
 int vc_widget_set_send_current_command_list_cb(vc_h vc_w, vc_widget_send_current_command_list_cb callback, void* user_data)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1400,6 +1475,11 @@ int vc_widget_set_send_current_command_list_cb(vc_h vc_w, vc_widget_send_current
 
 int vc_widget_unset_send_current_command_list_cb(vc_h vc_w)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1471,6 +1551,11 @@ int __vc_widget_cb_service_state(int state)
 
 int vc_widget_set_service_state_changed_cb(vc_h vc_w, vc_service_state_changed_cb callback, void* user_data)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1496,6 +1581,11 @@ int vc_widget_set_service_state_changed_cb(vc_h vc_w, vc_service_state_changed_c
 
 int vc_widget_unset_service_state_changed_cb(vc_h vc_w)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1521,6 +1611,11 @@ int vc_widget_unset_service_state_changed_cb(vc_h vc_w)
 
 int vc_widget_set_state_changed_cb(vc_h vc_w, vc_state_changed_cb callback, void* user_data)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1549,6 +1644,11 @@ int vc_widget_set_state_changed_cb(vc_h vc_w, vc_state_changed_cb callback, void
 
 int vc_widget_unset_state_changed_cb(vc_h vc_w)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1574,6 +1674,11 @@ int vc_widget_unset_state_changed_cb(vc_h vc_w)
 
 int vc_widget_set_asr_result_cb(vc_h vc_w, vc_asr_result_cb callback, void* user_data)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1602,6 +1707,11 @@ int vc_widget_set_asr_result_cb(vc_h vc_w, vc_asr_result_cb callback, void* user
 
 int vc_widget_unset_asr_result_cb(vc_h vc_w)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1627,6 +1737,11 @@ int vc_widget_unset_asr_result_cb(vc_h vc_w)
 
 int vc_widget_set_current_language_changed_cb(vc_h vc_w, vc_current_language_changed_cb callback, void* user_data)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1655,6 +1770,11 @@ int vc_widget_set_current_language_changed_cb(vc_h vc_w, vc_current_language_cha
 
 int vc_widget_unset_current_language_changed_cb(vc_h vc_w)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1680,6 +1800,11 @@ int vc_widget_unset_current_language_changed_cb(vc_h vc_w)
 
 int vc_widget_set_error_cb(vc_h vc_w, vc_error_cb callback, void* user_data)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -1708,6 +1833,11 @@ int vc_widget_set_error_cb(vc_h vc_w, vc_error_cb callback, void* user_data)
 
 int vc_widget_unset_error_cb(vc_h vc_w)
 {
+       if (0 != __vc_widget_get_feature_enabled()) {
+               SLOG(LOG_INFO, TAG_VCW, "@@@ [Widget] not supported");
+               return VC_ERROR_NONE;
+       }
+
        if (NULL == vc_w) {
                SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;