!1143 fix: 适配运行锁场景化Inner接口

Merge pull request !1143 from yangziyong/adapt_native_runninglock
This commit is contained in:
openharmony_ci 2023-03-31 06:27:51 +00:00 committed by Gitee
commit a8cf736963
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 9 additions and 9 deletions

View File

@ -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();
}

View File

@ -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;
}