diff options
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/list_files_request.cc')
-rw-r--r-- | src/components/application_manager/src/commands/mobile/list_files_request.cc | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/components/application_manager/src/commands/mobile/list_files_request.cc b/src/components/application_manager/src/commands/mobile/list_files_request.cc index 7410c12a05..425f1ddb46 100644 --- a/src/components/application_manager/src/commands/mobile/list_files_request.cc +++ b/src/components/application_manager/src/commands/mobile/list_files_request.cc @@ -43,12 +43,11 @@ namespace application_manager { namespace commands { -ListFilesRequest::ListFilesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +ListFilesRequest::ListFilesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -ListFilesRequest::~ListFilesRequest() { -} +ListFilesRequest::~ListFilesRequest() {} void ListFilesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -65,35 +64,41 @@ void ListFilesRequest::Run() { if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) && (application_manager_.get_settings().list_files_in_none() <= application->list_files_in_none_count())) { - // If application is in the HMI_NONE level the quantity of allowed - // DeleteFile request is limited by the configuration profile - LOG4CXX_ERROR(logger_, "Too many requests from the app with HMILevel HMI_NONE "); - SendResponse(false, mobile_apis::Result::REJECTED); - return; + // If application is in the HMI_NONE level the quantity of allowed + // DeleteFile request is limited by the configuration profile + LOG4CXX_ERROR(logger_, + "Too many requests from the app with HMILevel HMI_NONE "); + SendResponse(false, mobile_apis::Result::REJECTED); + return; } application->increment_list_files_in_none_count(); (*message_)[strings::msg_params][strings::space_available] = - static_cast<int32_t>(application->GetAvailableDiskSpace()); + static_cast<int32_t>(application->GetAvailableDiskSpace()); uint32_t i = 0; const AppFilesMap& app_files = application->getAppFiles(); for (AppFilesMap::const_iterator it = app_files.begin(); - it != app_files.end(); ++it) { + it != app_files.end(); + ++it) { std::string filename = it->first.substr(it->first.find_last_of('/') + 1); // In AppFile to application stored full path to file. In message required // to write only name file. // Plus one required for move to next letter after '/'. if (i < application_manager_.get_settings().list_files_response_size()) { - LOG4CXX_DEBUG(logger_, "File " + filename + " added to ListFiles response"); + LOG4CXX_DEBUG(logger_, + "File " + filename + " added to ListFiles response"); (*message_)[strings::msg_params][strings::filenames][i++] = filename; } else { - LOG4CXX_DEBUG(logger_, "File " + filename + " not added to ListFiles response"); + LOG4CXX_DEBUG(logger_, + "File " + filename + " not added to ListFiles response"); } } (*message_)[strings::params][strings::message_type] = application_manager::MessageType::kResponse; - SendResponse(true, mobile_apis::Result::SUCCESS, NULL, + SendResponse(true, + mobile_apis::Result::SUCCESS, + NULL, &(*message_)[strings::msg_params]); } |