diff --git a/services/ans/src/advanced_notification_manager/advanced_notification_publish.cpp b/services/ans/src/advanced_notification_manager/advanced_notification_publish.cpp index 68e3648b9b84cb4fdacc5bd0d8d871c4ee0c094d..326aa7cd2b0cf87e8042b386dd806873e82cb3e6 100644 --- a/services/ans/src/advanced_notification_manager/advanced_notification_publish.cpp +++ b/services/ans/src/advanced_notification_manager/advanced_notification_publish.cpp @@ -398,11 +398,15 @@ ErrCode AdvancedNotificationService::CheckNotificationRequest(const sptrGetRemovalWantAgent(); const auto isLocalWantAgent = (wantAgent != nullptr && wantAgent->IsLocal()) || (removalWantAgent != nullptr && removalWantAgent->IsLocal()); - bool isSpecifiedAccess = (isSystemApp || isSubsystem) && isAgentController; - if (isLocalWantAgent && !isSpecifiedAccess) { - ANSR_LOGE("Local wantAgent does not support non system app"); + if (isLocalWantAgent && !(isSystemApp || isSubsystem)) { + ANS_LOGE("Local wantAgent does not support non system app"); return ERR_ANS_NON_SYSTEM_APP; } + + if (isLocalWantAgent && !isAgentController) { + ANS_LOGE("Local wantAgent does not support permission denied"); + return ERR_ANS_PERMISSION_DENIED; + } return ERR_OK; } diff --git a/tools/dump/BUILD.gn b/tools/dump/BUILD.gn index b0e46a0e091526683043e2621dbd594fdab15905..2c8b22c4a53fc1a108245c70748ea8227ca2e266 100644 --- a/tools/dump/BUILD.gn +++ b/tools/dump/BUILD.gn @@ -71,7 +71,7 @@ ohos_executable("anm") { install_enable = false if (build_variant == "root") { - install_enable = false + install_enable = true } part_name = "${component_name}"