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 3f04edd54e985e20434f983247b3b69aa334c971..1dcc0725270f79a618bab02f7e8fce8551618987 100644 --- a/frameworks/ans/test/moduletest/mock/include/mock_bundle_manager.h +++ b/frameworks/ans/test/moduletest/mock/include/mock_bundle_manager.h @@ -247,21 +247,6 @@ public: { return true; } - /** - * @brief Confirms with the permission management module to check whether a request prompt is required for granting - * a certain permission. - * @param bundleName Indicates the name of the bundle to check. - * @param permission Indicates the permission to check. - * @param userId Indicates the user id. - * @return Returns true if the current application does not have the permission and the user does not turn off - * further requests; returns false if the current application already has the permission, the permission is rejected - * by the system, or the permission is denied by the user and the user has turned off further requests. - */ - virtual bool CanRequestPermission( - const std::string &bundleName, const std::string &permissionName, const int userId) override - { - return true; - } /** * @brief Checks whether the publickeys of two bundles are the same. * @param firstBundleName Indicates the first bundle name. @@ -281,77 +266,6 @@ public: * @return Returns 0 if the bundle has the permission; returns -1 otherwise. */ virtual int CheckPermission(const std::string &bundleName, const std::string &permission) override; - /** - * @brief Obtains detailed information about a specified permission. - * @param permissionName Indicates the name of the ohos permission. - * @param permissionDef Indicates the object containing detailed information about the given ohos permission. - * @return Returns true if the PermissionDef object is successfully obtained; returns false otherwise. - */ - virtual bool GetPermissionDef(const std::string &permissionName, PermissionDef &permissionDef) override - { - return true; - } - /** - * @brief Obtains all known permission groups in the system. - * @param permissionDefs Indicates the list of objects containing the permission group information. - * @return Returns true if the PermissionDef objects is successfully obtained; returns false otherwise. - */ - virtual bool GetAllPermissionGroupDefs(std::vector &permissionDefs) override - { - return true; - } - /** - * @brief Obtains all known permission groups in the system. - * @param permissions Indicates the permission array. - * @param appNames Indicates the list of application names that have the specified permissions. - * @return Returns true if the application names is successfully obtained; returns false otherwise. - */ - virtual bool GetAppsGrantedPermissions( - const std::vector &permissions, std::vector &appNames) override - { - return true; - } - /** - * @brief Requests a certain permission from user. - * @param bundleName Indicates the name of the bundle to request permission. - * @param permission Indicates the permission to request permission. - * @param userId Indicates the user id. - * @return Returns true if the permission request successfully; returns false otherwise. - */ - virtual bool RequestPermissionFromUser( - const std::string &bundleName, const std::string &permission, const int userId) override - { - return true; - } - /** - * @brief Registers a callback for listening for permission changes of all UIDs. - * @param callback Indicates the callback method to register. - * @return Returns true if this function is successfully called; returns false otherwise. - */ - virtual bool RegisterAllPermissionsChanged(const sptr &callback) override - { - return true; - } - /** - * @brief Registers a callback for listening for permission changes of specified UIDs. - * @param uids Indicates the list of UIDs whose permission changes will be monitored. - * @param callback Indicates the callback method to register. - * @return Returns true if this function is successfully called; returns false otherwise. - */ - virtual bool RegisterPermissionsChanged( - const std::vector &uids, const sptr &callback) override - { - return true; - } - /** - * @brief Unregisters a specified callback for listening for permission changes. - * @param callback Indicates the callback method to register. - * @return Returns true if this function is successfully called; returns false otherwise. - */ - virtual bool UnregisterPermissionsChanged(const sptr &callback) override - { - return true; - } /** * @brief Obtains the FormInfo objects provided by all applications on the device. * @param formInfo list of FormInfo objects if obtained; returns an empty List if no FormInfo is available on the 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 3e5817f3e8639b0c48b6625580e5737b482f6d2f..b14f555e583664213a5a680bd42d8e7b37e40f91 100644 --- a/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp +++ b/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp @@ -154,22 +154,6 @@ int BundleMgrProxy::CheckPermission(const std::string &bundleName, const std::st return 1; } -bool BundleMgrProxy::GetPermissionDef(const std::string &permissionName, PermissionDef &permissionDef) -{ - return true; -} - -bool BundleMgrProxy::GetAllPermissionGroupDefs(std::vector &permissionDefs) -{ - return true; -} - -bool BundleMgrProxy::GetAppsGrantedPermissions( - const std::vector &permissions, std::vector &appNames) -{ - return true; -} - bool BundleMgrProxy::HasSystemCapability(const std::string &capName) { return true; @@ -225,34 +209,6 @@ std::string BundleMgrProxy::GetAbilityIcon(const std::string &bundleName, const return "AbilityIcon"; } -bool BundleMgrProxy::CanRequestPermission( - const std::string &bundleName, const std::string &permissionName, const int userId) -{ - return true; -} - -bool BundleMgrProxy::RequestPermissionFromUser( - const std::string &bundleName, const std::string &permission, const int userId) -{ - return true; -} - -bool BundleMgrProxy::RegisterAllPermissionsChanged(const sptr &callback) -{ - return true; -} - -bool BundleMgrProxy::RegisterPermissionsChanged( - const std::vector &uids, const sptr &callback) -{ - return true; -} - -bool BundleMgrProxy::UnregisterPermissionsChanged(const sptr &callback) -{ - return true; -} - template bool BundleMgrProxy::GetParcelableInfo(IBundleMgr::Message code, MessageParcel &data, T &parcelableInfo) { diff --git a/services/test/moduletest/mock/include/mock_bundle_manager.h b/services/test/moduletest/mock/include/mock_bundle_manager.h index feedce914e6c444cc7e32db5a597ac1413532035..9319ca2aed5a26de72ef61fe67845f4995c628e3 100644 --- a/services/test/moduletest/mock/include/mock_bundle_manager.h +++ b/services/test/moduletest/mock/include/mock_bundle_manager.h @@ -217,21 +217,6 @@ public: { return true; } - /** - * @brief Confirms with the permission management module to check whether a request prompt is required for granting - * a certain permission. - * @param bundleName Indicates the name of the bundle to check. - * @param permission Indicates the permission to check. - * @param userId Indicates the user id. - * @return Returns true if the current application does not have the permission and the user does not turn off - * further requests; returns false if the current application already has the permission, the permission is rejected - * by the system, or the permission is denied by the user and the user has turned off further requests. - */ - virtual bool CanRequestPermission( - const std::string &bundleName, const std::string &permissionName, const int userId) override - { - return true; - } /** * @brief Checks whether the publickeys of two bundles are the same. * @param firstBundleName Indicates the first bundle name. @@ -251,48 +236,6 @@ public: * @return Returns 0 if the bundle has the permission; returns -1 otherwise. */ virtual int CheckPermission(const std::string &bundleName, const std::string &permission) override; - /** - * @brief Obtains detailed information about a specified permission. - * @param permissionName Indicates the name of the ohos permission. - * @param permissionDef Indicates the object containing detailed information about the given ohos permission. - * @return Returns true if the PermissionDef object is successfully obtained; returns false otherwise. - */ - virtual bool GetPermissionDef(const std::string &permissionName, PermissionDef &permissionDef) override - { - return true; - } - /** - * @brief Obtains all known permission groups in the system. - * @param permissionDefs Indicates the list of objects containing the permission group information. - * @return Returns true if the PermissionDef objects is successfully obtained; returns false otherwise. - */ - virtual bool GetAllPermissionGroupDefs(std::vector &permissionDefs) override - { - return true; - } - /** - * @brief Obtains all known permission groups in the system. - * @param permissions Indicates the permission array. - * @param appNames Indicates the list of application names that have the specified permissions. - * @return Returns true if the application names is successfully obtained; returns false otherwise. - */ - virtual bool GetAppsGrantedPermissions( - const std::vector &permissions, std::vector &appNames) override - { - return true; - } - /** - * @brief Requests a certain permission from user. - * @param bundleName Indicates the name of the bundle to request permission. - * @param permission Indicates the permission to request permission. - * @param userId Indicates the user id. - * @return Returns true if the permission request successfully; returns false otherwise. - */ - virtual bool RequestPermissionFromUser( - const std::string &bundleName, const std::string &permission, const int userId) override - { - return true; - } /** * @brief Checks whether the system has a specified capability. * @param capName Indicates the name of the system feature to check. diff --git a/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp b/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp index f40336c905ff100728728da1c1ae7b9bf6567122..c2ffd71f6bad3926cbc36d80975f9b91f97d5cbd 100644 --- a/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp +++ b/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp @@ -145,22 +145,6 @@ int BundleMgrProxy::CheckPermission(const std::string &bundleName, const std::st return 1; } -bool BundleMgrProxy::GetPermissionDef(const std::string &permissionName, PermissionDef &permissionDef) -{ - return true; -} - -bool BundleMgrProxy::GetAllPermissionGroupDefs(std::vector &permissionDefs) -{ - return true; -} - -bool BundleMgrProxy::GetAppsGrantedPermissions( - const std::vector &permissions, std::vector &appNames) -{ - return true; -} - bool BundleMgrProxy::HasSystemCapability(const std::string &capName) { return true; @@ -218,34 +202,6 @@ std::string BundleMgrProxy::GetAbilityIcon(const std::string &bundleName, const return "AbilityIcon"; } -bool BundleMgrProxy::CanRequestPermission( - const std::string &bundleName, const std::string &permissionName, const int userId) -{ - return true; -} - -bool BundleMgrProxy::RequestPermissionFromUser( - const std::string &bundleName, const std::string &permission, const int userId) -{ - return true; -} - -bool BundleMgrProxy::RegisterAllPermissionsChanged(const sptr &callback) -{ - return true; -} - -bool BundleMgrProxy::RegisterPermissionsChanged( - const std::vector &uids, const sptr &callback) -{ - return true; -} - -bool BundleMgrProxy::UnregisterPermissionsChanged(const sptr &callback) -{ - return true; -} - template bool BundleMgrProxy::GetParcelableInfo(IBundleMgr::Message code, MessageParcel &data, T &parcelableInfo) {