From f2787b465d5e517e8956b75ea4db27e1ab41950d Mon Sep 17 00:00:00 2001 From: jiazhouyang Date: Fri, 6 Mar 2020 11:10:13 +0800 Subject: [PATCH 1/3] Fix for video stream failed by switched of connection via BT+WIFI --- .../src/application_manager_impl.cc | 24 +++++++++++++++++++ .../src/connection_handler_impl.cc | 16 +++++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index d51d4c9d060..b7b3241633f 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1899,6 +1899,14 @@ void ApplicationManagerImpl::OnStreamingConfigured( application(app_id)->StartStreaming(service_type); connection_handler().NotifyServiceStartedResult(app_id, true, empty); + + // Fix: For wifi Secondary + // Should erase appid from deque of ForbidStreaming() push in the last time + std::deque::const_iterator iter = std::find( + navi_app_to_end_stream_.begin(), navi_app_to_end_stream_.end(), app_id); + if (navi_app_to_end_stream_.end() != iter) { + navi_app_to_end_stream_.erase(iter); + } } else { std::vector converted_params = ConvertRejectedParamList(rejected_params); @@ -1926,6 +1934,22 @@ void ApplicationManagerImpl::StopNaviService( service_type == ServiceType::kMobileNav ? it->second.first = false : it->second.second = false; } + // Fix: For wifi Secondary + // undisposed data active the VPMService restart again, + // because Not set Allowstream flag + ApplicationSharedPtr app = application(app_id); + if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { + LOG4CXX_ERROR(logger_, "Navi/Projection application not found"); + return; + } + if (service_type == ServiceType::kMobileNav) { + app->set_video_streaming_allowed(false); + } + if (service_type == ServiceType::kAudio) { + app->set_audio_streaming_allowed(false); + } + // push_back for judge in ForbidStreaming(), + navi_app_to_end_stream_.push_back(app_id); } ApplicationSharedPtr app = application(app_id); diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index 1bb1ecbde39..b6c57e3c675 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -1666,12 +1666,18 @@ void ConnectionHandlerImpl::OnConnectionEnded( const uint32_t session_key = KeyFromPair(connection_id, session_it->first); const ServiceList& service_list = session_it->second.service_list; - for (ServiceList::const_iterator service_it = service_list.begin(), - end = service_list.end(); - service_it != end; - ++service_it) { + + // Fix: + // Endcallback(service_type) by Disconnected, + // It should ended in order by 10|11 -> 7. + // Refer to service_list.rend() of CloseSession() + ServiceList::const_reverse_iterator service_list_itr = + service_list.rbegin(); + for (; service_list_itr != service_list.rend(); ++service_list_itr) { connection_handler_observer_->OnServiceEndedCallback( - session_key, service_it->service_type, CloseSessionReason::kCommon); + session_key, + service_list_itr->service_type, + CloseSessionReason::kCommon); } } ending_connection_ = NULL; From 5a62557451b26028635823bd5d7c7be72507aee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=20=E9=91=AB?= <103409@ad.nexty-ele.com> Date: Mon, 30 Mar 2020 09:00:25 +0900 Subject: [PATCH 2/3] feature/modify_the_range_of_APTs_maxDuration --- src/components/interfaces/HMI_API.xml | 2 +- src/components/interfaces/MOBILE_API.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index d105d2e3e84..c4addf8ea16 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -5521,7 +5521,7 @@ audioPassThruDisplayText1: First line of text displayed during audio capture. audioPassThruDisplayText2: Second line of text displayed during audio capture. - + The maximum duration of audio recording in milliseconds. If not provided, the recording should be performed until EndAudioPassThru arrives. diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 2a09cc6b57e..6df689938d0 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -5678,7 +5678,7 @@ This value shall be allowed at 8 kHz or 16 or 22 or 44 kHz. - + The maximum duration of audio recording in milliseconds. From 3a34131633e6646769157b278ec9948784794619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=20=E9=91=AB?= <103409@ad.nexty-ele.com> Date: Mon, 30 Mar 2020 09:12:10 +0900 Subject: [PATCH 3/3] Revert "Fix for video stream failed by switched of connection via BT+WIFI" This reverts commit f2787b465d5e517e8956b75ea4db27e1ab41950d. --- .../src/application_manager_impl.cc | 24 ------------------- .../src/connection_handler_impl.cc | 16 ++++--------- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index b7b3241633f..d51d4c9d060 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1899,14 +1899,6 @@ void ApplicationManagerImpl::OnStreamingConfigured( application(app_id)->StartStreaming(service_type); connection_handler().NotifyServiceStartedResult(app_id, true, empty); - - // Fix: For wifi Secondary - // Should erase appid from deque of ForbidStreaming() push in the last time - std::deque::const_iterator iter = std::find( - navi_app_to_end_stream_.begin(), navi_app_to_end_stream_.end(), app_id); - if (navi_app_to_end_stream_.end() != iter) { - navi_app_to_end_stream_.erase(iter); - } } else { std::vector converted_params = ConvertRejectedParamList(rejected_params); @@ -1934,22 +1926,6 @@ void ApplicationManagerImpl::StopNaviService( service_type == ServiceType::kMobileNav ? it->second.first = false : it->second.second = false; } - // Fix: For wifi Secondary - // undisposed data active the VPMService restart again, - // because Not set Allowstream flag - ApplicationSharedPtr app = application(app_id); - if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { - LOG4CXX_ERROR(logger_, "Navi/Projection application not found"); - return; - } - if (service_type == ServiceType::kMobileNav) { - app->set_video_streaming_allowed(false); - } - if (service_type == ServiceType::kAudio) { - app->set_audio_streaming_allowed(false); - } - // push_back for judge in ForbidStreaming(), - navi_app_to_end_stream_.push_back(app_id); } ApplicationSharedPtr app = application(app_id); diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index b6c57e3c675..1bb1ecbde39 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -1666,18 +1666,12 @@ void ConnectionHandlerImpl::OnConnectionEnded( const uint32_t session_key = KeyFromPair(connection_id, session_it->first); const ServiceList& service_list = session_it->second.service_list; - - // Fix: - // Endcallback(service_type) by Disconnected, - // It should ended in order by 10|11 -> 7. - // Refer to service_list.rend() of CloseSession() - ServiceList::const_reverse_iterator service_list_itr = - service_list.rbegin(); - for (; service_list_itr != service_list.rend(); ++service_list_itr) { + for (ServiceList::const_iterator service_it = service_list.begin(), + end = service_list.end(); + service_it != end; + ++service_it) { connection_handler_observer_->OnServiceEndedCallback( - session_key, - service_list_itr->service_type, - CloseSessionReason::kCommon); + session_key, service_it->service_type, CloseSessionReason::kCommon); } } ending_connection_ = NULL;