int ret = 0;
sqlite3_stmt* stmt = NULL;
- const char* sql = "SELECT * FROM vc_result WHERE result = ? COLLATE NOCASE;";
+ const char* sql = "SELECT DISTINCT pid, type FROM vc_result WHERE result = ? COLLATE NOCASE ORDER BY pid ASC;";
+
ret = sqlite3_prepare_v2(db_handle, sql, -1, &stmt, NULL);
if (ret != SQLITE_OK) {
}
temp = sqlite3_column_int(stmt, 0);
- temp_cmd->id = temp;
-
- temp = sqlite3_column_int(stmt, 5);
temp_cmd->pid = temp;
- temp = sqlite3_column_int(stmt, 6);
+ temp = sqlite3_column_int(stmt, 1);
temp_cmd->type = temp;
temp_pid_list = g_slist_append(temp_pid_list, temp_cmd);
GSList* iter = NULL;
vc_cmd_s* temp_cmd = NULL;
int ret = 0;
+ int pre_pid = -1;
+ int pre_type = -1;
iter = g_slist_nth(pid_list, 0);
while (NULL != iter) {
temp_cmd = iter->data;
- if (NULL != temp_cmd) {
+ if (NULL != temp_cmd && (pre_pid != temp_cmd->pid || pre_type == VC_COMMAND_TYPE_WIDGET || temp_cmd->type == VC_COMMAND_TYPE_WIDGET)) {
/* Launch deactivated several apps that is matched with result */
ret = __vcd_launch_app(result);
if (0 != ret) {
break;
} else {
SLOG(LOG_DEBUG, TAG_VCD, "[Server] Send result : pid(%d) type(%d)", temp_cmd->pid, temp_cmd->type);
+ pre_pid = temp_cmd->pid;
+ pre_type = temp_cmd->type;
}
}
free(temp_cmd);