}
int ret;
- int count = 0;
- do {
- ret = vc_mgr_dbus_request_enable_command_type(g_vc_m->handle, cmd_type);
- if (0 != ret) {
- if (VC_ERROR_TIMED_OUT != ret) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to request enable command type : %s", __vc_mgr_get_error_code(ret));
- break;
- } else {
- SLOG(LOG_WARN, TAG_VCM, "[WARNING] retry request enable command type : %s", __vc_mgr_get_error_code(ret));
- usleep(10000);
- count++;
- if (VC_RETRY_COUNT == count) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to request");
- break;
- }
- }
- }
- } while (0 != ret);
+
+ ret = vc_mgr_client_enable_command_type(g_vc_m, (vc_cmd_type_e)cmd_type); // enable the cmd type
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to enable the command type(%d). ret(%d)", cmd_type, ret);
+ } else {
+ SLOG(LOG_DEBUG, TAG_VCM, "[DEBUG] Success to enable the command type(%d)", cmd_type);
+ }
SLOG(LOG_ERROR, TAG_VCM, "@@@, ret(%d)", ret);
}
int ret;
- int count = 0;
- do {
- ret = vc_mgr_dbus_request_disable_command_type(g_vc_m->handle, cmd_type);
- if (0 != ret) {
- if (VC_ERROR_TIMED_OUT != ret) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to request disable command type : %s", __vc_mgr_get_error_code(ret));
- break;
- } else {
- SLOG(LOG_WARN, TAG_VCM, "[WARNING] retry request disable command type : %s", __vc_mgr_get_error_code(ret));
- usleep(10000);
- count++;
- if (VC_RETRY_COUNT == count) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to request");
- break;
- }
- }
- }
- } while (0 != ret);
+
+ ret = vc_mgr_client_disable_command_type(g_vc_m, (vc_cmd_type_e)cmd_type); // enable the cmd type
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to disable the command type(%d). ret(%d)", cmd_type, ret);
+ } else {
+ SLOG(LOG_DEBUG, TAG_VCM, "[DEBUG] Success to disable the command type(%d)", cmd_type);
+ }
SLOG(LOG_ERROR, TAG_VCM, "@@@, ret(%d)", ret);
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to get start by client");
}
+ int disabled_cmd_type = 0;
+ if (0 != vc_mgr_client_get_disabled_command_type(g_vc_m, &disabled_cmd_type)) {
+ SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to get disabled command type");
+ }
+
int ret;
int count = 0;
vc_recognition_mode_e recognition_mode = VC_RECOGNITION_MODE_STOP_BY_SILENCE;
count = 0;
while (0 != ret) {
vc_mgr_client_set_internal_state(g_vc_m, VC_INTERNAL_STATE_STARTING);
- ret = vc_mgr_dbus_request_start(g_vc_m->handle, (int)recognition_mode, exclusive_command_option, start_by_client);
+ ret = vc_mgr_dbus_request_start(g_vc_m->handle, (int)recognition_mode, exclusive_command_option, start_by_client, disabled_cmd_type);
if (0 != ret) {
if (VC_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to start request start : %s", __vc_mgr_get_error_code(ret));
/* audio type */
char* audio_id;
+ /* disabled command type */
+ int disabled_cmd_type;
+
/* recognition mode */
vc_recognition_mode_e recognition_mode;
client->cb_ref_count = 0;
+ client->disabled_cmd_type = 0x00;
+
/* Authority */
client->authorized_client_list = NULL;
client->valid_authorized_pid = -1;
return 0;
}
+int vc_mgr_client_enable_command_type(vc_h vc, vc_cmd_type_e cmd_type)
+{
+ SLOG(LOG_INFO, TAG_VCM, "[Manager INFO] enable command type (%d)", cmd_type);
+
+ vc_mgr_client_s* client = __mgr_client_get(vc);
+
+ /* check handle */
+ if (NULL == client)
+ return VC_ERROR_INVALID_PARAMETER;
+
+ client->disabled_cmd_type &= ~(1 << cmd_type);
+
+ return 0;
+}
+
+int vc_mgr_client_disable_command_type(vc_h vc, vc_cmd_type_e cmd_type)
+{
+ SLOG(LOG_INFO, TAG_VCM, "[Manager INFO] disable command type (%d)", cmd_type);
+
+ vc_mgr_client_s* client = __mgr_client_get(vc);
+
+ /* check handle */
+ if (NULL == client)
+ return VC_ERROR_INVALID_PARAMETER;
+
+ client->disabled_cmd_type |= (1 << cmd_type);
+
+ return 0;
+}
+
+int vc_mgr_client_get_disabled_command_type(vc_h vc, int* disabled_cmd_type)
+{
+ SLOG(LOG_INFO, TAG_VCM, "[Manager INFO] get disabled command type");
+
+ vc_mgr_client_s* client = __mgr_client_get(vc);
+
+ /* check handle */
+ if (NULL == client)
+ return VC_ERROR_INVALID_PARAMETER;
+
+ *disabled_cmd_type = client->disabled_cmd_type;
+
+ return 0;
+}
+
int vc_mgr_client_set_exclusive_command(vc_h vc, bool value)
{
vc_mgr_client_s* client = __mgr_client_get(vc);
int vc_mgr_client_get_error_message(vc_h vc, char** err_msg);
+int vc_mgr_client_enable_command_type(vc_h vc, vc_cmd_type_e cmd_type);
+
+int vc_mgr_client_disable_command_type(vc_h vc, vc_cmd_type_e cmd_type);
+
+int vc_mgr_client_get_disabled_command_type(vc_h vc, int* disabled_cmd_type);
+
int vc_mgr_client_set_exclusive_command(vc_h vc, bool value);
bool vc_mgr_client_get_exclusive_command(vc_h vc);
return 0;
}
-int vc_mgr_dbus_request_start(int pid, int recognition_mode, bool exclusive_command_option, bool start_by_client)
+int vc_mgr_dbus_request_start(int pid, int recognition_mode, bool exclusive_command_option, bool start_by_client, int disabled_cmd_type)
{
if (0 != __dbus_check()) {
return VC_ERROR_OPERATION_FAILED;
SLOG(LOG_ERROR, TAG_VCM, "@@ vc mgr start : Fail to make message ");
return VC_ERROR_OPERATION_FAILED;
} else {
- SLOG(LOG_INFO, TAG_VCM, "@@ vc mgr start : pid(%d), recognition_mode(%d) exclusive(%d) start by client(%d)",
- pid, recognition_mode, exclusive_command_option, start_by_client);
+ SLOG(LOG_INFO, TAG_VCM, "@@ vc mgr start : pid(%d), recognition_mode(%d) exclusive(%d) start by client(%d) disabled cmd type(%d)",
+ pid, recognition_mode, exclusive_command_option, start_by_client, disabled_cmd_type);
}
int exclusive = (int)exclusive_command_option;
DBUS_TYPE_INT32, &(recognition_mode),
DBUS_TYPE_INT32, &(exclusive),
DBUS_TYPE_INT32, &(by),
+ DBUS_TYPE_INT32, &(disabled_cmd_type),
DBUS_TYPE_INVALID);
DBusMessage* result_msg;
return result;
}
-int vc_mgr_dbus_request_enable_command_type(int pid, int cmd_type)
-{
- if (0 != __dbus_check()) {
- return VC_ERROR_OPERATION_FAILED;
- }
-
- DBusError err;
- dbus_error_init(&err);
-
- bool exist = dbus_bus_name_has_owner(g_m_conn_sender, VC_SERVER_SERVICE_NAME, &err);
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Dbus Error (%s)", err.message);
- dbus_error_free(&err);
- }
-
- int ret;
- if (false == exist) {
- ret = __dbus_restore_daemon();
- if (VC_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to restore daemon");
- return VC_ERROR_TIMED_OUT;
- }
- return VC_ERROR_OPERATION_FAILED;
- }
-
- DBusMessage* msg;
-
- /* create a signal & check for errors */
- msg = dbus_message_new_method_call(
- VC_SERVER_SERVICE_NAME,
- VC_SERVER_SERVICE_OBJECT_PATH, /* object name of the signal */
- VC_SERVER_SERVICE_INTERFACE, /* interface name of the signal */
- VC_MANAGER_METHOD_ENABLE_COMMAND_TYPE); /* name of the signal */
-
- if (NULL == msg) {
- SLOG(LOG_ERROR, TAG_VCM, "@@ vc enable command type : Fail to make message ");
- return VC_ERROR_OPERATION_FAILED;
- } else {
- SLOG(LOG_INFO, TAG_VCM, "@@ vc enable command type : pid(%d) type(%d)", pid, cmd_type);
- }
-
- dbus_message_append_args(msg,
- DBUS_TYPE_INT32, &pid,
- DBUS_TYPE_INT32, &cmd_type,
- DBUS_TYPE_INVALID);
-
- DBusMessage* result_msg;
- int result = VC_ERROR_OPERATION_FAILED;
-
- result_msg = dbus_connection_send_with_reply_and_block(g_m_conn_sender, msg, g_m_waiting_time, &err);
- dbus_message_unref(msg);
-
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Dbus Error (%s)", err.message);
- dbus_error_free(&err);
- }
-
- if (NULL != result_msg) {
- dbus_message_get_args(result_msg, &err,
- DBUS_TYPE_INT32, &result,
- DBUS_TYPE_INVALID);
-
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_VCM, "@@ Get arguments error (%s)", err.message);
- dbus_error_free(&err);
- result = VC_ERROR_OPERATION_FAILED;
- }
- dbus_message_unref(result_msg);
-
- if (0 == result) {
- SLOG(LOG_INFO, TAG_VCM, "@@ vc enable command type : result = %d", result);
- } else {
- SLOG(LOG_ERROR, TAG_VCM, "@@ vc enable command type : result = %d", result);
- }
- } else {
- SLOG(LOG_ERROR, TAG_VCM, "@@ Result Message is NULL");
- vc_mgr_dbus_reconnect();
- result = VC_ERROR_TIMED_OUT;
- }
-
- return result;
-}
-
-int vc_mgr_dbus_request_disable_command_type(int pid, int cmd_type)
-{
- if (0 != __dbus_check()) {
- return VC_ERROR_OPERATION_FAILED;
- }
-
- DBusError err;
- dbus_error_init(&err);
-
- bool exist = dbus_bus_name_has_owner(g_m_conn_sender, VC_SERVER_SERVICE_NAME, &err);
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Dbus Error (%s)", err.message);
- dbus_error_free(&err);
- }
-
- int ret;
- if (false == exist) {
- ret = __dbus_restore_daemon();
- if (VC_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to restore daemon");
- return VC_ERROR_TIMED_OUT;
- }
- return VC_ERROR_OPERATION_FAILED;
- }
-
- DBusMessage* msg;
-
- /* create a signal & check for errors */
- msg = dbus_message_new_method_call(
- VC_SERVER_SERVICE_NAME,
- VC_SERVER_SERVICE_OBJECT_PATH, /* object name of the signal */
- VC_SERVER_SERVICE_INTERFACE, /* interface name of the signal */
- VC_MANAGER_METHOD_DISABLE_COMMAND_TYPE); /* name of the signal */
-
- if (NULL == msg) {
- SLOG(LOG_ERROR, TAG_VCM, "@@ vc disable command type : Fail to make message ");
- return VC_ERROR_OPERATION_FAILED;
- } else {
- SLOG(LOG_INFO, TAG_VCM, "@@ vc disable command type : pid(%d) type(%d)", pid, cmd_type);
- }
-
- dbus_message_append_args(msg,
- DBUS_TYPE_INT32, &pid,
- DBUS_TYPE_INT32, &cmd_type,
- DBUS_TYPE_INVALID);
-
- DBusMessage* result_msg;
- int result = VC_ERROR_OPERATION_FAILED;
-
- result_msg = dbus_connection_send_with_reply_and_block(g_m_conn_sender, msg, g_m_waiting_time, &err);
- dbus_message_unref(msg);
-
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Dbus Error (%s)", err.message);
- dbus_error_free(&err);
- }
-
- if (NULL != result_msg) {
- dbus_message_get_args(result_msg, &err,
- DBUS_TYPE_INT32, &result,
- DBUS_TYPE_INVALID);
-
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_VCM, "@@ Get arguments error (%s)", err.message);
- dbus_error_free(&err);
- result = VC_ERROR_OPERATION_FAILED;
- }
- dbus_message_unref(result_msg);
-
- if (0 == result) {
- SLOG(LOG_INFO, TAG_VCM, "@@ vc disable command type : result = %d", result);
- } else {
- SLOG(LOG_ERROR, TAG_VCM, "@@ vc disable command type : result = %d", result);
- }
- } else {
- SLOG(LOG_ERROR, TAG_VCM, "@@ Result Message is NULL");
- vc_mgr_dbus_reconnect();
- result = VC_ERROR_TIMED_OUT;
- }
-
- return result;
-}
-
static DBusMessage* __get_message(int pid, const char* method, int type)
{
char service_name[64];
int vc_mgr_dbus_request_do_action(int pid, vc_send_event_type_e type, char* send_event);
-int vc_mgr_dbus_request_start(int pid, int recognition_mode, bool exclusive_command_option, bool start_by_client);
+int vc_mgr_dbus_request_start(int pid, int recognition_mode, bool exclusive_command_option, bool start_by_client, int disabled_cmd_type);
int vc_mgr_dbus_request_stop(int pid);
int vc_mgr_dbus_send_specific_engine_request(int pid, const char* engine_app_id, const char* event, const char* request);
-int vc_mgr_dbus_request_enable_command_type(int pid, int cmd_type);
-
-int vc_mgr_dbus_request_disable_command_type(int pid, int cmd_type);
-
int vc_mgr_dbus_request_start_feedback(int pid);
int vc_mgr_dbus_request_stop_feedback(int pid);
static int g_audio_streaming_mode;
#define COMMAND_TYPE_MAX 7
-static int g_enabled_command_type[COMMAND_TYPE_MAX] = {
- 0, /* NONE */
- 1, /* FOREGROUND */
- 1, /* BACKGROUND */
- 1, /* WIDGET */
- 1, /* SYSTEM */
- 1, /* SYSTEM_BACKGROUND */
- 1 /* EXCLUSIVE */
-};
+
+static int g_disabled_command_type = 0x00;
void __vcd_config_lang_changed_cb(const char* before_lang, const char* current_lang)
{
return 0;
}
-int vcd_config_enable_command_type(int cmd_type)
+int vcd_config_set_disabled_command_type(int disabled_cmd_type)
{
- if (cmd_type <= 0 || cmd_type >= COMMAND_TYPE_MAX) {
- SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Invalid command type");
- return -1;
- }
+ SLOG(LOG_INFO, TAG_VCD, "[INFO] Set disabled command type");
- g_enabled_command_type[cmd_type] = 1;
- return 0;
-}
-
-int vcd_config_disable_command_type(int cmd_type)
-{
- if (cmd_type <= 0 || cmd_type >= COMMAND_TYPE_MAX) {
- SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Invalid command type");
- return -1;
- }
+ g_disabled_command_type = disabled_cmd_type;
- g_enabled_command_type[cmd_type] = 0;
return 0;
}
return 0;
}
- return g_enabled_command_type[cmd_type];
+ return ~(g_disabled_command_type) & (1 << cmd_type);
}
int vcd_config_get_audio_streaming_mode(vcd_audio_streaming_mode_e* streaming_mode)
int vcd_config_set_foreground(int pid, bool value);
-int vcd_config_enable_command_type(int cmd_type);
-
-int vcd_config_disable_command_type(int cmd_type);
+int vcd_config_set_disabled_command_type(int disabled_cmd_type);
int vcd_config_get_command_type_enabled(int cmd_type);
else if (dbus_message_is_method_call(msg, VC_SERVER_SERVICE_INTERFACE, VC_MANAGER_METHOD_SPECIFIC_ENGINE_REQUEST))
vcd_dbus_server_mgr_send_specific_engine_request(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, VC_SERVER_SERVICE_INTERFACE, VC_MANAGER_METHOD_ENABLE_COMMAND_TYPE))
- vcd_dbus_server_mgr_enable_command_type(g_conn_listener, msg);
-
- else if (dbus_message_is_method_call(msg, VC_SERVER_SERVICE_INTERFACE, VC_MANAGER_METHOD_DISABLE_COMMAND_TYPE))
- vcd_dbus_server_mgr_disable_command_type(g_conn_listener, msg);
-
else if (dbus_message_is_method_call(msg, VC_SERVER_SERVICE_INTERFACE, VC_MANAGER_METHOD_START_FEEDBACK))
vcd_dbus_server_mgr_start_feedback(g_conn_listener, msg);
#include "vcd_server.h"
#include "vcd_config.h"
+vc_cmd_type_e vc_command_types[7] = {VC_COMMAND_TYPE_NONE,
+ VC_COMMAND_TYPE_FOREGROUND,
+ VC_COMMAND_TYPE_BACKGROUND,
+ VC_COMMAND_TYPE_WIDGET,
+ VC_COMMAND_TYPE_SYSTEM,
+ VC_COMMAND_TYPE_SYSTEM_BACKGROUND,
+ VC_COMMAND_TYPE_EXCLUSIVE};
+
+
int __dbus_error_return(DBusConnection* conn, DBusMessage* msg, int ret)
{
DBusMessage* reply;
return 0;
}
-int vcd_dbus_server_mgr_enable_command_type(DBusConnection* conn, DBusMessage* msg)
-{
- DBusError err;
- dbus_error_init(&err);
-
- int pid = 0;
- int cmd_type = 0;
-
- int ret = VCD_ERROR_OPERATION_FAILED;
-
- SLOG(LOG_DEBUG, TAG_VCD, "@@@ VCD Manager enable command type");
-
- dbus_message_get_args(msg, &err,
- DBUS_TYPE_INT32, &pid,
- DBUS_TYPE_INT32, &cmd_type,
- DBUS_TYPE_INVALID);
-
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_VCD, "[IN ERROR] vcd mgr enable command type : get arguments error (%s)", err.message);
- dbus_error_free(&err);
- ret = VCD_ERROR_OPERATION_FAILED;
- } else {
- SLOG(LOG_INFO, TAG_VCD, "[IN] vcd mgr enable command type : pid(%d), cmd_type(%d)", pid, cmd_type);
- ret = vcd_server_mgr_enable_command_type(pid, cmd_type);
- }
-
- DBusMessage* reply;
- reply = dbus_message_new_method_return(msg);
-
- if (NULL != reply) {
- dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
-
- if (0 == ret) {
- SLOG(LOG_INFO, TAG_VCD, "[OUT SUCCESS] Result(%d)", ret);
- } else {
- SLOG(LOG_ERROR, TAG_VCD, "[OUT ERROR] Result(%d)", ret);
- }
-
- if (!dbus_connection_send(conn, reply, NULL)) {
- SLOG(LOG_ERROR, TAG_VCD, "[OUT ERROR] Out Of Memory!");
- }
-
- dbus_connection_flush(conn);
- dbus_message_unref(reply);
- } else {
- SLOG(LOG_ERROR, TAG_VCD, "[OUT ERROR] Fail to create reply message!!");
- }
-
- SLOG(LOG_DEBUG, TAG_VCD, "@@@");
-
- return 0;
-}
-
-int vcd_dbus_server_mgr_disable_command_type(DBusConnection* conn, DBusMessage* msg)
-{
- DBusError err;
- dbus_error_init(&err);
-
- int pid = 0;
- int cmd_type = 0;
-
- int ret = VCD_ERROR_OPERATION_FAILED;
-
- SLOG(LOG_DEBUG, TAG_VCD, "@@@ VCD Manager disable command type");
-
- dbus_message_get_args(msg, &err,
- DBUS_TYPE_INT32, &pid,
- DBUS_TYPE_INT32, &cmd_type,
- DBUS_TYPE_INVALID);
-
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_VCD, "[IN ERROR] vcd mgr disable command type : get arguments error (%s)", err.message);
- dbus_error_free(&err);
- ret = VCD_ERROR_OPERATION_FAILED;
- } else {
- SLOG(LOG_INFO, TAG_VCD, "[IN] vcd mgr disable command type : pid(%d), cmd_type(%d)", pid, cmd_type);
- ret = vcd_server_mgr_disable_command_type(pid, cmd_type);
- }
-
- DBusMessage* reply;
- reply = dbus_message_new_method_return(msg);
-
- if (NULL != reply) {
- dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
-
- if (0 == ret) {
- SLOG(LOG_INFO, TAG_VCD, "[OUT SUCCESS] Result(%d)", ret);
- } else {
- SLOG(LOG_ERROR, TAG_VCD, "[OUT ERROR] Result(%d)", ret);
- }
-
- if (!dbus_connection_send(conn, reply, NULL)) {
- SLOG(LOG_ERROR, TAG_VCD, "[OUT ERROR] Out Of Memory!");
- }
-
- dbus_connection_flush(conn);
- dbus_message_unref(reply);
- } else {
- SLOG(LOG_ERROR, TAG_VCD, "[OUT ERROR] Fail to create reply message!!");
- }
-
- SLOG(LOG_DEBUG, TAG_VCD, "@@@");
-
- return 0;
-}
-
int vcd_dbus_server_mgr_start(DBusConnection* conn, DBusMessage* msg)
{
DBusError err;
int recognition_mode = 0;
int exclusive = 0;
int start_by_client = 0;
+ int disabled_cmd_type = 0;
int ret = VCD_ERROR_OPERATION_FAILED;
DBUS_TYPE_INT32, &recognition_mode,
DBUS_TYPE_INT32, &exclusive,
DBUS_TYPE_INT32, &start_by_client,
+ DBUS_TYPE_INT32, &disabled_cmd_type,
DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err)) {
dbus_error_free(&err);
ret = VCD_ERROR_OPERATION_FAILED;
} else {
+ SLOG(LOG_INFO, TAG_VCD, "[IN] vcd check enabled or disabled command types. disabled cmd type(%d)", disabled_cmd_type);
+ vcd_server_mgr_set_disabled_command_type(pid, disabled_cmd_type);
+
SLOG(LOG_INFO, TAG_VCD, "[IN] vcd mgr start : pid(%d) recognition_mode(%d) exclusive(%d) start by client(%d)", pid, recognition_mode, exclusive, start_by_client);
ret = vcd_server_mgr_start((vcd_recognition_mode_e)recognition_mode, (bool)exclusive, (bool)start_by_client);
}
int vcd_dbus_server_mgr_result_selection(DBusConnection* conn, DBusMessage* msg);
-int vcd_dbus_server_mgr_enable_command_type(DBusConnection* conn, DBusMessage* msg);
-
-int vcd_dbus_server_mgr_disable_command_type(DBusConnection* conn, DBusMessage* msg);
-
int vcd_dbus_server_mgr_send_specific_engine_request(DBusConnection* conn, DBusMessage* msg);
int vcd_dbus_server_mgr_change_system_volume(DBusConnection* conn, DBusMessage* msg);
return ret;
}
-int vcd_server_mgr_enable_command_type(int pid, int cmd_type)
+int vcd_server_mgr_set_disabled_command_type(int pid, int disabled_cmd_type)
{
int ret = -1;
return VCD_ERROR_INVALID_STATE;
}
- ret = vcd_config_enable_command_type(cmd_type);
+ ret = vcd_config_set_disabled_command_type(disabled_cmd_type);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to enable command type");
+ SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to set command type");
} else {
- SLOG(LOG_ERROR, TAG_VCD, "[Server] Enable command type(%d)", cmd_type);
+ SLOG(LOG_ERROR, TAG_VCD, "[Server] Set command type(%d)", disabled_cmd_type);
}
return ret;
}
-int vcd_server_mgr_disable_command_type(int pid, int cmd_type)
-{
- int ret = -1;
-
- /* check if pid is valid */
- if (false == vcd_client_manager_is_valid(pid)) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] The manager pid(%d) is NOT valid", pid);
- return VCD_ERROR_INVALID_PARAMETER;
- }
-
- vcd_state_e state = vcd_config_get_service_state();
- if (VCD_STATE_READY != state) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Current state is not ready");
- return VCD_ERROR_INVALID_STATE;
- }
-
- ret = vcd_config_disable_command_type(cmd_type);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to disable command type");
- } else {
- SLOG(LOG_ERROR, TAG_VCD, "[Server] Disable command type(%d)", cmd_type);
- }
-
- return ret;
-}
/* for TTS feedback */
int vcd_server_mgr_start_feedback(void)
int vcd_server_mgr_do_action(int pid, int type, const char* action);
-int vcd_server_mgr_enable_command_type(int pid, int cmd_type);
-
-int vcd_server_mgr_disable_command_type(int pid, int cmd_type);
+int vcd_server_mgr_set_disabled_command_type(int pid, int disabled_cmd_type);
int vcd_server_mgr_change_system_volume(int pid, vcd_system_volume_event_e system_volume_event);