diff --git a/services/sensor/src/sensor_service.cpp b/services/sensor/src/sensor_service.cpp index 97724d87a52b08a74d7656a8553c17880106bdfb..e5ff1bdb31cb0cc1608f2ffb5d8040c33b5158d9 100644 --- a/services/sensor/src/sensor_service.cpp +++ b/services/sensor/src/sensor_service.cpp @@ -86,13 +86,11 @@ void SensorService::OnStart() HiLog::Error(LABEL, "%{public}s Init sensor policy error", __func__); } - bool isPublished = SystemAbility::Publish(this); - if (!isPublished) { + if (!SystemAbility::Publish(this)) { HiLog::Error(LABEL, "%{public}s publish SensorService error", __func__); return; } sensorManager_.InitSensorMap(sensorMap_, sensorDataProcesser_, reportDataCallback_); - state_ = SensorServiceState::STATE_RUNNING; }