From 81894edd47e5855bb2937eea7688c52f34efb2b8 Mon Sep 17 00:00:00 2001 From: maan4 Date: Mon, 24 Feb 2025 09:24:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E5=B1=8F=E5=BC=82=E5=B8=B8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: maan4 --- frameworks/native/src/sensor_service_client.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frameworks/native/src/sensor_service_client.cpp b/frameworks/native/src/sensor_service_client.cpp index 0397d053..67be234b 100644 --- a/frameworks/native/src/sensor_service_client.cpp +++ b/frameworks/native/src/sensor_service_client.cpp @@ -280,8 +280,10 @@ void SensorServiceClient::ProcessDeathObserver(const wptr &object } else { SEN_HILOGI("dataChannel_ is not nullptr"); dataChannel_->DestroySensorDataChannel(); - dataChannel_->RestoreSensorDataChannel(); - SENSOR_AGENT_IMPL->SetIsChannelCreated(true); + int32_t ret = dataChannel_->RestoreSensorDataChannel(); + if (ret == ERR_OK) { + SENSOR_AGENT_IMPL->SetIsChannelCreated(true); + } { std::lock_guard clientLock(clientMutex_); sensorServer_ = nullptr; -- Gitee