From 8929d898d418785cfced7f864f8a21ea3c8e86bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=AC=A3=E5=AE=87?= Date: Wed, 10 Sep 2025 08:59:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=20Disposed=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张欣宇 Change-Id: Ib842d4668768ede2087f934d5c4c9c7cfc99daa8 --- interfaces/kits/js/app_control/js_app_control.cpp | 10 +++++----- services/bundlemgr/include/bundle_common_event_mgr.h | 4 ++-- .../src/app_control/app_control_manager.cpp | 12 ++++++------ services/bundlemgr/src/bundle_common_event_mgr.cpp | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/interfaces/kits/js/app_control/js_app_control.cpp b/interfaces/kits/js/app_control/js_app_control.cpp index 7739bcdf8d..13914110c6 100644 --- a/interfaces/kits/js/app_control/js_app_control.cpp +++ b/interfaces/kits/js/app_control/js_app_control.cpp @@ -504,7 +504,7 @@ void ConvertRuleInfo(napi_env env, napi_value nRule, const DisposedRule &rule) NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, nRule, "priority", nPriority)); } -bool ParseDiposedRule(napi_env env, napi_value nRule, DisposedRule &rule) +bool ParseDisposedRule(napi_env env, napi_value nRule, DisposedRule &rule) { napi_valuetype valueType; NAPI_CALL_BASE(env, napi_typeof(env, nRule, &valueType), false); @@ -626,7 +626,7 @@ bool ParseDisposedRuleConfiguration(napi_env env, napi_value nDisposedRuleConfig napi_get_named_property(env, nDisposedRuleConfiguration, "disposedRule", &prop); DisposedRule disposedRule; - if (!ParseDiposedRule(env, prop, disposedRule)) { + if (!ParseDisposedRule(env, prop, disposedRule)) { APP_LOGE("disposedRule invalid!"); BusinessError::ThrowParameterTypeError(env, ERROR_PARAM_CHECK_ERROR, DISPOSED_RULE, DISPOSED_RULE_TYPE); return false; @@ -791,7 +791,7 @@ napi_value SetDisposedRule(napi_env env, napi_callback_info info) return nullptr; } DisposedRule rule; - if (!ParseDiposedRule(env, args[ARGS_POS_ONE], rule)) { + if (!ParseDisposedRule(env, args[ARGS_POS_ONE], rule)) { APP_LOGE("rule invalid!"); BusinessError::ThrowParameterTypeError(env, ERROR_PARAM_CHECK_ERROR, DISPOSED_RULE, DISPOSED_RULE_TYPE); return nRet; @@ -867,7 +867,7 @@ void ConvertRuleInfo(napi_env env, napi_value nRule, const UninstallDisposedRule } -bool ParseUninstallDiposedRule(napi_env env, napi_value nRule, UninstallDisposedRule &rule) +bool ParseUninstallDisposedRule(napi_env env, napi_value nRule, UninstallDisposedRule &rule) { napi_valuetype valueType; NAPI_CALL_BASE(env, napi_typeof(env, nRule, &valueType), false); @@ -1017,7 +1017,7 @@ napi_value SetUninstallDisposedRule(napi_env env, napi_callback_info info) return nullptr; } UninstallDisposedRule rule; - if (!ParseUninstallDiposedRule(env, args[ARGS_POS_ONE], rule)) { + if (!ParseUninstallDisposedRule(env, args[ARGS_POS_ONE], rule)) { APP_LOGE("rule invalid!"); BusinessError::ThrowParameterTypeError(env, ERROR_PARAM_CHECK_ERROR, UNINSTALL_DISPOSED_RULE, UNINSTALL_DISPOSED_RULE_TYPE); diff --git a/services/bundlemgr/include/bundle_common_event_mgr.h b/services/bundlemgr/include/bundle_common_event_mgr.h index 70f20680e0..c58adca7a0 100755 --- a/services/bundlemgr/include/bundle_common_event_mgr.h +++ b/services/bundlemgr/include/bundle_common_event_mgr.h @@ -86,8 +86,8 @@ public: const SandboxInstallType &type); void NotifyOverlayModuleStateStatus(const std::string &bundleName, const std::string &moduleName, bool isEnabled, int32_t userId, int32_t uid); - void NotifySetDiposedRule(const std::string &appId, int32_t userId, const std::string &data, int32_t appIndex); - void NotifyDeleteDiposedRule(const std::string &appId, int32_t userId, int32_t appIndex); + void NotifySetDisposedRule(const std::string &appId, int32_t userId, const std::string &data, int32_t appIndex); + void NotifyDeleteDisposedRule(const std::string &appId, int32_t userId, int32_t appIndex); void NotifyDynamicIconEvent( const std::string &bundleName, bool isEnableDynamicIcon, int32_t userId, int32_t appIndex); void NotifyBundleResourcesChanged(const int32_t userId, const uint32_t type); diff --git a/services/bundlemgr/src/app_control/app_control_manager.cpp b/services/bundlemgr/src/app_control/app_control_manager.cpp index 44ba8246cf..0dac9e6360 100644 --- a/services/bundlemgr/src/app_control/app_control_manager.cpp +++ b/services/bundlemgr/src/app_control/app_control_manager.cpp @@ -335,7 +335,7 @@ ErrCode AppControlManager::SetDisposedStatus(const std::string &appId, const Wan appRunningControlRuleResult_.erase(iter); } - commonEventMgr_->NotifySetDiposedRule(appId, userId, want.ToString(), Constants::MAIN_APP_INDEX); + commonEventMgr_->NotifySetDisposedRule(appId, userId, want.ToString(), Constants::MAIN_APP_INDEX); return ERR_OK; } @@ -352,7 +352,7 @@ ErrCode AppControlManager::DeleteDisposedStatus(const std::string &appId, int32_ if (iter != appRunningControlRuleResult_.end()) { appRunningControlRuleResult_.erase(iter); } - commonEventMgr_->NotifyDeleteDiposedRule(appId, userId, Constants::MAIN_APP_INDEX); + commonEventMgr_->NotifyDeleteDisposedRule(appId, userId, Constants::MAIN_APP_INDEX); return ERR_OK; } @@ -554,7 +554,7 @@ ErrCode AppControlManager::SetDisposedRule(const std::string &callerName, const DeleteAbilityRunningRuleCache({ appIdKey, transformedAppIdKey }); LOG_D(BMS_TAG_DEFAULT, "%{public}s set rule, user:%{public}d index:%{public}d", callerName.c_str(), userId, appIndex); - commonEventMgr_->NotifySetDiposedRule(appId, userId, rule.ToString(), appIndex); + commonEventMgr_->NotifySetDisposedRule(appId, userId, rule.ToString(), appIndex); return ERR_OK; } @@ -587,7 +587,7 @@ ErrCode AppControlManager::DeleteDisposedRule( std::string appIdKey = GenerateAppRunningRuleCacheKey(appId, userId, appIndex); std::string transformedAppIdKey = GenerateAppRunningRuleCacheKey(transformedAppId, userId, appIndex); DeleteAbilityRunningRuleCache({ appIdKey, transformedAppIdKey}); - commonEventMgr_->NotifyDeleteDiposedRule(appId, userId, appIndex); + commonEventMgr_->NotifyDeleteDisposedRule(appId, userId, appIndex); return ERR_OK; } @@ -610,7 +610,7 @@ ErrCode AppControlManager::DeleteAllDisposedRuleByBundle(const InnerBundleInfo & key = key + std::string("_"); std::string cacheKey = key + std::to_string(appIndex); DeleteAbilityRunningRuleCache({ cacheKey }); - commonEventMgr_->NotifyDeleteDiposedRule(appId, userId, appIndex); + commonEventMgr_->NotifyDeleteDisposedRule(appId, userId, appIndex); if (appIndex != Constants::MAIN_APP_INDEX) { return ERR_OK; } @@ -625,7 +625,7 @@ ErrCode AppControlManager::DeleteAllDisposedRuleByBundle(const InnerBundleInfo & for (const int32_t index : appIndexVec) { std::string ruleCacheKey = key + std::to_string(index); DeleteAbilityRunningRuleCache({ ruleCacheKey }); - commonEventMgr_->NotifyDeleteDiposedRule(appId, userId, index); + commonEventMgr_->NotifyDeleteDisposedRule(appId, userId, index); } return ERR_OK; } diff --git a/services/bundlemgr/src/bundle_common_event_mgr.cpp b/services/bundlemgr/src/bundle_common_event_mgr.cpp index 602fb6d4f3..338921e460 100755 --- a/services/bundlemgr/src/bundle_common_event_mgr.cpp +++ b/services/bundlemgr/src/bundle_common_event_mgr.cpp @@ -329,7 +329,7 @@ std::string BundleCommonEventMgr::GetCommonEventData(const NotifyType &type) return iter->second; } -void BundleCommonEventMgr::NotifySetDiposedRule( +void BundleCommonEventMgr::NotifySetDisposedRule( const std::string &appId, int32_t userId, const std::string &data, int32_t appIndex) { OHOS::AAFwk::Want want; @@ -349,7 +349,7 @@ void BundleCommonEventMgr::NotifySetDiposedRule( IPCSkeleton::SetCallingIdentity(identity); } -void BundleCommonEventMgr::NotifyDeleteDiposedRule(const std::string &appId, int32_t userId, int32_t appIndex) +void BundleCommonEventMgr::NotifyDeleteDisposedRule(const std::string &appId, int32_t userId, int32_t appIndex) { OHOS::AAFwk::Want want; want.SetAction(DISPOSED_RULE_DELETED); -- Gitee