diff options
author | Artem Nosach <ANosach@luxoft.com> | 2015-04-28 15:07:57 +0300 |
---|---|---|
committer | Artem Nosach <ANosach@luxoft.com> | 2015-06-23 17:06:55 +0300 |
commit | 763c724e756d2fa9b0120d1b98614230493dfdf1 (patch) | |
tree | f56f9bc5aa7f7ffa59afd6382a0e0c8ed11df86f | |
parent | f646dd88d5c3e37b170e436e7da0f9f8c2d9abbd (diff) | |
download | smartdevicelink-763c724e756d2fa9b0120d1b98614230493dfdf1.tar.gz |
Remove notification sending from UnregisterApplication().
6 files changed, 20 insertions, 22 deletions
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index e76761c58..90d26ac88 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -611,7 +611,6 @@ class ApplicationManagerImpl : public ApplicationManager, const int32_t& session_key, const protocol_handler::ServiceType& type, const connection_handler::CloseSessionReason& close_reason) OVERRIDE; - void OnApplicationFloodCallBack(const uint32_t& connection_key) OVERRIDE; /** * @ Add notification to collection diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 149be380a..d861832c9 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1092,6 +1092,7 @@ void ApplicationManagerImpl::OnServiceEndedCallback( using namespace protocol_handler; using namespace mobile_apis; using namespace connection_handler; + using namespace mobile_apis; LOG4CXX_DEBUG(logger_, "OnServiceEndedCallback for service " << type << " with reason " << close_reason @@ -2213,6 +2214,15 @@ void ApplicationManagerImpl::UnregisterAllApplications() { while (it != accessor.end()) { ApplicationSharedPtr app_to_remove = *it; +#ifdef CUSTOMER_PASA + if (!is_ignition_off) { +#endif // CUSTOMER_PASA + MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile( + app_to_remove->app_id(), unregister_reason_); +#ifdef CUSTOMER_PASA + } +#endif // CUSTOMER_PASA + UnregisterApplication(app_to_remove->app_id(), mobile_apis::Result::INVALID_ENUM, is_ignition_off, is_unexpected_disconnect); @@ -2261,9 +2271,6 @@ void ApplicationManagerImpl::UnregisterApplication( } //remove appID from tts_global_properties_app_list_ - MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile( - app_id, unregister_reason_); - RemoveAppFromTTSGlobalPropertiesList(app_id); switch (reason) { @@ -2333,7 +2340,6 @@ void ApplicationManagerImpl::UnregisterApplication( return; } - void ApplicationManagerImpl::OnAppUnauthorized(const uint32_t& app_id) { connection_handler_->CloseSession(app_id, connection_handler::kUnauthorizedApp); } @@ -2585,7 +2591,8 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) { navi_service_status_.find(app_id); if (navi_service_status_.end() == it || (!it->second.first && !it->second.second)) { - SetUnregisterAllApplicationsReason(PROTOCOL_VIOLATION); + MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile( + app_id, PROTOCOL_VIOLATION); UnregisterApplication(app_id, ABORTED); return; } @@ -2713,7 +2720,8 @@ void ApplicationManagerImpl::CloseNaviApp() { navi_service_status_.find(app_id); if (navi_service_status_.end() != it) { if (it->second.first || it->second.second) { - SetUnregisterAllApplicationsReason(PROTOCOL_VIOLATION); + MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile( + app_id, PROTOCOL_VIOLATION); UnregisterApplication(app_id, ABORTED); } } diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc index 6199818db..dc63a1194 100644 --- a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc @@ -50,6 +50,9 @@ void UnregisterAppInterfaceRequest::Run() { return; } + MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile( + connection_key(), + mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM); app_manager->UnregisterApplication(connection_key(), mobile_apis::Result::SUCCESS); SendResponse(true, mobile_apis::Result::SUCCESS); diff --git a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h index 605fad103..15d194089 100644 --- a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h @@ -177,7 +177,6 @@ class ApplicationManagerImpl : public ApplicationManager, MOCK_METHOD2(OnServiceEndedCallback, void (const int32_t&, const protocol_handler::ServiceType&, const connection_handler::CloseSessionReason&)); - MOCK_METHOD1(OnApplicationFloodCallBack, void(const uint32_t&)); MOCK_METHOD1(Handle, void (const impl::MessageFromMobile)); MOCK_METHOD1(Handle, void (const impl::MessageToMobile)); MOCK_METHOD1(Handle, void (const impl::MessageFromHmi)); diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_observer.h b/src/components/connection_handler/include/connection_handler/connection_handler_observer.h index 13af3ec6c..556a2dc4e 100644 --- a/src/components/connection_handler/include/connection_handler/connection_handler_observer.h +++ b/src/components/connection_handler/include/connection_handler/connection_handler_observer.h @@ -100,13 +100,6 @@ class ConnectionHandlerObserver { const protocol_handler::ServiceType& type, const connection_handler::CloseSessionReason& close_reason) = 0; - /** - * \brief Callback function used by ConnectionHandler - * when Mobile Application start message flood - * \param connection_key used by other components as application identifier - */ - virtual void OnApplicationFloodCallBack(const uint32_t &connection_key) = 0; - protected: /** * \brief Destructor diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index b6dd6af01..70a50c589 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -363,14 +363,10 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback( return new_session_id; } -void ConnectionHandlerImpl::OnApplicationFloodCallBack(const uint32_t &connection_key) { +void ConnectionHandlerImpl::OnApplicationFloodCallBack( + const uint32_t &connection_key) { LOG4CXX_AUTO_TRACE(logger_); - { - sync_primitives::AutoLock lock(connection_handler_observer_lock_); - if(connection_handler_observer_) { - connection_handler_observer_->OnApplicationFloodCallBack(connection_key); - } - } + transport_manager::ConnectionUID connection_handle = 0; uint8_t session_id = 0; PairFromKey(connection_key, &connection_handle, &session_id); |