summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/mobile/delete_file_response.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/delete_file_response.cc')
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_response.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/components/application_manager/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/src/commands/mobile/delete_file_response.cc
index 1bbb18313f..8ed6f7ba2e 100644
--- a/src/components/application_manager/src/commands/mobile/delete_file_response.cc
+++ b/src/components/application_manager/src/commands/mobile/delete_file_response.cc
@@ -32,26 +32,24 @@
*/
#include "application_manager/commands/mobile/delete_file_response.h"
-#include "application_manager/application_manager_impl.h"
+
#include "application_manager/application_impl.h"
namespace application_manager {
namespace commands {
-DeleteFileResponse::DeleteFileResponse(const MessageSharedPtr& message)
- : CommandResponseImpl(message) {
-}
+DeleteFileResponse::DeleteFileResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager)
+ : CommandResponseImpl(message, application_manager) {}
-DeleteFileResponse::~DeleteFileResponse() {
-}
+DeleteFileResponse::~DeleteFileResponse() {}
void DeleteFileResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- uint32_t app_id = (*message_)[strings::params][strings::connection_key]
- .asUInt();
- ApplicationSharedPtr app =
- ApplicationManagerImpl::instance()->application(app_id);
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
if (!app) {
LOG4CXX_ERROR(logger_, "Application not registered");
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
@@ -59,8 +57,7 @@ void DeleteFileResponse::Run() {
}
(*message_)[strings::msg_params][strings::space_available] =
- static_cast<int32_t>(
- ApplicationManagerImpl::instance()->GetAvailableSpaceForApp(app->name()));
+ static_cast<uint32_t>(app->GetAvailableDiskSpace());
SendResponse((*message_)[strings::msg_params][strings::success].asBool());
}