diff options
author | Ji-hoon Lee <dalton.lee@samsung.com> | 2020-08-13 14:14:36 +0900 |
---|---|---|
committer | Ji-hoon Lee <dalton.lee@samsung.com> | 2020-08-13 14:14:36 +0900 |
commit | 600725865c2dce036e6260c28a812fa18659aff0 (patch) | |
tree | 929559f35e121450b510ae860d8ab841edc2baec | |
parent | acb7991ffb6361917e8923ac1fbadac98a3c9be1 (diff) | |
download | multi-assistant-service-600725865c2dce036e6260c28a812fa18659aff0.tar.gz multi-assistant-service-600725865c2dce036e6260c28a812fa18659aff0.tar.bz2 multi-assistant-service-600725865c2dce036e6260c28a812fa18659aff0.zip |
Ignore streaming requests from clients not currently woken up
Change-Id: I875b53caf10a110c967f6039604fbd4761ea47b7
-rw-r--r-- | src/service_main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/service_main.cpp b/src/service_main.cpp index 7830c3f..a741ae0 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -200,6 +200,17 @@ int CServiceMain::client_send_recognition_result(pid_t pid, int result) int CServiceMain::client_start_streaming_audio_data(pid_t pid, int type) { int ret = -1; + const char *current_maclient_appid = NULL; + if (mCurrentClientInfo >= 0 && mCurrentClientInfo < MAX_MACLIENT_INFO_NUM) { + current_maclient_appid = mClientInfo[mCurrentClientInfo].appid; + pid_t pid_by_appid = mClientManager.find_client_pid_by_appid( + std::string{current_maclient_appid}); + if (pid != pid_by_appid) { + MAS_LOGE("[ERROR] Current client: [%d], active client : [%d %s]", + pid, pid_by_appid, current_maclient_appid); + return ret; + } + } switch(type) { case MA_AUDIO_STREAMING_DATA_TYPE_CURRENT_UTTERANCE: ret = mServicePlugin.start_streaming_utterance_data(); |