diff --git a/services/native/src/power_mgr_service.cpp b/services/native/src/power_mgr_service.cpp index 002f82a1307b76bf5b489fb27c5a899f622fe741..ae31009584d8cdd1bb21df68a11d0ba299eccde8 100644 --- a/services/native/src/power_mgr_service.cpp +++ b/services/native/src/power_mgr_service.cpp @@ -1275,6 +1275,11 @@ PowerErrors PowerMgrService::Hibernate(bool clearMemory, const std::string& reas POWER_HILOGI(FEATURE_SUSPEND, "System is shutting down, can't hibernate"); return PowerErrors::ERR_FAILURE; } + if (started_) { + POWER_HILOGI(FEATURE_SUSPEND, "System is hibernating, can't hibernate"); + return PowerErrors::ERR_FAILURE; + } + started_ = true; POWER_HILOGI(FEATURE_SUSPEND, "[UL_POWER] Try to hibernate, pid: %{public}d, uid: %{public}d, clearMemory: %{public}d, reason: %{public}s", pid, uid, static_cast(clearMemory), reason.c_str());