diff --git a/frameworks/ans/test/moduletest/mock/include/mock_bundle_manager.h b/frameworks/ans/test/moduletest/mock/include/mock_bundle_manager.h index cc102a7358a8fdea074a893039e5315919a363e8..da5c0719644c357dea6541ce9cdee06fd4138da6 100644 --- a/frameworks/ans/test/moduletest/mock/include/mock_bundle_manager.h +++ b/frameworks/ans/test/moduletest/mock/include/mock_bundle_manager.h @@ -69,9 +69,11 @@ public: * @param bundleName Indicates the application bundle name to be queried. * @param flag Indicates the information contained in the BundleInfo object to be returned. * @param bundleInfo Indicates the obtained BundleInfo object. + * @param userId Indicates the user ID. * @return Returns true if the BundleInfo is successfully obtained; returns false otherwise. */ - virtual bool GetBundleInfo(const std::string &bundleName, const BundleFlag flag, BundleInfo &bundleInfo) override + virtual bool GetBundleInfo( + const std::string &bundleName, const BundleFlag flag, BundleInfo &bundleInfo, int32_t userId) override { return true; } @@ -79,9 +81,11 @@ public: * @brief Obtains BundleInfo of all bundles available in the system. * @param flag Indicates the flag used to specify information contained in the BundleInfo that will be returned. * @param bundleInfos Indicates all of the obtained BundleInfo objects. + * @param userId Indicates the user ID. * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise. */ - virtual bool GetBundleInfos(const BundleFlag flag, std::vector &bundleInfos) override + virtual bool GetBundleInfos( + const BundleFlag flag, std::vector &bundleInfos, int32_t userId) override { return true; }; @@ -459,10 +463,12 @@ public: * @brief Dump the bundle informations with specifc flags. * @param flag Indicates the information contained in the dump result. * @param bundleName Indicates the bundle name if needed. + * @param userId Indicates the user ID. * @param result Indicates the dump infomation result. * @return Returns true if the dump result is successfully obtained; returns false otherwise. */ - virtual bool DumpInfos(const DumpFlag flag, const std::string &bundleName, std::string &result) override + virtual bool DumpInfos( + const DumpFlag flag, const std::string &bundleName, int32_t userId, std::string &result) override { return true; } @@ -524,6 +530,14 @@ public: { return nullptr; } + /** + * @brief Obtains the interface used to create or delete user. + * @return Returns a pointer to IBundleUserMgr class if exist; returns nullptr otherwise. + */ + virtual sptr GetBundleUserMgr() override + { + return nullptr; + } void MockSetIsSystemApp(bool isSystemApp); diff --git a/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp b/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp index 5f1674281bb32dac75cad98cb72379f0b1ecee0c..ba85231a9e83a15e65475b484f85534b33db564e 100644 --- a/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp +++ b/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp @@ -44,13 +44,15 @@ bool BundleMgrProxy::GetApplicationInfos( return true; } -bool BundleMgrProxy::GetBundleInfo(const std::string &bundleName, const BundleFlag flag, BundleInfo &bundleInfo) +bool BundleMgrProxy::GetBundleInfo( + const std::string &bundleName, const BundleFlag flag, BundleInfo &bundleInfo, int32_t userId) { bundleInfo.uid = 1; return true; } -bool BundleMgrProxy::GetBundleInfos(const BundleFlag flag, std::vector &bundleInfos) +bool BundleMgrProxy::GetBundleInfos( + const BundleFlag flag, std::vector &bundleInfos, int32_t userId) { return true; } @@ -203,7 +205,8 @@ bool BundleMgrProxy::UnregisterBundleStatusCallback() return true; } -bool BundleMgrProxy::DumpInfos(const DumpFlag flag, const std::string &bundleName, std::string &result) +bool BundleMgrProxy::DumpInfos( + const DumpFlag flag, const std::string &bundleName, int32_t userId, std::string &result) { 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 6a550d69c09a9a581167e4ba344c3f76fcefe8f8..47b0164dacf12ad42cdabdc6c127c209bd4e3124 100644 --- a/services/test/moduletest/mock/include/mock_bundle_manager.h +++ b/services/test/moduletest/mock/include/mock_bundle_manager.h @@ -69,9 +69,11 @@ public: * @param bundleName Indicates the application bundle name to be queried. * @param flag Indicates the information contained in the BundleInfo object to be returned. * @param bundleInfo Indicates the obtained BundleInfo object. + * @param userId Indicates the user ID. * @return Returns true if the BundleInfo is successfully obtained; returns false otherwise. */ - virtual bool GetBundleInfo(const std::string &bundleName, const BundleFlag flag, BundleInfo &bundleInfo) override + virtual bool GetBundleInfo( + const std::string &bundleName, const BundleFlag flag, BundleInfo &bundleInfo, int32_t userId) override { return true; } @@ -79,9 +81,11 @@ public: * @brief Obtains BundleInfo of all bundles available in the system. * @param flag Indicates the flag used to specify information contained in the BundleInfo that will be returned. * @param bundleInfos Indicates all of the obtained BundleInfo objects. + * @param userId Indicates the user ID. * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise. */ - virtual bool GetBundleInfos(const BundleFlag flag, std::vector &bundleInfos) override + virtual bool GetBundleInfos( + const BundleFlag flag, std::vector &bundleInfos, int32_t userId) override { return true; }; @@ -365,10 +369,12 @@ public: * @brief Dump the bundle informations with specifc flags. * @param flag Indicates the information contained in the dump result. * @param bundleName Indicates the bundle name if needed. + * @param userId Indicates the user ID. * @param result Indicates the dump infomation result. * @return Returns true if the dump result is successfully obtained; returns false otherwise. */ - virtual bool DumpInfos(const DumpFlag flag, const std::string &bundleName, std::string &result) override + virtual bool DumpInfos( + const DumpFlag flag, const std::string &bundleName, int32_t userId, std::string &result) override { return true; } @@ -400,6 +406,14 @@ public: { return nullptr; } + /** + * @brief Obtains the interface used to create or delete user. + * @return Returns a pointer to IBundleUserMgr class if exist; returns nullptr otherwise. + */ + virtual sptr GetBundleUserMgr() override + { + return nullptr; + } void MockSetIsSystemApp(bool isSystemApp); diff --git a/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp b/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp index 232efcf27eef9a850389828a20d2e80f0d07157e..b80d03d7f51d67dcca64b51b3166cf6caea5b8a0 100644 --- a/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp +++ b/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp @@ -42,12 +42,14 @@ bool BundleMgrProxy::GetApplicationInfos( return true; } -bool BundleMgrProxy::GetBundleInfo(const std::string &bundleName, const BundleFlag flag, BundleInfo &bundleInfo) +bool BundleMgrProxy::GetBundleInfo( + const std::string &bundleName, const BundleFlag flag, BundleInfo &bundleInfo, int32_t userId) { return true; } -bool BundleMgrProxy::GetBundleInfos(const BundleFlag flag, std::vector &bundleInfos) +bool BundleMgrProxy::GetBundleInfos( + const BundleFlag flag, std::vector &bundleInfos, int32_t userId) { return true; } @@ -200,7 +202,8 @@ bool BundleMgrProxy::UnregisterBundleStatusCallback() return true; } -bool BundleMgrProxy::DumpInfos(const DumpFlag flag, const std::string &bundleName, std::string &result) +bool BundleMgrProxy::DumpInfos( + const DumpFlag flag, const std::string &bundleName, int32_t userId, std::string &result) { return true; }