int mas_launch_client_by_wakeup_word(const char *wakeup_word);
-int mas_launch_client_by_appid(const char *appid);
+typedef enum {
+ CLIENT_LAUNCH_MODE_ACTIVATION,
+ CLIENT_LAUNCH_MODE_PRELAUNCH,
+} CLIENT_LAUNCH_MODE;
+int mas_launch_client_by_appid(const char *appid, CLIENT_LAUNCH_MODE launch_mode);
int mas_process_voice_key_event(bool pressed);
int pid = mas_get_client_pid_by_appid(appid);
if (pid != -1) {
/* Bring MA client to foreground - is there a better way instead of launching? */
- mas_launch_client_by_appid(appid);
+ mas_launch_client_by_appid(appid, CLIENT_LAUNCH_MODE_ACTIVATION);
masc_dbus_active_state_change(pid, MA_ACTIVE_STATE_ACTIVE);
MAS_LOGD("MA Client with appid %s exists, requesting speech data", (appid ? appid : "NULL"));
/*
0 < strlen(g_maclient_info[loop].appid) &&
0 < strlen(g_maclient_info[loop].wakeup_word[0])) {
if (strncmp(appid, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
- mas_launch_client_by_appid(g_maclient_info[loop].appid);
+ mas_launch_client_by_appid(g_maclient_info[loop].appid, CLIENT_LAUNCH_MODE_ACTIVATION);
}
}
}
return ret;
}
-int mas_launch_client_by_appid(const char *appid)
+int mas_launch_client_by_appid(const char *appid, CLIENT_LAUNCH_MODE launch_mode)
{
app_control_h app_control;
int ret = 0;
}
app_control_destroy (app_control);
- if (APP_CONTROL_ERROR_NONE == ret) {
+ if (APP_CONTROL_ERROR_NONE == ret && CLIENT_LAUNCH_MODE_ACTIVATION == launch_mode) {
bool found = false;
for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
if (g_maclient_info[loop].used &&
int mas_launch_client_by_wakeup_word(const char *wakeup_word)
{
const char *appid = mas_get_client_appid_by_wakeup_word(wakeup_word);
- return mas_launch_client_by_appid(appid);
+ return mas_launch_client_by_appid(appid, CLIENT_LAUNCH_MODE_ACTIVATION);
}
if ((pid = mas_get_client_pid_by_appid(appid)) != -1) {
masc_dbus_active_state_change(pid, MA_ACTIVE_STATE_ACTIVE);
/* Bring MA client to foreground - is there a better way instead of launching? */
- mas_launch_client_by_appid(appid);
+ mas_launch_client_by_appid(appid, CLIENT_LAUNCH_MODE_ACTIVATION);
} else {
// Appropriate MA Client not available, trying to launch new one
MAS_LOGD("MA Client with appid %s does not exist, launching client", appid);
- mas_launch_client_by_appid(appid);
+ mas_launch_client_by_appid(appid, CLIENT_LAUNCH_MODE_ACTIVATION);
}
if (appid) free(appid);