From aed346ced212261395ccc03dd99f88520b53e56c Mon Sep 17 00:00:00 2001 From: mked-luxoft Date: Fri, 9 Aug 2019 15:08:01 +0300 Subject: Use window id as int --- .../sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc | 2 +- .../sdl_rpc_plugin/src/commands/mobile/create_window_request.cc | 4 ++-- .../sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc | 4 ++-- .../rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc | 2 +- src/components/application_manager/src/commands/command_impl.cc | 4 ++-- .../application_manager/src/message_helper/message_helper.cc | 2 +- src/components/application_manager/src/state_controller_impl.cc | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc index 56124db96f..bf52492ae1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc @@ -64,7 +64,7 @@ void OnSystemContextNotification::Run() { WindowID window_id = mobile_apis::PredefinedWindows::DEFAULT_WINDOW; if ((*message_)[strings::msg_params].keyExists(strings::window_id)) { - window_id = (*message_)[strings::msg_params][strings::window_id].asUInt(); + window_id = (*message_)[strings::msg_params][strings::window_id].asInt(); } ApplicationSharedPtr app; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc index 52a06d7ef2..83406a549d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc @@ -99,7 +99,7 @@ void CreateWindowRequest::ApplyWindowInitialState( mobile_api::SystemContext::INVALID_ENUM); const WindowID window_id = - (*message_)[strings::msg_params][strings::window_id].asUInt(); + (*message_)[strings::msg_params][strings::window_id].asInt(); const std::string window_name = (*message_)[strings::msg_params][strings::window_name].asString(); @@ -143,7 +143,7 @@ void CreateWindowRequest::Run() { } const auto window_id = - (*message_)[strings::msg_params][strings::window_id].asUInt(); + (*message_)[strings::msg_params][strings::window_id].asInt(); if (application->WindowIdExists(window_id)) { LOG4CXX_ERROR(logger_, "Window with id #" << window_id << " does already exist"); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc index 2bfe0465f0..9a943bb9e3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc @@ -56,7 +56,7 @@ DeleteWindowRequest::~DeleteWindowRequest() {} bool DeleteWindowRequest::CheckWindowId( app_mngr::ApplicationSharedPtr app) const { const WindowID window_id = - (*message_)[strings::msg_params][strings::window_id].asUInt(); + (*message_)[strings::msg_params][strings::window_id].asInt(); if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW == window_id) { LOG4CXX_ERROR(logger_, "Main application window can't be deleted"); return false; @@ -78,7 +78,7 @@ app_mngr::WindowID DeleteWindowRequest::window_id() const { void DeleteWindowRequest::DeleteWindow( app_mngr::ApplicationSharedPtr app) const { const WindowID window_id = - (*message_)[strings::msg_params][strings::window_id].asUInt(); + (*message_)[strings::msg_params][strings::window_id].asInt(); app->RemoveWindowInfo(window_id); app->RemoveHMIState(window_id, HmiState::StateID::STATE_ID_REGULAR); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc index b62a88d7f2..84d11f8e09 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc @@ -419,7 +419,7 @@ void ShowRequest::Run() { if ((*message_)[strings::msg_params].keyExists(strings::window_id)) { const auto window_id = - (*message_)[strings::msg_params][strings::window_id].asUInt(); + (*message_)[strings::msg_params][strings::window_id].asInt(); if (!app->WindowIdExists(window_id)) { LOG4CXX_ERROR(logger_, "Window with id #" << window_id << " does not exist"); diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc index 82f19ed89a..8875895cb7 100644 --- a/src/components/application_manager/src/commands/command_impl.cc +++ b/src/components/application_manager/src/commands/command_impl.cc @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2014, Ford Motor Company All rights reserved. @@ -99,7 +99,7 @@ int32_t CommandImpl::function_id() const { WindowID CommandImpl::window_id() const { if ((*message_).keyExists(strings::msg_params)) { if ((*message_)[strings::msg_params].keyExists(strings::window_id)) { - return (*message_)[strings::msg_params][strings::window_id].asUInt(); + return (*message_)[strings::msg_params][strings::window_id].asInt(); } } return mobile_apis::PredefinedWindows::DEFAULT_WINDOW; diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 0b1ac9b47a..3639953a3a 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -3146,7 +3146,7 @@ WindowID MessageHelper::ExtractWindowIdFromSmartObject( const smart_objects::SmartObject& s_map) { if (smart_objects::SmartType_Map == s_map.getType()) { if (s_map.keyExists(strings::window_id)) { - return s_map[strings::window_id].asUInt(); + return s_map[strings::window_id].asInt(); } } return mobile_apis::PredefinedWindows::DEFAULT_WINDOW; diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index 7b9fc72ef9..8368597370 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -1087,7 +1087,7 @@ void StateControllerImpl::OnAppActivated( WindowID window_id = mobile_apis::PredefinedWindows::DEFAULT_WINDOW; if (message[strings::msg_params].keyExists(strings::window_id)) { - window_id = message[strings::msg_params][strings::window_id].asUInt(); + window_id = message[strings::msg_params][strings::window_id].asInt(); } const auto window_ids = app->GetWindowIds(); @@ -1128,7 +1128,7 @@ void StateControllerImpl::OnAppDeactivated( WindowID window_id = mobile_apis::PredefinedWindows::DEFAULT_WINDOW; if (message[strings::msg_params].keyExists(strings::window_id)) { - window_id = message[strings::msg_params][strings::window_id].asUInt(); + window_id = message[strings::msg_params][strings::window_id].asInt(); } const auto window_ids = app->GetWindowIds(); -- cgit v1.2.1