diff --git a/services/native/src/power_mgr_service.cpp b/services/native/src/power_mgr_service.cpp index 6736045758c5c9d552cecd4a26126bf07edc3394..34a01f21d50738f8987a9477754d828ba60cb8ea 100644 --- a/services/native/src/power_mgr_service.cpp +++ b/services/native/src/power_mgr_service.cpp @@ -476,12 +476,17 @@ void PowerMgrService::HallSensorCallback(SensorEvent* event) auto status = static_cast(data->status); if (status & LID_CLOSED_HALL_FLAG) { + if (isInLidMode_) { + POWER_HILOGI(FEATURE_SUSPEND, "[UL_POWER] Lid close event received again"); + return; + } POWER_HILOGI(FEATURE_SUSPEND, "[UL_POWER] Lid close event received, begin to suspend"); isInLidMode_ = true; SuspendDeviceType reason = SuspendDeviceType::SUSPEND_DEVICE_REASON_LID; suspendController->ExecSuspendMonitorByReason(reason); } else { if (!isInLidMode_) { + POWER_HILOGI(FEATURE_SUSPEND, "[UL_POWER] Lid open event received again"); return; } POWER_HILOGI(FEATURE_WAKEUP, "[UL_POWER] Lid open event received, begin to wakeup");