summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc')
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
index e70433f29b..033e70a29c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
@@ -46,6 +46,7 @@ Copyright (c) 2018, Ford Motor Company
#include "utils/custom_string.h"
#include "utils/file_system.h"
#include "utils/helpers.h"
+#include "utils/jsoncpp_reader_wrapper.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -470,8 +471,8 @@ void SystemRequest::Run() {
static_cast<rpc::policy_table_interface_base::RequestType>(
request_type));
- if (!policy_handler.IsRequestTypeAllowed(application->policy_app_id(),
- request_type)) {
+ if (!policy_handler.IsRequestTypeAllowed(
+ application->device(), application->policy_app_id(), request_type)) {
LOG4CXX_ERROR(logger_,
"RequestType " << stringified_request_type
<< " is DISALLOWED by policies");
@@ -612,17 +613,21 @@ void SystemRequest::Run() {
return;
} else if (mobile_apis::RequestType::QUERY_APPS == request_type) {
using namespace ns_smart_device_link::ns_json_handler::formatters;
+ application_manager_.OnQueryAppsRequest(application->device());
- smart_objects::SmartObject sm_object;
- Json::Reader reader;
+ utils::JsonReader reader;
std::string json(binary_data.begin(), binary_data.end());
Json::Value root;
- if (!reader.parse(json.c_str(), root)) {
- LOG4CXX_DEBUG(logger_, "Unable to parse query_app json file.");
+
+ if (!reader.parse(json, &root)) {
+ LOG4CXX_DEBUG(logger_, "Unable to parse query_app json file. ");
return;
}
+ smart_objects::SmartObject sm_object;
+
CFormatterJsonBase::jsonValueToObj(root, sm_object);
+
if (!ValidateQueryAppData(sm_object)) {
SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
return;