*/
#include <aul.h>
+#include <system_info.h>
#include <Ecore_Wayland.h>
#include "vc_cmd_db.h"
#include "vc_command.h"
static int g_daemon_pid = 0;
+static int g_feature_enabled = -1;
+
static Eina_Bool __vc_widget_notify_state_changed(void *data);
static Eina_Bool __vc_widget_notify_error(void *data);
+static int __vc_widget_get_feature_enabled()
+{
+ if (0 == g_feature_enabled) {
+ SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Voice control feature NOT supported");
+ return VC_ERROR_NOT_SUPPORTED;
+ } else if (-1 == g_feature_enabled) {
+ bool vc_supported = false;
+ bool mic_supported = false;
+ if (0 == system_info_get_platform_bool(VC_FEATURE_PATH, &vc_supported)) {
+ if (0 == system_info_get_platform_bool(VC_MIC_FEATURE_PATH, &mic_supported)) {
+ if (false == vc_supported || false == mic_supported) {
+ SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Voice control feature NOT supported");
+ g_feature_enabled = 0;
+ return VC_ERROR_NOT_SUPPORTED;
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get feature value");
+ return VC_ERROR_NOT_SUPPORTED;
+ }
+ } else {
+ SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to get feature value");
+ return VC_ERROR_NOT_SUPPORTED;
+ }
+ }
+
+ return 0;
+}
+
const char* vc_tag()
{
return TAG_VCW;
{
SLOG(LOG_DEBUG, TAG_VCW, "@@@ [Widget] Initialize");
+ if (0 != __vc_widget_get_feature_enabled()) {
+ SLOG(LOG_ERROR, TAG_VCW, "@@@ [Widget] not supported");
+ return VC_ERROR_NOT_SUPPORTED;
+ }
+
if (NULL == vc_w) {
SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Input parameter is NULL");
return VC_ERROR_INVALID_PARAMETER;