From aceb589d84999b46b3cc216f358e29891390e1ca Mon Sep 17 00:00:00 2001 From: zhouyan Date: Sat, 30 Aug 2025 10:54:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyan Change-Id: I3f4ef673c7e80b83453745d823825e3c1deb0f4f --- .../accesstoken/include/ani_request_permission.h | 6 +++--- .../accesstoken/src/accesstoken_death_recipient.h | 2 +- .../nativetoken/include/nativetoken_json_oper.h | 6 +++--- .../unittest/app_manager_client/app_state_data.h | 2 +- .../accesstoken/include/napi_request_permission.h | 6 +++--- .../include/callback/accesstoken_callback_proxys.h | 2 +- .../include/callback/callback_death_recipients.h | 8 ++++---- .../form_manager/form_manager_death_recipient.h | 2 +- .../form_manager/form_status_change_callback.h | 6 +++--- .../main/cpp/src/permission/permission_manager.cpp | 3 +-- .../include/app_manager_access_client.h | 2 +- .../common/app_manager/include/app_state_data.h | 2 +- .../include/app_status_change_callback.h | 14 +++++++------- services/common/app_manager/include/process_data.h | 2 +- .../background_task_manager_death_recipient.h | 2 +- .../include/continuous_task_change_callback.h | 8 ++++---- .../common/handler/include/access_event_handler.h | 2 +- .../proxy_death/include/proxy_death_recipient.h | 2 +- .../perm_active_status_callback_death_recipient.h | 4 ++-- .../perm_active_status_change_callback_proxy.h | 2 +- .../include/active/state_change_callback_proxy.h | 2 +- .../on_permission_used_record_callback_proxy.h | 2 +- .../src/record/permission_record_manager.cpp | 3 +-- .../include/command/delete_remote_token_command.h | 2 +- .../command/sync_remote_hap_token_command.h | 2 +- .../command/update_remote_hap_token_command.h | 2 +- 26 files changed, 47 insertions(+), 49 deletions(-) diff --git a/frameworks/ets/ani/accesstoken/include/ani_request_permission.h b/frameworks/ets/ani/accesstoken/include/ani_request_permission.h index 6598e1dd7..2e25a8eeb 100644 --- a/frameworks/ets/ani/accesstoken/include/ani_request_permission.h +++ b/frameworks/ets/ani/accesstoken/include/ani_request_permission.h @@ -59,11 +59,11 @@ struct RequestAsyncContext : public RequestAsyncContextBase { class AuthorizationResult : public Security::AccessToken::TokenCallbackStub { public: AuthorizationResult(std::shared_ptr data); - virtual ~AuthorizationResult() override; + ~AuthorizationResult() override; - virtual void GrantResultsCallback( + void GrantResultsCallback( const std::vector& permissionList, const std::vector& grantResults) override; - virtual void WindowShownCallback() override; + void WindowShownCallback() override; private: std::shared_ptr data_ = nullptr; diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.h b/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.h index 2b9e8350c..bf566fdcf 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.h +++ b/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.h @@ -25,7 +25,7 @@ namespace AccessToken { class AccessTokenDeathRecipient : public IRemoteObject::DeathRecipient { public: AccessTokenDeathRecipient() {} - virtual ~AccessTokenDeathRecipient() override = default; + ~AccessTokenDeathRecipient() override = default; void OnRemoteDied(const wptr& object) override; }; } // namespace AccessToken diff --git a/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h b/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h index b696171dc..eb2064509 100644 --- a/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h +++ b/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h @@ -13,13 +13,13 @@ * limitations under the License. */ +#ifndef NATIVETOKEN_JSON_OPER_H +#define NATIVETOKEN_JSON_OPER_H + #include #include "cJSON.h" #include "nativetoken.h" -#ifndef NATIVETOKEN_JSON_OPER_H -#define NATIVETOKEN_JSON_OPER_H - #ifdef __cplusplus extern "C" { #endif diff --git a/interfaces/innerkits/privacy/test/unittest/app_manager_client/app_state_data.h b/interfaces/innerkits/privacy/test/unittest/app_manager_client/app_state_data.h index 3b261d218..817e6cf14 100644 --- a/interfaces/innerkits/privacy/test/unittest/app_manager_client/app_state_data.h +++ b/interfaces/innerkits/privacy/test/unittest/app_manager_client/app_state_data.h @@ -35,7 +35,7 @@ enum class ApplicationState { APP_STATE_END, }; struct AppStateData : public Parcelable { - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; static AppStateData *Unmarshalling(Parcel &parcel); std::string bundleName; diff --git a/interfaces/kits/js/napi/accesstoken/include/napi_request_permission.h b/interfaces/kits/js/napi/accesstoken/include/napi_request_permission.h index 45cd3f390..c351a02cc 100644 --- a/interfaces/kits/js/napi/accesstoken/include/napi_request_permission.h +++ b/interfaces/kits/js/napi/accesstoken/include/napi_request_permission.h @@ -107,11 +107,11 @@ struct ResultCallback { class AuthorizationResult : public Security::AccessToken::TokenCallbackStub { public: AuthorizationResult(std::shared_ptr& data) : data_(data) {} - virtual ~AuthorizationResult() override = default; + ~AuthorizationResult() override = default; - virtual void GrantResultsCallback(const std::vector& permissionList, + void GrantResultsCallback(const std::vector& permissionList, const std::vector& grantResults) override; - virtual void WindowShownCallback() override; + void WindowShownCallback() override; private: std::shared_ptr data_ = nullptr; diff --git a/services/accesstokenmanager/main/cpp/include/callback/accesstoken_callback_proxys.h b/services/accesstokenmanager/main/cpp/include/callback/accesstoken_callback_proxys.h index 50f1c3e95..df4b095a4 100644 --- a/services/accesstokenmanager/main/cpp/include/callback/accesstoken_callback_proxys.h +++ b/services/accesstokenmanager/main/cpp/include/callback/accesstoken_callback_proxys.h @@ -32,7 +32,7 @@ class PermissionStateChangeCallbackProxy : public IRemoteProxy& impl); ~PermissionStateChangeCallbackProxy() override; - virtual void PermStateChangeCallback(PermStateChangeInfo& result) override; + void PermStateChangeCallback(PermStateChangeInfo& result) override; private: static inline BrokerDelegator delegator_; diff --git a/services/accesstokenmanager/main/cpp/include/callback/callback_death_recipients.h b/services/accesstokenmanager/main/cpp/include/callback/callback_death_recipients.h index 93b24b1d2..80d42395d 100644 --- a/services/accesstokenmanager/main/cpp/include/callback/callback_death_recipients.h +++ b/services/accesstokenmanager/main/cpp/include/callback/callback_death_recipients.h @@ -24,18 +24,18 @@ namespace AccessToken { class PermStateCallbackDeathRecipient : public IRemoteObject::DeathRecipient { public: PermStateCallbackDeathRecipient() = default; - virtual ~PermStateCallbackDeathRecipient() override = default; + ~PermStateCallbackDeathRecipient() override = default; - virtual void OnRemoteDied(const wptr& remote) override; + void OnRemoteDied(const wptr& remote) override; }; #ifdef TOKEN_SYNC_ENABLE class TokenSyncCallbackDeathRecipient : public IRemoteObject::DeathRecipient { public: TokenSyncCallbackDeathRecipient() = default; - virtual ~TokenSyncCallbackDeathRecipient() override = default; + ~TokenSyncCallbackDeathRecipient() override = default; - virtual void OnRemoteDied(const wptr& remote) override; + void OnRemoteDied(const wptr& remote) override; }; #endif // TOKEN_SYNC_ENABLE } // namespace AccessToken diff --git a/services/accesstokenmanager/main/cpp/include/form_manager/form_manager_death_recipient.h b/services/accesstokenmanager/main/cpp/include/form_manager/form_manager_death_recipient.h index f04e0b01f..b0bb04bd6 100644 --- a/services/accesstokenmanager/main/cpp/include/form_manager/form_manager_death_recipient.h +++ b/services/accesstokenmanager/main/cpp/include/form_manager/form_manager_death_recipient.h @@ -24,7 +24,7 @@ namespace AccessToken { class FormMgrDeathRecipient : public IRemoteObject::DeathRecipient { public: FormMgrDeathRecipient() {} - virtual ~FormMgrDeathRecipient() override = default; + ~FormMgrDeathRecipient() override = default; void OnRemoteDied(const wptr& object) override; }; } // namespace AccessToken diff --git a/services/accesstokenmanager/main/cpp/include/form_manager/form_status_change_callback.h b/services/accesstokenmanager/main/cpp/include/form_manager/form_status_change_callback.h index f1b01a664..906d0bbb2 100644 --- a/services/accesstokenmanager/main/cpp/include/form_manager/form_status_change_callback.h +++ b/services/accesstokenmanager/main/cpp/include/form_manager/form_status_change_callback.h @@ -26,12 +26,12 @@ namespace AccessToken { class FormStateObserverStub : public IRemoteStub { public: FormStateObserverStub(); - virtual ~FormStateObserverStub() override; + ~FormStateObserverStub() override; - virtual int OnRemoteRequest( + int OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - virtual int32_t NotifyWhetherFormsVisible(const FormVisibilityType visibleType, + int32_t NotifyWhetherFormsVisible(const FormVisibilityType visibleType, const std::string &bundleName, std::vector &formInstances) override { return 0; diff --git a/services/accesstokenmanager/main/cpp/src/permission/permission_manager.cpp b/services/accesstokenmanager/main/cpp/src/permission/permission_manager.cpp index d8c3deda9..e5649507d 100644 --- a/services/accesstokenmanager/main/cpp/src/permission/permission_manager.cpp +++ b/services/accesstokenmanager/main/cpp/src/permission/permission_manager.cpp @@ -758,8 +758,7 @@ void PermissionManager::ScopeToString( copy(tokenIDs.begin(), tokenIDs.end(), std::ostream_iterator(str, ", ")); std::string tokenidStr = str.str(); - std::string permStr; - permStr = accumulate(permList.begin(), permList.end(), std::string(" ")); + std::string permStr = accumulate(permList.begin(), permList.end(), std::string(" ")); LOGI(ATM_DOMAIN, ATM_TAG, "TokenidStr = %{public}s permStr =%{public}s", tokenidStr.c_str(), permStr.c_str()); diff --git a/services/common/app_manager/include/app_manager_access_client.h b/services/common/app_manager/include/app_manager_access_client.h index 2e2bbcdd0..ac175ff34 100644 --- a/services/common/app_manager/include/app_manager_access_client.h +++ b/services/common/app_manager/include/app_manager_access_client.h @@ -50,7 +50,7 @@ private: class AppMgrDeathRecipient : public IRemoteObject::DeathRecipient { public: AppMgrDeathRecipient() {} - virtual ~AppMgrDeathRecipient() override = default; + ~AppMgrDeathRecipient() override = default; void OnRemoteDied(const wptr& object) override; }; diff --git a/services/common/app_manager/include/app_state_data.h b/services/common/app_manager/include/app_state_data.h index 1c0509db2..e9002bb40 100644 --- a/services/common/app_manager/include/app_state_data.h +++ b/services/common/app_manager/include/app_state_data.h @@ -35,7 +35,7 @@ enum class ApplicationState { APP_STATE_END, }; struct AppStateData : public Parcelable { - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; static AppStateData *Unmarshalling(Parcel &parcel); std::string bundleName; diff --git a/services/common/app_manager/include/app_status_change_callback.h b/services/common/app_manager/include/app_status_change_callback.h index 7c442c243..cb374eef2 100644 --- a/services/common/app_manager/include/app_status_change_callback.h +++ b/services/common/app_manager/include/app_status_change_callback.h @@ -59,16 +59,16 @@ public: class ApplicationStateObserverStub : public IRemoteStub { public: ApplicationStateObserverStub(); - virtual ~ApplicationStateObserverStub() override; + ~ApplicationStateObserverStub() override; - virtual int OnRemoteRequest( + int OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - virtual void OnProcessStateChanged(const ProcessData &processData) override {} - virtual void OnProcessDied(const ProcessData &processData) override {} - virtual void OnAppStateChanged(const AppStateData &appStateData) override {} - virtual void OnAppStopped(const AppStateData &appStateData) override {} - virtual void OnAppCacheStateChanged(const AppStateData &appStateData) override {} + void OnProcessStateChanged(const ProcessData &processData) override {} + void OnProcessDied(const ProcessData &processData) override {} + void OnAppStateChanged(const AppStateData &appStateData) override {} + void OnAppStopped(const AppStateData &appStateData) override {} + void OnAppCacheStateChanged(const AppStateData &appStateData) override {} DISALLOW_COPY_AND_MOVE(ApplicationStateObserverStub); private: diff --git a/services/common/app_manager/include/process_data.h b/services/common/app_manager/include/process_data.h index 8193c4706..da60cb744 100644 --- a/services/common/app_manager/include/process_data.h +++ b/services/common/app_manager/include/process_data.h @@ -54,7 +54,7 @@ struct ProcessData : public Parcelable { * * @param outParcel Indicates the Parcel object to which the Sequenceable object will be marshaled. */ - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; /** * @brief Unmarshals this Sequenceable object from a Parcel. diff --git a/services/common/background_task_manager/include/background_task_manager_death_recipient.h b/services/common/background_task_manager/include/background_task_manager_death_recipient.h index 8d3883290..dd24c4f71 100644 --- a/services/common/background_task_manager/include/background_task_manager_death_recipient.h +++ b/services/common/background_task_manager/include/background_task_manager_death_recipient.h @@ -24,7 +24,7 @@ namespace AccessToken { class BackgroundTaskMgrDeathRecipient : public IRemoteObject::DeathRecipient { public: BackgroundTaskMgrDeathRecipient() {} - virtual ~BackgroundTaskMgrDeathRecipient() override = default; + ~BackgroundTaskMgrDeathRecipient() override = default; void OnRemoteDied(const wptr& object) override; }; } // namespace AccessToken diff --git a/services/common/background_task_manager/include/continuous_task_change_callback.h b/services/common/background_task_manager/include/continuous_task_change_callback.h index edff2b0e0..14f6e9ae3 100644 --- a/services/common/background_task_manager/include/continuous_task_change_callback.h +++ b/services/common/background_task_manager/include/continuous_task_change_callback.h @@ -26,15 +26,15 @@ namespace AccessToken { class BackgroundTaskSubscriberStub : public IRemoteStub { public: BackgroundTaskSubscriberStub(); - virtual ~BackgroundTaskSubscriberStub() override; + ~BackgroundTaskSubscriberStub() override; - virtual int OnRemoteRequest( + int OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - virtual void OnContinuousTaskStart( + void OnContinuousTaskStart( const std::shared_ptr &continuousTaskCallbackInfo) override {} - virtual void OnContinuousTaskStop( + void OnContinuousTaskStop( const std::shared_ptr &continuousTaskCallbackInfo) override {} DISALLOW_COPY_AND_MOVE(BackgroundTaskSubscriberStub); diff --git a/services/common/handler/include/access_event_handler.h b/services/common/handler/include/access_event_handler.h index 4fbbbb8e2..c2c4df5cd 100644 --- a/services/common/handler/include/access_event_handler.h +++ b/services/common/handler/include/access_event_handler.h @@ -27,7 +27,7 @@ namespace AccessToken { class AccessEventHandler : public AppExecFwk::EventHandler { public: explicit AccessEventHandler(const std::shared_ptr& runner); - virtual ~AccessEventHandler() override; + ~AccessEventHandler() override; bool ProxyPostTask(const Callback &callback, int64_t delayTime); diff --git a/services/common/proxy_death/include/proxy_death_recipient.h b/services/common/proxy_death/include/proxy_death_recipient.h index 3975a4c42..6895a7937 100644 --- a/services/common/proxy_death/include/proxy_death_recipient.h +++ b/services/common/proxy_death/include/proxy_death_recipient.h @@ -28,7 +28,7 @@ namespace AccessToken { class ProxyDeathRecipient : public IRemoteObject::DeathRecipient { public: ProxyDeathRecipient(ProxyDeathHandler* handler); - virtual ~ProxyDeathRecipient() override = default; + ~ProxyDeathRecipient() override = default; void OnRemoteDied(const wptr& object) override; private: ProxyDeathHandler* handler_ = nullptr; diff --git a/services/privacymanager/include/active/perm_active_status_callback_death_recipient.h b/services/privacymanager/include/active/perm_active_status_callback_death_recipient.h index 5e2bc3185..1a9deef87 100644 --- a/services/privacymanager/include/active/perm_active_status_callback_death_recipient.h +++ b/services/privacymanager/include/active/perm_active_status_callback_death_recipient.h @@ -25,9 +25,9 @@ namespace AccessToken { class PermActiveStatusCallbackDeathRecipient : public IRemoteObject::DeathRecipient { public: PermActiveStatusCallbackDeathRecipient() = default; - virtual ~PermActiveStatusCallbackDeathRecipient() override = default; + ~PermActiveStatusCallbackDeathRecipient() override = default; - virtual void OnRemoteDied(const wptr &remote) override; + void OnRemoteDied(const wptr &remote) override; }; } // namespace AccessToken } // namespace Security diff --git a/services/privacymanager/include/active/perm_active_status_change_callback_proxy.h b/services/privacymanager/include/active/perm_active_status_change_callback_proxy.h index db358c94b..54ddbdfce 100644 --- a/services/privacymanager/include/active/perm_active_status_change_callback_proxy.h +++ b/services/privacymanager/include/active/perm_active_status_change_callback_proxy.h @@ -30,7 +30,7 @@ public: explicit PermActiveStatusChangeCallbackProxy(const sptr& impl); ~PermActiveStatusChangeCallbackProxy() override; - virtual void ActiveStatusChangeCallback(ActiveChangeResponse& result) override; + void ActiveStatusChangeCallback(ActiveChangeResponse& result) override; private: static inline BrokerDelegator delegator_; }; diff --git a/services/privacymanager/include/active/state_change_callback_proxy.h b/services/privacymanager/include/active/state_change_callback_proxy.h index 121f8123d..d1fdc01f9 100644 --- a/services/privacymanager/include/active/state_change_callback_proxy.h +++ b/services/privacymanager/include/active/state_change_callback_proxy.h @@ -29,7 +29,7 @@ public: explicit StateChangeCallbackProxy(const sptr& impl); ~StateChangeCallbackProxy() override; - virtual void StateChangeNotify(AccessTokenID tokenId, bool isShowing) override; + void StateChangeNotify(AccessTokenID tokenId, bool isShowing) override; private: static inline BrokerDelegator delegator_; }; diff --git a/services/privacymanager/include/record/on_permission_used_record_callback_proxy.h b/services/privacymanager/include/record/on_permission_used_record_callback_proxy.h index 3a6975bd0..77e3772c5 100644 --- a/services/privacymanager/include/record/on_permission_used_record_callback_proxy.h +++ b/services/privacymanager/include/record/on_permission_used_record_callback_proxy.h @@ -30,7 +30,7 @@ public: explicit OnPermissionUsedRecordCallbackProxy(const sptr& impl); ~OnPermissionUsedRecordCallbackProxy() override; - virtual void OnQueried(ErrCode code, PermissionUsedResult& result) override; + void OnQueried(ErrCode code, PermissionUsedResult& result) override; private: static inline BrokerDelegator delegator_; }; diff --git a/services/privacymanager/src/record/permission_record_manager.cpp b/services/privacymanager/src/record/permission_record_manager.cpp index b5f090474..1b8e946de 100644 --- a/services/privacymanager/src/record/permission_record_manager.cpp +++ b/services/privacymanager/src/record/permission_record_manager.cpp @@ -1436,8 +1436,7 @@ bool PermissionRecordManager::HasCallerInStartList(int32_t callerPid) void PermissionRecordManager::PermListToString(const std::vector& permList) { - std::string permStr; - permStr = accumulate(permList.begin(), permList.end(), std::string(" ")); + std::string permStr = accumulate(permList.begin(), permList.end(), std::string(" ")); LOGI(PRI_DOMAIN, PRI_TAG, "PermStr =%{public}s.", permStr.c_str()); } diff --git a/services/tokensyncmanager/include/command/delete_remote_token_command.h b/services/tokensyncmanager/include/command/delete_remote_token_command.h index 36b93b342..6628adb0e 100644 --- a/services/tokensyncmanager/include/command/delete_remote_token_command.h +++ b/services/tokensyncmanager/include/command/delete_remote_token_command.h @@ -37,7 +37,7 @@ public: explicit DeleteRemoteTokenCommand(const std::string &json); DeleteRemoteTokenCommand(const std::string &srcDeviceId, const std::string &dstDeviceId, AccessTokenID deleteID); - virtual ~DeleteRemoteTokenCommand() override = default; + ~DeleteRemoteTokenCommand() override = default; private: /** diff --git a/services/tokensyncmanager/include/command/sync_remote_hap_token_command.h b/services/tokensyncmanager/include/command/sync_remote_hap_token_command.h index 90a349d17..8f161f6bf 100644 --- a/services/tokensyncmanager/include/command/sync_remote_hap_token_command.h +++ b/services/tokensyncmanager/include/command/sync_remote_hap_token_command.h @@ -42,7 +42,7 @@ public: explicit SyncRemoteHapTokenCommand(const std::string &json); SyncRemoteHapTokenCommand(const std::string &srcDeviceId, const std::string &dstDeviceId, AccessTokenID id); - virtual ~SyncRemoteHapTokenCommand() override = default; + ~SyncRemoteHapTokenCommand() override = default; private: /** diff --git a/services/tokensyncmanager/include/command/update_remote_hap_token_command.h b/services/tokensyncmanager/include/command/update_remote_hap_token_command.h index f31280c21..e6293ec89 100644 --- a/services/tokensyncmanager/include/command/update_remote_hap_token_command.h +++ b/services/tokensyncmanager/include/command/update_remote_hap_token_command.h @@ -41,7 +41,7 @@ public: explicit UpdateRemoteHapTokenCommand(const std::string &json); UpdateRemoteHapTokenCommand(const std::string &srcDeviceId, const std::string &dstDeviceId, const HapTokenInfoForSync& tokenInfo); - virtual ~UpdateRemoteHapTokenCommand() override = default; + ~UpdateRemoteHapTokenCommand() override = default; private: /** -- Gitee