diff --git a/services/timer/src/timer_manager.cpp b/services/timer/src/timer_manager.cpp index bab911fc634b044823e838b37e8a65f98e0c0657..58fba07dedf51e7434b831b00334a974a42c9455 100644 --- a/services/timer/src/timer_manager.cpp +++ b/services/timer/src/timer_manager.cpp @@ -71,6 +71,7 @@ constexpr int TIMER_ALARM_COUNT = 50; constexpr int MAX_TIMER_ALARM_COUNT = 100; constexpr int TIMER_ALRAM_INTERVAL = 60; constexpr int TIMER_COUNT_TOP_NUM = 5; +const std::string SCHEDULED_POWER_ON_APPS = "persist.time.scheduled_power_on_apps"; static const std::vector ALL_DATA = { "timerId", "type", "flag", "windowLength", "interval", \ "uid", "bundleName", "wantAgent", "state", "triggerTime" }; @@ -870,6 +871,10 @@ void TimerManager::NotifyWantAgentRetry(std::shared_ptr timer) int32_t TimerManager::CheckUserIdForNotify(const std::shared_ptr &timer) { + auto bundleList = TimeFileUtils::GetParameterList(SCHEDULED_POWER_ON_APPS); + if (!bundleList.empty() && timer->bundleName == bundleList[0]) { + return E_TIME_OK; + } int userIdOfTimer = -1; int foregroundUserId = -1; int getLocalIdErr = AccountSA::OsAccountManager::GetOsAccountLocalIdFromUid(timer->uid, userIdOfTimer);