From 1159d268e0b01846f1408a76d584a90bd2a71003 Mon Sep 17 00:00:00 2001 From: Tomasz Marciniak Date: Tue, 7 Jul 2015 12:44:35 +0200 Subject: [PATCH] [Application] Removed duplicated logic. [Verification] Code compiles. TCT: application-auto: 100% (159/159/0/0/0) application-manual: 100% (6/6/0/0/0) appcontrol: 100% (5/5/0/0/0) Change-Id: I6fecc471acfc97c72c9ac50a799439208799986f Signed-off-by: Tomasz Marciniak --- src/application/application_manager.cc | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/application/application_manager.cc b/src/application/application_manager.cc index 93adba33..bf29e8ab 100755 --- a/src/application/application_manager.cc +++ b/src/application/application_manager.cc @@ -490,25 +490,11 @@ void ApplicationManager::LaunchAppControl(const picojson::value& args) { if (!app_id.empty()) { LoggerD("app_id: %s", app_id.c_str()); - app_control_set_app_id(app_control_ptr.get(), app_id.c_str()); + int ret = app_control_set_app_id(app_control_ptr.get(), app_id.c_str()); - char* resolved_app_id = nullptr; - - // application ID can be aliased, read it again to get the real value - app_control_get_app_id(app_control_ptr.get(), &resolved_app_id); - // automatically release the memory - std::unique_ptr resolved_app_id_ptr(resolved_app_id, std::free); - - // Check if application exists - app_info_h info_h = nullptr; - - int ret = app_manager_get_app_info(resolved_app_id, &info_h); - std::unique_ptr::type, int(*)(app_info_h)> - info_h_ptr(info_h, &app_info_destroy); // automatically release the memory - - if (APP_MANAGER_ERROR_NONE != ret) { - LoggerE("Specified application does not exist"); - ReportError(PlatformResult(ErrorCode::NOT_FOUND_ERR, "No matched application found."), + if (APP_CONTROL_ERROR_NONE != ret) { + LoggerE("Invalid parameter passed."); + ReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter passed."), &response->get()); return; } -- 2.34.1