summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoly Leshin <ALeshin@luxoft.com>2015-09-21 16:19:01 +0400
committerAnatoly Leshin <ALeshin@luxoft.com>2015-09-21 16:19:01 +0400
commit9d4a55c53772ac787f6e4298a8f959912b04bf38 (patch)
tree866642ff8308090832ef6c6e666703bec81a3bc3
parent12d569a8ae8f8822c3bba13c82f3667780d94250 (diff)
downloadsmartdevicelink-9d4a55c53772ac787f6e4298a8f959912b04bf38.tar.gz
Fix crash when processing SystemRequest with QUERY_APPS
Process tts_name as string, not as array. tts_name in QueryApps json file is "string" according to APPLINK-11731, tts_name in UpdateApplist is "array of strings" according to API.xml Fix: APPLINK-15783
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc34
-rw-r--r--src/components/application_manager/src/message_helper.cc7
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 fbe5228a1..33f334f0f 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -2005,28 +2005,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 2fd6d9f74..87afde8b4 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()) {