From 528d8a5f669c0ebd2b973a6f63c8a3090020153a Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Sat, 26 Mar 2022 10:15:13 +0800 Subject: [PATCH] IssueNo: #I4ZIYS: delete permission related interfaces Description: delete permission related interfaces Sig: SIG_ApplicaitonFramework Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: SoftSquirrel --- .../mock/include/mock_bundle_manager.h | 86 ------------------- .../moduletest/mock/mock_bundle_mgr_proxy.cpp | 44 ---------- .../mock/include/mock_bundle_manager.h | 57 ------------ .../moduletest/mock/mock_bundle_mgr_proxy.cpp | 44 ---------- 4 files changed, 231 deletions(-) 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 3f04edd54..1dcc07252 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 3e5817f3e..b14f555e5 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 feedce914..9319ca2ae 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 f40336c90..c2ffd71f6 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) { -- Gitee