mirror of
https://gitee.com/openharmony/powermgr_power_manager
synced 2024-11-23 15:10:55 +00:00
fix: Screen is off when phone is disconnected
Signed-off-by: wangyantian <wangyantian@huawei.com>
This commit is contained in:
parent
431ba2aefb
commit
16fc848476
@ -179,6 +179,16 @@ void RunningLockMgr::InitLocksTypeProximity()
|
||||
proximityController_.Enable();
|
||||
} else {
|
||||
POWER_HILOGI(FEATURE_RUNNING_LOCK, "[UL_POWER] RUNNINGLOCK_PROXIMITY_SCREEN_CONTROL inactive");
|
||||
auto pms = DelayedSpSingleton<PowerMgrService>::GetInstance();
|
||||
if (pms == nullptr) {
|
||||
return RUNNINGLOCK_FAILURE;
|
||||
}
|
||||
auto stateMachine = pms->GetPowerStateMachine();
|
||||
if (stateMachine == nullptr) {
|
||||
return RUNNINGLOCK_FAILURE;
|
||||
}
|
||||
PreprocessBeforeAwake();
|
||||
stateMachine->SetState(PowerState::AWAKE, StateChangeReason::STATE_CHANGE_REASON_RUNNING_LOCK);
|
||||
proximityController_.Disable();
|
||||
proximityController_.Clear();
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "app_manager_utils.h"
|
||||
|
||||
#include "power_log.h"
|
||||
#include <ability_manager_proxy.h>
|
||||
#include <app_mgr_interface.h>
|
||||
#include <if_system_ability_manager.h>
|
||||
#include <iservice_registry.h>
|
||||
|
Loading…
Reference in New Issue
Block a user