From a74cbde93a8a07b9cff22825aee5bd243031eaff Mon Sep 17 00:00:00 2001 From: wanghang Date: Thu, 8 Sep 2022 09:54:34 +0800 Subject: [PATCH] IssueNo:#I5PRAP Description:opt SetApplicationEnabled and SetAbilityEnabled Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wanghang Change-Id: If2557f69d451383c0a5a9d145e34ca5049bd2f1a --- .../test/moduletest/mock/include/mock_bundle_manager.h | 6 ++++-- frameworks/test/moduletest/mock/mock_bundle_mgr_proxy.cpp | 4 ++-- .../test/moduletest/mock/include/mock_bundle_manager.h | 7 ++++--- services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp | 8 ++++---- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/frameworks/test/moduletest/mock/include/mock_bundle_manager.h b/frameworks/test/moduletest/mock/include/mock_bundle_manager.h index 564eef74c..681256d7f 100644 --- a/frameworks/test/moduletest/mock/include/mock_bundle_manager.h +++ b/frameworks/test/moduletest/mock/include/mock_bundle_manager.h @@ -433,9 +433,10 @@ public: * @brief Checks whether a specified application is enabled. * * @param bundleName Indicates the bundle name of the application. + * @param isEnable Indicates the application status is enabled. * @return Returns true if the application is enabled; returns false otherwise. */ - virtual bool IsApplicationEnabled(const std::string &bundleName) override + virtual bool IsApplicationEnabled(const std::string &bundleName, bool &isEnable) override { return true; } @@ -444,9 +445,10 @@ public: * @brief Sets whether to enable a specified ability. * * @param abilityInfo Indicates information about the ability to check. + * @param isEnable Indicates the ability status is enabled. * @return Returns true if the ability is enabled; returns false otherwise. */ - virtual bool IsAbilityEnabled(const AbilityInfo &abilityInfo) override + virtual bool IsAbilityEnabled(const AbilityInfo &abilityInfo, bool &isEnable) override { return true; } diff --git a/frameworks/test/moduletest/mock/mock_bundle_mgr_proxy.cpp b/frameworks/test/moduletest/mock/mock_bundle_mgr_proxy.cpp index 6c15c081d..65c19a6f8 100644 --- a/frameworks/test/moduletest/mock/mock_bundle_mgr_proxy.cpp +++ b/frameworks/test/moduletest/mock/mock_bundle_mgr_proxy.cpp @@ -189,12 +189,12 @@ bool BundleMgrProxy::DumpInfos(const DumpFlag flag, const std::string &bundleNam return true; } -bool BundleMgrProxy::IsApplicationEnabled(const std::string &bundleName) +bool BundleMgrProxy::IsApplicationEnabled(const std::string &bundleName, bool &isEnable) { return true; } -bool BundleMgrProxy::IsAbilityEnabled(const AbilityInfo &abilityInfo) +bool BundleMgrProxy::IsAbilityEnabled(const AbilityInfo &abilityInfo, bool &isEnable) { return true; } diff --git a/services/test/moduletest/mock/include/mock_bundle_manager.h b/services/test/moduletest/mock/include/mock_bundle_manager.h index 56f641cba..83cecfd47 100644 --- a/services/test/moduletest/mock/include/mock_bundle_manager.h +++ b/services/test/moduletest/mock/include/mock_bundle_manager.h @@ -333,11 +333,12 @@ public: * @brief Checks whether a specified application is enabled. * * @param bundleName Indicates the bundle name of the application. - * @return Returns true if the application is enabled; returns false otherwise. + * @param isEnable Indicates the application status is enabled. + * @return Returns result of the operation. */ - virtual bool IsApplicationEnabled(const std::string &bundleName) override + virtual ErrCode IsApplicationEnabled(const std::string &bundleName, bool& isEnable) override { - return true; + return ERR_OK; } /** * @brief Obtains the interface used to install and uninstall bundles. diff --git a/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp b/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp index d38187389..f64b680a0 100644 --- a/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp +++ b/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp @@ -181,15 +181,15 @@ bool BundleMgrProxy::DumpInfos( return true; } -bool BundleMgrProxy::IsApplicationEnabled(const std::string &bundleName) +ErrCode BundleMgrProxy::IsApplicationEnabled(const std::string &bundleName, bool &isEnable) { - return true; + return ERR_OK; } -bool BundleMgrProxy::IsAbilityEnabled(const AbilityInfo &abilityInfo) +ErrCode BundleMgrProxy::IsAbilityEnabled(const AbilityInfo &abilityInfo, bool &isEnable) { - return true; + return ERR_OK; } template -- Gitee