diff options
author | AGaliuzov <AGaliuzov@luxoft.com> | 2015-09-25 17:02:19 +0300 |
---|---|---|
committer | AGaliuzov <AGaliuzov@luxoft.com> | 2015-09-25 17:02:19 +0300 |
commit | 4d6cf970a2f6eef3b6c22d247eb37810fbe6e42d (patch) | |
tree | 55986cd27f3e57ea7a2073de3cf20ade815f40dd | |
parent | c7ccd266211b8400326520e0978347db35f6bb11 (diff) | |
parent | 9d4a55c53772ac787f6e4298a8f959912b04bf38 (diff) | |
download | sdl_core-4d6cf970a2f6eef3b6c22d247eb37810fbe6e42d.tar.gz |
Merge pull request #220 from LuxoftSDL/hotfix/SystemRequest_crash_sdl4.0
Fix crash when processing SystemRequest with QUERY_APPS
-rw-r--r-- | src/components/application_manager/src/application_manager_impl.cc | 34 | ||||
-rw-r--r-- | src/components/application_manager/src/message_helper.cc | 7 |
2 files changed, 19 insertions, 22 deletions
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index f42feaca00..3523b47470 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -2011,28 +2011,28 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array, continue; } + // AppId = 0 because this is query_app(provided by hmi for download, but not yet registered) ApplicationSharedPtr app( new ApplicationImpl(0, mobile_app_id, appName, PolicyHandler::instance()->GetStatisticManager())); - if (app) { - app->SetShemaUrl(url_scheme); - app->SetPackageName(package_name); - app->set_app_icon_path(full_icon_path); - app->set_hmi_application_id(hmi_app_id); - app->set_device(device_id); - - app->set_vr_synonyms(vrSynonym); - app->set_tts_name(ttsName); - - sync_primitives::AutoLock lock(apps_to_register_list_lock_); - LOG4CXX_DEBUG(logger_, "apps_to_register_ size before: " - << apps_to_register_.size()); - apps_to_register_.insert(app); - LOG4CXX_DEBUG(logger_, "apps_to_register_ size after: " - << apps_to_register_.size()); - } + DCHECK_OR_RETURN_VOID(app); + app->SetShemaUrl(url_scheme); + app->SetPackageName(package_name); + app->set_app_icon_path(full_icon_path); + app->set_hmi_application_id(hmi_app_id); + app->set_device(device_id); + + app->set_vr_synonyms(vrSynonym); + app->set_tts_name(ttsName); + + sync_primitives::AutoLock lock(apps_to_register_list_lock_); + LOG4CXX_DEBUG(logger_, "apps_to_register_ size before: " + << apps_to_register_.size()); + apps_to_register_.insert(app); + LOG4CXX_DEBUG(logger_, "apps_to_register_ size after: " + << apps_to_register_.size()); } } diff --git a/src/components/application_manager/src/message_helper.cc b/src/components/application_manager/src/message_helper.cc index 11bd6afda3..ee41ce5bfe 100644 --- a/src/components/application_manager/src/message_helper.cc +++ b/src/components/application_manager/src/message_helper.cc @@ -1299,11 +1299,8 @@ bool MessageHelper::CreateHMIApplicationStruct(ApplicationConstSharedPtr app, DCHECK_OR_RETURN(app_tts_name, false); if (!app_tts_name->empty()) { SmartObject output_tts_name = SmartObject(SmartType_Array); - - for (uint32_t i = 0; i < app_tts_name->length(); ++i) { - output_tts_name[i][strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT; - output_tts_name[i][strings::text] = (*app_tts_name)[i]; - } + output_tts_name[0][strings::text] = *(app->tts_name()); + output_tts_name[0][strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT; output[json::ttsName] = output_tts_name; } if (!app->vr_synonyms()->empty()) { |