From f4d14ec9b3fe47919ffb80a25c00c92a15ed8072 Mon Sep 17 00:00:00 2001 From: yanghang Date: Thu, 3 Jul 2025 16:07:50 +0800 Subject: [PATCH] fix: Delete the logic of releasing the lock and lighting up the screen Signed-off-by: yanghang --- services/native/src/runninglock/running_lock_mgr.cpp | 1 - test/unittest/src/power_coordination_lock_test.cpp | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/services/native/src/runninglock/running_lock_mgr.cpp b/services/native/src/runninglock/running_lock_mgr.cpp index 4fa39039..504c05a2 100644 --- a/services/native/src/runninglock/running_lock_mgr.cpp +++ b/services/native/src/runninglock/running_lock_mgr.cpp @@ -263,7 +263,6 @@ void RunningLockMgr::InitLocksTypeCoordination() } else { stateAction->SetCoordinated(false); result = counter->Decrease(backgroundLockParam); - AsyncWakeup(); } return result; }) diff --git a/test/unittest/src/power_coordination_lock_test.cpp b/test/unittest/src/power_coordination_lock_test.cpp index f56c1ddc..192415c1 100644 --- a/test/unittest/src/power_coordination_lock_test.cpp +++ b/test/unittest/src/power_coordination_lock_test.cpp @@ -400,15 +400,11 @@ HWTEST_F (PowerCoordinationLockTest, PowerCoordinationLockTest_006, TestSize.Lev EXPECT_FALSE(g_screenOffEvent); EXPECT_FALSE(g_inactiveCallback); - EXPECT_TRUE(powerMgrClient.IsScreenOn()); - EXPECT_EQ(powerMgrClient.GetState(), PowerState::AWAKE); powerMgrClient.LockScreenAfterTimingOut(true, false, true); powerMgrClient.SuspendDevice(); usleep(WAIT_AUTO_SUSPEND_SLEEP_TIME_MS * US_PER_MS); - EXPECT_TRUE(g_screenOffEvent); - EXPECT_TRUE(g_inactiveCallback); EXPECT_FALSE(powerMgrClient.IsScreenOn()); EXPECT_EQ(powerMgrClient.GetState(), PowerState::SLEEP); @@ -461,8 +457,6 @@ HWTEST_F (PowerCoordinationLockTest, PowerCoordinationLockTest_007, TestSize.Lev EXPECT_FALSE(g_screenOffEvent); EXPECT_FALSE(g_inactiveCallback); - EXPECT_TRUE(powerMgrClient.IsScreenOn()); - EXPECT_EQ(powerMgrClient.GetState(), PowerState::AWAKE); powerMgrClient.LockScreenAfterTimingOut(true, false, true); CommonEventManager::UnSubscribeCommonEvent(subscriber); @@ -576,8 +570,6 @@ HWTEST_F (PowerCoordinationLockTest, PowerCoordinationLockTest_009, TestSize.Lev EXPECT_FALSE(g_screenOffEvent); EXPECT_FALSE(g_inactiveCallback); - EXPECT_TRUE(powerMgrClient.IsScreenOn()); - EXPECT_EQ(powerMgrClient.GetState(), PowerState::AWAKE); powerMgrClient.LockScreenAfterTimingOut(true, false, true); CommonEventManager::UnSubscribeCommonEvent(subscriber); @@ -629,8 +621,6 @@ HWTEST_F (PowerCoordinationLockTest, PowerCoordinationLockTest_010, TestSize.Lev EXPECT_FALSE(g_screenOffEvent); EXPECT_FALSE(g_inactiveCallback); - EXPECT_TRUE(powerMgrClient.IsScreenOn()); - EXPECT_EQ(powerMgrClient.GetState(), PowerState::AWAKE); powerMgrClient.LockScreenAfterTimingOut(true, false, true); CommonEventManager::UnSubscribeCommonEvent(subscriber); -- Gitee