2 * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "vc_mgr_client.h"
25 int uid; /*<< unique id = pid + handle */
27 vc_mgr_all_result_cb all_result_cb;
28 void* all_result_user_data;
29 vc_result_cb result_cb;
30 void* result_user_data;
31 vc_mgr_pre_result_cb pre_result_cb;
32 void* pre_result_user_data;
35 void* error_user_data;
36 vc_service_state_changed_cb service_state_changed_cb;
37 void* service_state_changed_user_data;
38 vc_state_changed_cb state_changed_cb;
39 void* state_changed_user_data;
40 vc_mgr_begin_speech_detected_cb speech_detected_cb;
41 void* speech_detected_user_data;
42 vc_current_language_changed_cb current_lang_changed_cb;
43 void* current_lang_changed_user_data;
44 vc_mgr_dialog_request_cb diaglog_requst_cb;
45 void* dialog_request_user_data;
46 vc_mgr_private_data_set_cb private_data_set_cb;
47 void* private_data_set_user_data;
48 vc_mgr_private_data_requested_cb private_data_requested_cb;
49 void* private_data_requested_user_data;
52 vc_result_event_e all_result_event;
53 char* all_result_text;
55 /* exclusive command flag */
56 bool exclusive_cmd_option;
63 vc_service_state_e service_state;
65 vc_internal_state_e internal_state;
68 vc_state_e before_state;
69 vc_state_e current_state;
72 char* before_language;
73 char* current_language;
78 /* recognition mode */
79 vc_recognition_mode_e recognition_mode;
89 GSList* authorized_client_list;
90 int valid_authorized_pid;
99 } vc_authorized_client_s;
101 static GSList *g_mgr_client_list = NULL;
103 static vc_mgr_client_s* __mgr_client_get(vc_h vc)
106 SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Input parameter is NULL");
110 vc_mgr_client_s *data = NULL;
112 int count = g_slist_length(g_mgr_client_list);
115 for (i = 0; i < count; i++) {
116 data = g_slist_nth_data(g_mgr_client_list, i);
119 if (vc->handle == data->vc->handle) {
125 SLOG(LOG_DEBUG, TAG_VCM, "[DEBUG] Fail to get client by vc");
130 int vc_mgr_client_create(vc_h* vc)
132 vc_mgr_client_s *client = NULL;
134 client = (vc_mgr_client_s*)calloc(1, sizeof(vc_mgr_client_s));
135 if (NULL == client) {
136 SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to allocate memory");
137 return VC_ERROR_OUT_OF_MEMORY;
140 vc_h temp = (vc_h)calloc(1, sizeof(struct vc_s));
142 SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to allocate memory");
144 return VC_ERROR_OUT_OF_MEMORY;
147 temp->handle = getpid();
149 /* initialize client data */
151 client->pid = getpid();
152 client->uid = temp->handle;
154 client->all_result_cb = NULL;
155 client->all_result_user_data = NULL;
156 client->result_cb = NULL;
157 client->result_user_data = NULL;
158 client->pre_result_cb = NULL;
159 client->pre_result_user_data = NULL;
161 client->error_cb = NULL;
162 client->error_user_data = NULL;
163 client->service_state_changed_cb = NULL;
164 client->service_state_changed_user_data = NULL;
165 client->state_changed_cb = NULL;
166 client->state_changed_user_data = NULL;
167 client->speech_detected_cb = NULL;
168 client->speech_detected_user_data = NULL;
169 client->current_lang_changed_cb = NULL;
170 client->current_lang_changed_user_data = NULL;
171 client->diaglog_requst_cb = NULL;
172 client->dialog_request_user_data = NULL;
173 client->private_data_set_cb = NULL;
174 client->private_data_set_user_data = NULL;
175 client->private_data_requested_cb = NULL;
176 client->private_data_requested_user_data = NULL;
178 client->exclusive_cmd_option = false;
180 client->all_result_event = 0;
181 client->all_result_text = NULL;
183 client->result_event = -1;
184 client->result_text = NULL;
186 client->service_state = 0;
188 client->internal_state = VC_INTERNAL_STATE_NONE;
190 client->before_state = VC_STATE_INITIALIZED;
191 client->current_state = VC_STATE_INITIALIZED;
193 client->before_language = NULL;
194 client->current_language = NULL;
196 client->audio_id = NULL;
197 client->recognition_mode = VC_RECOGNITION_MODE_STOP_BY_SILENCE;
200 client->err_msg = NULL;
202 client->cb_ref_count = 0;
205 client->authorized_client_list = NULL;
206 client->valid_authorized_pid = -1;
207 client->start_by_client = false;
209 client->foreground_pid = VC_RUNTIME_INFO_NO_FOREGROUND;
211 g_mgr_client_list = g_slist_append(g_mgr_client_list, client);
218 int vc_mgr_client_destroy(vc_h vc)
221 SLOG(LOG_ERROR, TAG_VCM, "Input parameter is NULL");
225 vc_mgr_client_s *data = NULL;
227 int count = g_slist_length(g_mgr_client_list);
230 for (i = 0; i < count; i++) {
231 data = g_slist_nth_data(g_mgr_client_list, i);
234 if (vc->handle == data->vc->handle) {
235 g_mgr_client_list = g_slist_remove(g_mgr_client_list, data);
237 while (0 != data->cb_ref_count) {
238 /* wait for release callback function */
241 if (NULL != data->audio_id) {
242 free(data->audio_id);
245 if (NULL != data->all_result_text) {
246 free(data->all_result_text);
249 if (NULL != data->err_msg) {
264 SLOG(LOG_ERROR, TAG_VCM, "[ERROR] client Not found");
269 bool vc_mgr_client_is_valid(vc_h vc)
271 vc_mgr_client_s* client = __mgr_client_get(vc);
274 if (NULL == client) {
275 SLOG(LOG_DEBUG, TAG_VCM, "[DEBUG] vc is not valid");
282 bool vc_mgr_client_is_valid_by_uid(int uid)
284 vc_mgr_client_s *data = NULL;
286 int count = g_slist_length(g_mgr_client_list);
289 for (i = 0; i < count; i++) {
290 data = g_slist_nth_data(g_mgr_client_list, i);
293 if (uid == data->vc->handle)
298 SLOG(LOG_DEBUG, TAG_VCM, "[DEBUG] Fail to get client by vc");
303 int vc_mgr_client_get_handle(int uid, vc_h* vc)
305 vc_mgr_client_s *data = NULL;
307 int count = g_slist_length(g_mgr_client_list);
310 for (i = 0; i < count; i++) {
311 data = g_slist_nth_data(g_mgr_client_list, i);
314 if (uid == data->vc->handle) {
324 int vc_mgr_client_get_pid(vc_h vc, int* pid)
326 vc_mgr_client_s* client = __mgr_client_get(vc);
329 if (NULL == client) {
330 SLOG(LOG_DEBUG, TAG_VCM, "[DEBUG] vc is not valid");
338 /* set/get callback function */
339 int vc_mgr_client_set_all_result_cb(vc_h vc, vc_mgr_all_result_cb callback, void* user_data)
341 vc_mgr_client_s* client = __mgr_client_get(vc);
345 return VC_ERROR_INVALID_PARAMETER;
347 client->all_result_cb = callback;
348 client->all_result_user_data = user_data;
353 int vc_mgr_client_get_all_result_cb(vc_h vc, vc_mgr_all_result_cb* callback, void** user_data)
355 vc_mgr_client_s* client = __mgr_client_get(vc);
359 return VC_ERROR_INVALID_PARAMETER;
361 *callback = client->all_result_cb;
362 *user_data = client->all_result_user_data;
367 int vc_mgr_client_set_result_cb(vc_h vc, vc_result_cb callback, void* user_data)
369 vc_mgr_client_s* client = __mgr_client_get(vc);
373 return VC_ERROR_INVALID_PARAMETER;
375 client->result_cb = callback;
376 client->result_user_data = user_data;
381 int vc_mgr_client_get_result_cb(vc_h vc, vc_result_cb* callback, void** user_data)
383 vc_mgr_client_s* client = __mgr_client_get(vc);
387 return VC_ERROR_INVALID_PARAMETER;
389 *callback = client->result_cb;
390 *user_data = client->result_user_data;
395 int vc_mgr_client_set_pre_result_cb(vc_h vc, vc_mgr_pre_result_cb callback, void* user_data)
397 vc_mgr_client_s* client = __mgr_client_get(vc);
401 return VC_ERROR_INVALID_PARAMETER;
403 client->pre_result_cb = callback;
404 client->pre_result_user_data = user_data;
409 int vc_mgr_client_get_pre_result_cb(vc_h vc, vc_mgr_pre_result_cb* callback, void** user_data)
411 vc_mgr_client_s* client = __mgr_client_get(vc);
415 return VC_ERROR_INVALID_PARAMETER;
417 *callback = client->pre_result_cb;
418 *user_data = client->pre_result_user_data;
423 int vc_mgr_client_set_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb callback, void* user_data)
425 vc_mgr_client_s* client = __mgr_client_get(vc);
429 return VC_ERROR_INVALID_PARAMETER;
431 client->service_state_changed_cb = callback;
432 client->service_state_changed_user_data = user_data;
437 int vc_mgr_client_get_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb* callback, void** user_data)
439 vc_mgr_client_s* client = __mgr_client_get(vc);
443 return VC_ERROR_INVALID_PARAMETER;
445 *callback = client->service_state_changed_cb;
446 *user_data = client->service_state_changed_user_data;
451 int vc_mgr_client_set_state_changed_cb(vc_h vc, vc_state_changed_cb callback, void* user_data)
453 vc_mgr_client_s* client = __mgr_client_get(vc);
457 return VC_ERROR_INVALID_PARAMETER;
459 client->state_changed_cb = callback;
460 client->state_changed_user_data = user_data;
465 int vc_mgr_client_get_state_changed_cb(vc_h vc, vc_state_changed_cb* callback, void** user_data)
467 vc_mgr_client_s* client = __mgr_client_get(vc);
471 return VC_ERROR_INVALID_PARAMETER;
473 *callback = client->state_changed_cb;
474 *user_data = client->state_changed_user_data;
479 int vc_mgr_client_set_speech_detected_cb(vc_h vc, vc_mgr_begin_speech_detected_cb callback, void* user_data)
481 vc_mgr_client_s* client = __mgr_client_get(vc);
485 return VC_ERROR_INVALID_PARAMETER;
487 client->speech_detected_cb = callback;
488 client->speech_detected_user_data = user_data;
493 int vc_mgr_client_get_speech_detected_cb(vc_h vc, vc_mgr_begin_speech_detected_cb* callback, void** user_data)
495 vc_mgr_client_s* client = __mgr_client_get(vc);
499 return VC_ERROR_INVALID_PARAMETER;
501 *callback = client->speech_detected_cb;
502 *user_data = client->speech_detected_user_data;
507 int vc_mgr_client_set_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb callback, void* user_data)
509 vc_mgr_client_s* client = __mgr_client_get(vc);
513 return VC_ERROR_INVALID_PARAMETER;
515 client->current_lang_changed_cb = callback;
516 client->current_lang_changed_user_data = user_data;
521 int vc_mgr_client_get_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb* callback, void** user_data)
523 vc_mgr_client_s* client = __mgr_client_get(vc);
527 return VC_ERROR_INVALID_PARAMETER;
529 *callback = client->current_lang_changed_cb;
530 *user_data = client->current_lang_changed_user_data;
535 int vc_mgr_client_set_error_cb(vc_h vc, vc_error_cb callback, void* user_data)
537 vc_mgr_client_s* client = __mgr_client_get(vc);
541 return VC_ERROR_INVALID_PARAMETER;
543 client->error_cb = callback;
544 client->error_user_data = user_data;
549 int vc_mgr_client_get_error_cb(vc_h vc, vc_error_cb* callback, void** user_data)
551 vc_mgr_client_s* client = __mgr_client_get(vc);
555 return VC_ERROR_INVALID_PARAMETER;
557 *callback = client->error_cb;
558 *user_data = client->error_user_data;
563 int vc_mgr_client_set_dialog_request_cb(vc_h vc, vc_mgr_dialog_request_cb callback, void* user_data)
565 vc_mgr_client_s* client = __mgr_client_get(vc);
569 return VC_ERROR_INVALID_PARAMETER;
571 client->diaglog_requst_cb = callback;
572 client->dialog_request_user_data = user_data;
577 int vc_mgr_client_get_dialog_request_cb(vc_h vc, vc_mgr_dialog_request_cb* callback, void** user_data)
579 vc_mgr_client_s* client = __mgr_client_get(vc);
583 return VC_ERROR_INVALID_PARAMETER;
585 *callback = client->diaglog_requst_cb;
586 *user_data = client->dialog_request_user_data;
592 int vc_mgr_client_set_private_data_set_cb(vc_h vc, vc_mgr_private_data_set_cb callback, void* user_data)
594 vc_mgr_client_s* client = __mgr_client_get(vc);
598 return VC_ERROR_INVALID_PARAMETER;
600 client->private_data_set_cb = callback;
601 client->private_data_set_user_data = user_data;
606 int vc_mgr_client_get_private_data_set_cb(vc_h vc, vc_mgr_private_data_set_cb* callback, void** user_data)
608 vc_mgr_client_s* client = __mgr_client_get(vc);
612 return VC_ERROR_INVALID_PARAMETER;
614 *callback = client->private_data_set_cb;
615 *user_data = client->private_data_set_user_data;
620 int vc_mgr_client_set_private_data_requested_cb(vc_h vc, vc_mgr_private_data_requested_cb callback, void* user_data)
622 vc_mgr_client_s* client = __mgr_client_get(vc);
626 return VC_ERROR_INVALID_PARAMETER;
628 client->private_data_requested_cb = callback;
629 client->private_data_requested_user_data = user_data;
634 int vc_mgr_client_get_private_data_requested_cb(vc_h vc, vc_mgr_private_data_requested_cb* callback, void** user_data)
636 vc_mgr_client_s* client = __mgr_client_get(vc);
640 return VC_ERROR_INVALID_PARAMETER;
642 *callback = client->private_data_requested_cb;
643 *user_data = client->private_data_requested_user_data;
649 int vc_mgr_client_set_service_state(vc_h vc, vc_service_state_e state)
651 vc_mgr_client_s* client = __mgr_client_get(vc);
655 return VC_ERROR_INVALID_PARAMETER;
657 client->service_state = state;
662 int vc_mgr_client_get_service_state(vc_h vc, vc_service_state_e* state)
664 vc_mgr_client_s* client = __mgr_client_get(vc);
668 return VC_ERROR_INVALID_PARAMETER;
670 *state = client->service_state;
675 int vc_mgr_client_set_internal_state(vc_h vc, vc_internal_state_e state)
677 vc_mgr_client_s* client = __mgr_client_get(vc);
681 return VC_ERROR_INVALID_PARAMETER;
683 client->internal_state = state;
688 int vc_mgr_client_get_internal_state(vc_h vc, vc_internal_state_e* state)
690 vc_mgr_client_s* client = __mgr_client_get(vc);
694 return VC_ERROR_INVALID_PARAMETER;
696 *state = client->internal_state;
701 int vc_mgr_client_set_client_state(vc_h vc, vc_state_e state)
703 vc_mgr_client_s* client = __mgr_client_get(vc);
707 return VC_ERROR_INVALID_PARAMETER;
709 client->before_state = client->current_state;
710 client->current_state = state;
715 int vc_mgr_client_get_client_state(vc_h vc, vc_state_e* state)
717 vc_mgr_client_s* client = __mgr_client_get(vc);
721 return VC_ERROR_INVALID_PARAMETER;
723 *state = client->current_state;
728 int vc_mgr_client_get_client_state_by_uid(int uid, vc_state_e* state)
730 vc_mgr_client_s *data = NULL;
732 int count = g_slist_length(g_mgr_client_list);
735 for (i = 0; i < count; i++) {
736 data = g_slist_nth_data(g_mgr_client_list, i);
739 if (uid == data->vc->handle) {
740 *state = data->current_state;
749 int vc_mgr_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state)
751 vc_mgr_client_s* client = __mgr_client_get(vc);
755 return VC_ERROR_INVALID_PARAMETER;
757 *before_state = client->before_state;
758 *state = client->current_state;
763 int vc_mgr_client_set_error(vc_h vc, int reason)
765 vc_mgr_client_s* client = __mgr_client_get(vc);
769 return VC_ERROR_INVALID_PARAMETER;
771 client->reason = reason;
776 int vc_mgr_client_get_error(vc_h vc, int* reason)
778 vc_mgr_client_s* client = __mgr_client_get(vc);
782 return VC_ERROR_INVALID_PARAMETER;
784 *reason = client->reason;
789 int vc_mgr_client_set_error_message(vc_h vc, const char* err_msg)
791 vc_mgr_client_s* client = __mgr_client_get(vc);
795 return VC_ERROR_INVALID_PARAMETER;
797 if (NULL != client->err_msg) {
798 free(client->err_msg);
799 client->err_msg = NULL;
802 if (NULL != err_msg) {
803 client->err_msg = strdup(err_msg);
804 if (NULL == client->err_msg) {
805 return VC_ERROR_OUT_OF_MEMORY;
812 int vc_mgr_client_get_error_message(vc_h vc, char** err_msg)
814 vc_mgr_client_s* client = __mgr_client_get(vc);
818 return VC_ERROR_INVALID_PARAMETER;
820 if (NULL != client->err_msg) {
821 *err_msg = strdup(client->err_msg);
822 if (NULL == *err_msg) {
823 return VC_ERROR_OUT_OF_MEMORY;
830 int vc_mgr_client_set_exclusive_command(vc_h vc, bool value)
832 vc_mgr_client_s* client = __mgr_client_get(vc);
836 return VC_ERROR_INVALID_PARAMETER;
838 client->exclusive_cmd_option = value;
843 bool vc_mgr_client_get_exclusive_command(vc_h vc)
845 vc_mgr_client_s* client = __mgr_client_get(vc);
849 return VC_ERROR_INVALID_PARAMETER;
851 return client->exclusive_cmd_option;
854 int vc_mgr_client_set_all_result(vc_h vc, int event, const char* result_text)
856 vc_mgr_client_s* client = __mgr_client_get(vc);
860 return VC_ERROR_INVALID_PARAMETER;
862 client->all_result_event = event;
864 if (NULL != client->all_result_text) {
865 free(client->all_result_text);
866 client->all_result_text = NULL;
868 if (NULL != result_text) {
869 client->all_result_text = strdup(result_text);
875 int vc_mgr_client_get_all_result(vc_h vc, int* event, char** result_text)
877 vc_mgr_client_s* client = __mgr_client_get(vc);
881 return VC_ERROR_INVALID_PARAMETER;
883 *event = client->all_result_event;
884 if (NULL != result_text) {
885 if (NULL != client->all_result_text) {
886 *result_text = strdup(client->all_result_text);
893 int vc_mgr_client_unset_all_result(vc_h vc)
895 vc_mgr_client_s* client = __mgr_client_get(vc);
899 return VC_ERROR_INVALID_PARAMETER;
901 client->all_result_event = -1;
903 if (NULL != client->all_result_text) {
904 free(client->all_result_text);
905 client->all_result_text = NULL;
911 int vc_mgr_client_set_audio_type(vc_h vc, const char* audio_id)
913 vc_mgr_client_s* client = __mgr_client_get(vc);
917 return VC_ERROR_INVALID_PARAMETER;
919 if (NULL != audio_id) {
920 if (NULL != client->audio_id) {
921 free(client->audio_id);
922 client->audio_id = NULL;
924 client->audio_id = strdup(audio_id);
930 int vc_mgr_client_get_audio_type(vc_h vc, char** audio_id)
932 if (NULL == audio_id) {
936 vc_mgr_client_s* client = __mgr_client_get(vc);
940 return VC_ERROR_INVALID_PARAMETER;
942 if (NULL != client->audio_id)
943 *audio_id = strdup(client->audio_id);
950 int vc_mgr_client_set_recognition_mode(vc_h vc, vc_recognition_mode_e mode)
952 vc_mgr_client_s* client = __mgr_client_get(vc);
956 return VC_ERROR_INVALID_PARAMETER;
958 client->recognition_mode = mode;
963 int vc_mgr_client_get_recognition_mode(vc_h vc, vc_recognition_mode_e* mode)
969 vc_mgr_client_s* client = __mgr_client_get(vc);
973 return VC_ERROR_INVALID_PARAMETER;
975 *mode = client->recognition_mode;
979 int vc_mgr_client_set_foreground(vc_h vc, int pid, bool value)
981 vc_mgr_client_s* client = __mgr_client_get(vc);
985 return VC_ERROR_INVALID_PARAMETER;
988 client->foreground_pid = pid;
990 if (pid == client->foreground_pid) {
991 client->foreground_pid = VC_RUNTIME_INFO_NO_FOREGROUND;
998 int vc_mgr_client_get_foreground(vc_h vc, int* pid)
1000 vc_mgr_client_s* client = __mgr_client_get(vc);
1004 return VC_ERROR_INVALID_PARAMETER;
1006 *pid = client->foreground_pid;
1011 int vc_mgr_client_get_count()
1013 return g_slist_length(g_mgr_client_list);
1016 int vc_mgr_client_use_callback(vc_h vc)
1018 vc_mgr_client_s* client = __mgr_client_get(vc);
1022 return VC_ERROR_INVALID_PARAMETER;
1024 client->cb_ref_count++;
1028 int vc_mgr_client_not_use_callback(vc_h vc)
1030 vc_mgr_client_s* client = __mgr_client_get(vc);
1034 return VC_ERROR_INVALID_PARAMETER;
1036 client->cb_ref_count--;
1041 int vc_mgr_client_add_authorized_client(vc_h vc, int pid)
1043 vc_mgr_client_s* client = __mgr_client_get(vc);
1047 return VC_ERROR_INVALID_PARAMETER;
1049 vc_authorized_client_s *authorized_client = NULL;
1051 authorized_client = (vc_authorized_client_s*)calloc(1, sizeof(vc_authorized_client_s));
1052 if (NULL == authorized_client) {
1053 SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to make authorized client");
1054 return VC_ERROR_OPERATION_FAILED;
1057 authorized_client->pid = pid;
1059 client->authorized_client_list = g_slist_append(client->authorized_client_list, authorized_client);
1061 SLOG(LOG_DEBUG, TAG_VCM, "Add authorized client - %d", pid);
1066 int vc_mgr_client_remove_authorized_client(vc_h vc, int pid)
1068 vc_mgr_client_s* client = __mgr_client_get(vc);
1072 return VC_ERROR_INVALID_PARAMETER;
1074 vc_authorized_client_s *data = NULL;
1076 int count = g_slist_length(client->authorized_client_list);
1079 for (i = 0; i < count; i++) {
1080 data = g_slist_nth_data(client->authorized_client_list, i);
1083 if (pid == data->pid) {
1084 client->authorized_client_list = g_slist_remove(client->authorized_client_list, data);
1089 SLOG(LOG_DEBUG, TAG_VCM, "Remove authorized client - %d", pid);
1095 SLOG(LOG_ERROR, TAG_VCM, "[ERROR] client Not found");
1097 return VC_ERROR_OPERATION_FAILED;
1100 bool vc_mgr_client_is_authorized_client(vc_h vc, int pid)
1102 vc_mgr_client_s* client = __mgr_client_get(vc);
1106 return VC_ERROR_INVALID_PARAMETER;
1108 vc_authorized_client_s *data = NULL;
1110 int count = g_slist_length(client->authorized_client_list);
1113 for (i = 0; i < count; i++) {
1114 data = g_slist_nth_data(client->authorized_client_list, i);
1117 if (pid == data->pid) {
1118 SLOG(LOG_DEBUG, TAG_VCM, "Authorized client - %d", pid);
1124 SLOG(LOG_DEBUG, TAG_VCM, "Un-Authorized client - %d", pid);
1129 int vc_mgr_client_set_valid_authorized_client(vc_h vc, int pid)
1131 vc_mgr_client_s* client = __mgr_client_get(vc);
1135 return VC_ERROR_INVALID_PARAMETER;
1137 client->valid_authorized_pid = pid;
1142 int vc_mgr_client_get_valid_authorized_client(vc_h vc, int* pid)
1144 vc_mgr_client_s* client = __mgr_client_get(vc);
1148 return VC_ERROR_INVALID_PARAMETER;
1150 *pid = client->valid_authorized_pid;
1155 bool vc_mgr_client_is_valid_authorized_client(vc_h vc, int pid)
1157 vc_mgr_client_s* client = __mgr_client_get(vc);
1161 return VC_ERROR_INVALID_PARAMETER;
1163 if (pid == client->valid_authorized_pid)
1169 int vc_mgr_client_set_start_by_client(vc_h vc, bool option)
1171 vc_mgr_client_s* client = __mgr_client_get(vc);
1175 return VC_ERROR_INVALID_PARAMETER;
1177 client->start_by_client = option;
1182 int vc_mgr_client_get_start_by_client(vc_h vc, bool* option)
1184 vc_mgr_client_s* client = __mgr_client_get(vc);
1188 return VC_ERROR_INVALID_PARAMETER;
1190 *option = client->start_by_client;