diff --git a/frameworks/src/bundle_command.cpp b/frameworks/src/bundle_command.cpp index 609b7fe93c0b355b8b00a02bbfa64dd6f8ae4558..0c9f90a5aa0e53cffae7fa6683e089d3d4af65d3 100644 --- a/frameworks/src/bundle_command.cpp +++ b/frameworks/src/bundle_command.cpp @@ -32,6 +32,7 @@ #include "nlohmann/json.hpp" #include "parameter.h" #include "parameters.h" +#include "quick_fix/quick_fix_manager_client.h" #include "quick_fix_command.h" #include "quick_fix_status_callback_host_impl.h" #include "status_receiver_impl.h" @@ -2844,18 +2845,13 @@ ErrCode BundleManagerShellCommand::DeployQuickFixDisable(const std::vectorAsObject()->AddDeathRecipient(recipient); - auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); - if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); - return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; - } std::vector destFiles; - auto res = quickFixProxy->CopyFiles(pathVec, destFiles); + auto res = QuickFixManagerClient::GetInstance().CopyFiles(pathVec, destFiles); if (res != ERR_OK) { APP_LOGE("Copy files failed with %{public}d.", res); return res; } - res = quickFixProxy->DeployQuickFix(destFiles, callback, isDebug, targetPath); + res = QuickFixManagerClient::GetInstance().DeployQuickFix(destFiles, callback, isDebug, targetPath); if (res != ERR_OK) { APP_LOGE("DeployQuickFix failed"); return res; @@ -2878,12 +2874,7 @@ ErrCode BundleManagerShellCommand::DeleteQuickFix(const std::string &bundleName, return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bundleMgrProxy_->AsObject()->AddDeathRecipient(recipient); - auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); - if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); - return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; - } - auto res = quickFixProxy->DeleteQuickFix(bundleName, callback); + auto res = QuickFixManagerClient::GetInstance().DeleteQuickFix(bundleName, callback); if (res != ERR_OK) { APP_LOGE("DeleteQuickFix failed"); return res; diff --git a/frameworks/src/bundle_test_tool.cpp b/frameworks/src/bundle_test_tool.cpp index f2155d24d7889b59b70b8c164abc5360b202a25a..6b5a17be67f2cd6dd892f34be34e8fc66e672a5e 100644 --- a/frameworks/src/bundle_test_tool.cpp +++ b/frameworks/src/bundle_test_tool.cpp @@ -49,6 +49,7 @@ #include "token_setproc.h" #include "system_ability_definition.h" #ifdef BUNDLE_FRAMEWORK_QUICK_FIX +#include "quick_fix/quick_fix_manager_client.h" #include "quick_fix_status_callback_host_impl.h" #endif #include "status_receiver_impl.h" @@ -3612,18 +3613,13 @@ ErrCode BundleTestTool::DeployQuickFix(const std::vector &quickFixP return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bundleMgrProxy_->AsObject()->AddDeathRecipient(recipient); - auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); - if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); - return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; - } std::vector destFiles; - auto res = quickFixProxy->CopyFiles(pathVec, destFiles); + auto res = QuickFixManagerClient::GetInstance().CopyFiles(pathVec, destFiles); if (res != ERR_OK) { APP_LOGE("Copy files failed with %{public}d.", res); return res; } - res = quickFixProxy->DeployQuickFix(destFiles, callback, isDebug); + res = QuickFixManagerClient::GetInstance().DeployQuickFix(destFiles, callback, isDebug); if (res != ERR_OK) { APP_LOGE("DeployQuickFix failed"); return res; @@ -3651,13 +3647,8 @@ ErrCode BundleTestTool::SwitchQuickFix(const std::string &bundleName, int32_t en return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bundleMgrProxy_->AsObject()->AddDeathRecipient(recipient); - auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); - if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); - return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; - } bool enableFlag = (enable == 0) ? false : true; - auto res = quickFixProxy->SwitchQuickFix(bundleName, enableFlag, callback); + auto res = QuickFixManagerClient::GetInstance().SwitchQuickFix(bundleName, enableFlag, callback); if (res != ERR_OK) { APP_LOGE("SwitchQuickFix failed"); return res; @@ -3684,12 +3675,7 @@ ErrCode BundleTestTool::DeleteQuickFix(const std::string &bundleName, return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bundleMgrProxy_->AsObject()->AddDeathRecipient(recipient); - auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); - if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); - return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; - } - auto res = quickFixProxy->DeleteQuickFix(bundleName, callback); + auto res = QuickFixManagerClient::GetInstance().DeleteQuickFix(bundleName, callback); if (res != ERR_OK) { APP_LOGE("DeleteQuickFix failed"); return res;