summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim-Nexty <35795928+zhouxin627@users.noreply.github.com>2020-04-04 02:53:08 +0900
committerGitHub <noreply@github.com>2020-04-03 13:53:08 -0400
commitd8c4ac3251a40f81a28deabd5be9a7597a26b8e9 (patch)
tree4d10dde48558e596ddfc4745296b8fc8457b7cc5
parentddcd97db9cdc5455550ebc20bc64b068c610b32b (diff)
downloadsdl_core-d8c4ac3251a40f81a28deabd5be9a7597a26b8e9.tar.gz
Fix for video stream failed by switched of connection via BT+WIFI (#3290)
Co-authored-by: jiazhouyang <jiazhouyang@iauto.com> Co-authored-by: JackLivio <jack@livio.io>
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc24
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc16
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 f807be2f5e..51b2f272d6 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -1996,6 +1996,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<uint32_t>::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<std::string> converted_params =
ConvertRejectedParamList(rejected_params);
@@ -2040,6 +2048,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 c8b4268bf0..4b97aa0e0c 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -1710,12 +1710,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;