mirror of
https://gitee.com/openharmony/sensors_sensor
synced 2024-12-04 04:31:52 +00:00
commit
7f8b5b183a
@ -118,11 +118,13 @@ public:
|
||||
if (asyncWork != nullptr) {
|
||||
SEN_HILOGD("Delete async work");
|
||||
napi_delete_async_work(env, asyncWork);
|
||||
asyncWork = nullptr;
|
||||
}
|
||||
for (int32_t i = 0; i < CALLBACK_NUM; ++i) {
|
||||
if (callback[i] != nullptr) {
|
||||
SEN_HILOGD("Delete reference, i:%{public}d", i);
|
||||
napi_delete_reference(env, callback[i]);
|
||||
callback[i] = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ ErrCode SensorPowerPolicy::SuspendSensors(int32_t pid)
|
||||
CALL_LOG_ENTER;
|
||||
std::vector<int32_t> sensorIdList = clientInfo_.GetSensorIdByPid(pid);
|
||||
if (sensorIdList.empty()) {
|
||||
SEN_HILOGI("Suspend sensors failed, sensorIdList is empty, pid:%{public}d", pid);
|
||||
SEN_HILOGD("Suspend sensors failed, sensorIdList is empty, pid:%{public}d", pid);
|
||||
return SUSPEND_ERR;
|
||||
}
|
||||
std::lock_guard<std::mutex> pidSensorInfoLock(pidSensorInfoMutex_);
|
||||
@ -107,7 +107,7 @@ ErrCode SensorPowerPolicy::ResumeSensors(int32_t pid)
|
||||
std::lock_guard<std::mutex> pidSensorInfoLock(pidSensorInfoMutex_);
|
||||
auto pidSensorInfoIt = pidSensorInfoMap_.find(pid);
|
||||
if (pidSensorInfoIt == pidSensorInfoMap_.end()) {
|
||||
SEN_HILOGI("Resume sensors failed, please suspend sensors first, pid:%{public}d", pid);
|
||||
SEN_HILOGD("Resume sensors failed, please suspend sensors first, pid:%{public}d", pid);
|
||||
return RESUME_ERR;
|
||||
}
|
||||
bool isAllResume = true;
|
||||
|
Loading…
Reference in New Issue
Block a user