diff --git a/services/common/src/bundle_active_core.cpp b/services/common/src/bundle_active_core.cpp index e31432ea25d5aa605e5c718cfba77a3d5837ccd4..c1fb5476a02322c17f58a8cd5ce88a184cbc4cdf 100644 --- a/services/common/src/bundle_active_core.cpp +++ b/services/common/src/bundle_active_core.cpp @@ -29,6 +29,7 @@ #include "hisysevent.h" #include "bundle_active_report_controller.h" #include "bundle_active_event_reporter.h" +#include "os_account_constants.h" namespace OHOS { namespace DeviceUsageStats { @@ -549,7 +550,7 @@ void BundleActiveCore::OnUserRemoved(const int32_t userId) { BUNDLE_ACTIVE_LOGD("OnUserRemoved called"); std::lock_guard lock(mutex_); - if (MIN_USER_ID > userId || userId > INT32_MAX) { + if (MIN_USER_ID > userId || userId > AccountSA::Constants::MAX_USER_ID) { return; } auto it = userStatServices_.find(userId);