diff options
author | Jim-Nexty <35795928+zhouxin627@users.noreply.github.com> | 2020-02-08 00:20:21 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 10:20:21 -0500 |
commit | 3dfaccc21d83621eff5d122f58bd3709fc40737d (patch) | |
tree | cba759a60f7be0ad408a6f0a93308acf3d7eb8ff | |
parent | da829c08b709f3ae7a2cb5a031ad8d48124847dc (diff) | |
download | sdl_core-3dfaccc21d83621eff5d122f58bd3709fc40737d.tar.gz |
Fix for No mechanism for managing the switching sequence(Start/StopSt… (#3217)
* Fix for No mechanism for managing the switching sequence(Start/StopStreaming)
* change the code style
* change the code style
* Update src/components/application_manager/src/application_manager_impl.cc
Co-Authored-By: Collin <iCollin@users.noreply.github.com>
* Update src/components/application_manager/src/application_manager_impl.cc
Co-Authored-By: Collin <iCollin@users.noreply.github.com>
* change to cpp11 based loop and remove the useless else
Co-authored-by: Collin <iCollin@users.noreply.github.com>
-rw-r--r-- | src/components/application_manager/src/application_manager_impl.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 471348c119..b727f6d621 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1812,6 +1812,25 @@ bool ApplicationManagerImpl::StartNaviService( } } + { + /* Fix: For NaviApp1 Switch to NaviApp2, App1's Endcallback() arrives + later than App2's Startcallback(). Cause streaming issue on HMI. + */ + sync_primitives::AutoLock lock(applications_list_lock_ptr_); + for (auto app : applications_) { + if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { + LOG4CXX_DEBUG(logger_, + "Continue, Not Navi App Id: " << app->app_id()); + continue; + } + LOG4CXX_DEBUG(logger_, + "Abort Stream Service of other NaviAppId: " + << app->app_id() + << " Service_type: " << service_type); + StopNaviService(app->app_id(), service_type); + } + } + if (service_type == ServiceType::kMobileNav) { smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); ConvertVideoParamsToSO(converted_params, params); @@ -1915,10 +1934,27 @@ void ApplicationManagerImpl::StopNaviService( if (navi_service_status_.end() == it) { LOG4CXX_WARN(logger_, "No Information about navi service " << service_type); + // Fix: Need return for Not navi service at now + return; } else { + // Fix: Repeated tests are not executed after they have stopped for Navi + if (false == it->second.first && + ServiceType::kMobileNav == service_type) { + LOG4CXX_DEBUG(logger_, "appId: " << app_id << "Navi had stopped"); + return; + } + + // Fix: Repeated tests are not executed after they have stopped for Audio + if (false == it->second.second && ServiceType::kAudio == service_type) { + LOG4CXX_DEBUG(logger_, "appId: " << app_id << "Audio had stopped"); + return; + } // Fill NaviServices map. Set false to first value of pair if // we've stopped video service or to second value if we've // stopped audio service + LOG4CXX_DEBUG(logger_, + "appId: " << app_id << " service_type: " << service_type + << " to stopped"); service_type == ServiceType::kMobileNav ? it->second.first = false : it->second.second = false; } |