diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc index c5bc79f09d..a0ad320cac 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc @@ -61,18 +61,6 @@ bool SDLRPCPlugin::Init(app_mngr::ApplicationManager& app_manager, return true; } -bool SDLRPCPlugin::Init( - application_manager::ApplicationManager& app_manager, - application_manager::rpc_service::RPCService& rpc_service, - application_manager::HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handler, - resumption::LastState& last_state) { - UNUSED(last_state); - command_factory_.reset(new sdl_rpc_plugin::SDLCommandFactory( - app_manager, rpc_service, hmi_capabilities, policy_handler)); - return true; -} - bool SDLRPCPlugin::IsAbleToProcess( const int32_t function_id, const app_mngr::commands::Command::CommandSource message_source) { @@ -93,21 +81,32 @@ void SDLRPCPlugin::OnApplicationEvent( plugins::ApplicationEvent event, app_mngr::ApplicationSharedPtr application) { SDL_LOG_AUTO_TRACE(); - if (plugins::ApplicationEvent::kApplicationRegistered == event) { - application->AddExtension( - std::make_shared<WayPointsAppExtension>(*this, *application)); - - auto sys_cap_ext_ptr = - std::make_shared<SystemCapabilityAppExtension>(*this, *application); - application->AddExtension(sys_cap_ext_ptr); - // Processing automatic subscription to SystemCapabilities for DISPLAY type - const auto capability_type = - mobile_apis::SystemCapabilityType::eType::DISPLAYS; - SDL_LOG_DEBUG("Subscription to DISPLAYS capability is enabled"); - sys_cap_ext_ptr->SubscribeTo(capability_type); - - } else if (plugins::ApplicationEvent::kDeleteApplicationData == event) { - ClearSubscriptions(application); + switch (event) { + case plugins::ApplicationEvent::kApplicationRegistered: { + application->AddExtension( + std::make_shared<WayPointsAppExtension>(*this, *application)); + + auto sys_cap_ext_ptr = + std::make_shared<SystemCapabilityAppExtension>(*this, *application); + application->AddExtension(sys_cap_ext_ptr); + // Processing automatic subscription to SystemCapabilities for DISPLAY + // type + const auto capability_type = + mobile_apis::SystemCapabilityType::eType::DISPLAYS; + SDL_LOG_DEBUG("Subscription to DISPLAYS capability is enabled"); + sys_cap_ext_ptr->SubscribeTo(capability_type); + break; + } + + case plugins::ApplicationEvent::kApplicationUnregistered: + case plugins::ApplicationEvent::kDeleteApplicationData: { + ClearSubscriptions(application); + break; + } + + default: { + break; + } } } |