mirror of
https://gitee.com/openharmony/telephony_core_service
synced 2024-11-23 16:09:48 +00:00
!1143 fix: 适配运行锁场景化Inner接口
Merge pull request !1143 from yangziyong/adapt_native_runninglock
This commit is contained in:
commit
a8cf736963
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (C) 2021-2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -171,7 +171,7 @@ void NitzUpdate::ProcessTime(NetworkTime &networkTime)
|
||||
}
|
||||
|
||||
auto &powerMgrClient = PowerMgrClient::GetInstance();
|
||||
auto runningLock = powerMgrClient.CreateRunningLock("runninglock", RunningLockType::RUNNINGLOCK_BACKGROUND);
|
||||
auto runningLock = powerMgrClient.CreateRunningLock("runninglock", RunningLockType::RUNNINGLOCK_BACKGROUND_PHONE);
|
||||
if (runningLock != nullptr) {
|
||||
runningLock->Lock();
|
||||
}
|
||||
@ -290,7 +290,7 @@ void NitzUpdate::SaveTime(int64_t networkTime)
|
||||
{
|
||||
TELEPHONY_LOGI("NitzUpdate::SaveTime networkTime:(%{public}" PRId64 ") slotId:%{public}d", networkTime, slotId_);
|
||||
auto &powerMgrClient = PowerMgrClient::GetInstance();
|
||||
auto runningLock = powerMgrClient.CreateRunningLock("runninglock", RunningLockType::RUNNINGLOCK_BACKGROUND);
|
||||
auto runningLock = powerMgrClient.CreateRunningLock("runninglock", RunningLockType::RUNNINGLOCK_BACKGROUND_PHONE);
|
||||
if (runningLock != nullptr) {
|
||||
runningLock->Lock();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Huawei Device Co., Ltd.
|
||||
* Copyright (C) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -52,10 +52,10 @@ void TelRilHandler::ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event)
|
||||
void TelRilHandler::OnInit(void)
|
||||
{
|
||||
auto &powerMgrClient = PowerMgr::PowerMgrClient::GetInstance();
|
||||
ackRunningLock_ =
|
||||
powerMgrClient.CreateRunningLock("telRilAckRunningLock", PowerMgr::RunningLockType::RUNNINGLOCK_BACKGROUND);
|
||||
ackRunningLock_ = powerMgrClient.CreateRunningLock(
|
||||
"telRilAckRunningLock", PowerMgr::RunningLockType::RUNNINGLOCK_BACKGROUND_PHONE);
|
||||
reqRunningLock_ = powerMgrClient.CreateRunningLock(
|
||||
"telRilRequestRunningLock", PowerMgr::RunningLockType::RUNNINGLOCK_BACKGROUND);
|
||||
"telRilRequestRunningLock", PowerMgr::RunningLockType::RUNNINGLOCK_BACKGROUND_PHONE);
|
||||
reqRunningLockCount_ = 0;
|
||||
reqLockSerialNum_ = 0;
|
||||
ackLockSerialNum_ = 0;
|
||||
@ -66,13 +66,13 @@ void TelRilHandler::ApplyRunningLock(int32_t lockType)
|
||||
if (ackRunningLock_ == nullptr) {
|
||||
auto &powerMgrClient = PowerMgr::PowerMgrClient::GetInstance();
|
||||
ackRunningLock_ = powerMgrClient.CreateRunningLock(
|
||||
"telRilAckRunningLock", PowerMgr::RunningLockType::RUNNINGLOCK_BACKGROUND);
|
||||
"telRilAckRunningLock", PowerMgr::RunningLockType::RUNNINGLOCK_BACKGROUND_PHONE);
|
||||
ackLockSerialNum_ = 0;
|
||||
}
|
||||
if (reqRunningLock_ == nullptr) {
|
||||
auto &powerMgrClient = PowerMgr::PowerMgrClient::GetInstance();
|
||||
reqRunningLock_ = powerMgrClient.CreateRunningLock(
|
||||
"telRilRequestRunningLock", PowerMgr::RunningLockType::RUNNINGLOCK_BACKGROUND);
|
||||
"telRilRequestRunningLock", PowerMgr::RunningLockType::RUNNINGLOCK_BACKGROUND_PHONE);
|
||||
reqRunningLockCount_ = 0;
|
||||
reqLockSerialNum_ = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user