return 0;
}
+
+void vcd_client_update_foreground_pid()
+{
+ int tmp_pid = VC_RUNTIME_INFO_NO_FOREGROUND;
+ vcd_config_get_foreground(&tmp_pid);
+ SLOG(LOG_INFO, TAG_VCD, "[INFO] foreground pid (%d)", tmp_pid);
+
+ char appid[255] = {'\0',};
+ GSList *iter = NULL;
+ vc_client_info_s *data = NULL;
+
+ int count = g_slist_length(g_client_list);
+ int i;
+
+ if (0 == count) {
+ SLOG(LOG_DEBUG, TAG_VCD, "No Client");
+ } else {
+ iter = g_slist_nth(g_client_list, 0);
+ for (i = 0; i < count; i++) {
+ if (NULL == iter)
+ break;
+
+ data = iter->data;
+
+ if (NULL != data) {
+ SLOG(LOG_DEBUG, TAG_VCD, "[%dth] pid(%d)", i, data->pid);
+ memset(appid, 0, 255);
+ aul_app_get_appid_bypid(data->pid, appid, sizeof(appid));
+ int status = aul_app_get_status(appid);
+ if (status == STATUS_FOCUS) {
+ SLOG(LOG_INFO, TAG_VCD, "[INFO] foreground pid (%d)", data->pid);
+ vcd_config_set_foreground(data->pid, true);
+ if (tmp_pid != data->pid) {
+ SLOG(LOG_INFO, TAG_VCD, "[INFO] foreground pid is different");
+ }
+ return;
+ }
+ }
+ iter = g_slist_next(iter);
+ }
+ }
+
+ widget_info_s *widget_data = NULL;
+ count = g_slist_length(g_widget_list);
+
+ if (0 == count) {
+ SLOG(LOG_DEBUG, TAG_VCD, "No widget");
+ } else {
+ iter = g_slist_nth(g_widget_list, 0);
+ for (i = 0; i < count; i++) {
+ if (NULL == iter)
+ break;
+
+ widget_data = iter->data;
+
+ if (NULL != widget_data) {
+ SLOG(LOG_DEBUG, TAG_VCD, "[%dth] pid(%d)", i, widget_data->pid);
+ memset(appid, 0, 255);
+ aul_app_get_appid_bypid(widget_data->pid, appid, sizeof(appid));
+ int status = aul_app_get_status(appid);
+ if (status == STATUS_FOCUS) {
+ SLOG(LOG_INFO, TAG_VCD, "[INFO] foreground pid (%d)", widget_data->pid);
+ vcd_config_set_foreground(widget_data->pid, true);
+ if (tmp_pid != widget_data->pid) {
+ SLOG(LOG_INFO, TAG_VCD, "[INFO] foreground pid is changed");
+ }
+ return;
+ }
+ }
+ iter = g_slist_next(iter);
+ }
+ }
+
+ SLOG(LOG_INFO, TAG_VCD, "[INFO] No foreground");
+ vcd_config_set_foreground(VC_RUNTIME_INFO_NO_FOREGROUND, true);
+ return;
+}
vcd_client_set_recognition_mode(recognition_mode);
if (false == exclusive_cmd) {
+ vcd_client_update_foreground_pid();
/* Notify show tooltip */
if (1 == vcd_config_get_command_type_enabled(VC_COMMAND_TYPE_WIDGET)) {
int pid = vcd_client_widget_get_foreground_pid();
if (-1 != pid) {
- SLOG(LOG_DEBUG, TAG_VCD, "[Server] Request tooltip show and widget command");
+ SLOG(LOG_INFO, TAG_VCD, "[Server] Request tooltip show and widget command");
ecore_timer_add(0, __vcd_request_show_tooltip, (void*)true);
return 0;
}