diff --git a/frameworks/native/src/sensor_data_channel.cpp b/frameworks/native/src/sensor_data_channel.cpp index c54732956172a1599a34d6c7a71a8dc480497bfc..141ee803255a90b666b1218a31aa8666a0b65ca7 100644 --- a/frameworks/native/src/sensor_data_channel.cpp +++ b/frameworks/native/src/sensor_data_channel.cpp @@ -27,6 +27,9 @@ namespace OHOS { namespace Sensors { using namespace OHOS::HiviewDFX; using namespace OHOS::AppExecFwk; +namespace { +const std::string LISTENER_THREAD_NAME = "OS_SenConsumer"; +} // namespace int32_t SensorDataChannel::CreateSensorDataChannel(DataChannelCB callBack, void *data) { @@ -58,7 +61,7 @@ int32_t SensorDataChannel::InnerSensorDataChannel() auto listener = std::make_shared(); listener->SetChannel(this); if (eventHandler_ == nullptr) { - auto myRunner = AppExecFwk::EventRunner::Create(true, AppExecFwk::ThreadMode::FFRT); + auto myRunner = AppExecFwk::EventRunner::Create(LISTENER_THREAD_NAME); CHKPR(myRunner, ERROR); eventHandler_ = std::make_shared(myRunner); } @@ -94,7 +97,7 @@ int32_t SensorDataChannel::AddFdListener(int32_t fd, ReceiveMessageFun receiveMe disconnect_ = disconnect; std::lock_guard eventRunnerLock(eventRunnerMutex_); if (eventHandler_ == nullptr) { - auto myRunner = AppExecFwk::EventRunner::Create(true, AppExecFwk::ThreadMode::FFRT); + auto myRunner = AppExecFwk::EventRunner::Create(LISTENER_THREAD_NAME); CHKPR(myRunner, ERROR); eventHandler_ = std::make_shared(myRunner); } diff --git a/services/hdi_connection/adapter/src/hdi_connection.cpp b/services/hdi_connection/adapter/src/hdi_connection.cpp index cd10fc40afca399c360f8ca8629748b70ae444e6..977697dd6ac59848c8cad19142eacfcf46d418d9 100644 --- a/services/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/hdi_connection/adapter/src/hdi_connection.cpp @@ -40,7 +40,7 @@ sptr g_sensorInterface = nullptr; sptr g_eventCallback = nullptr; std::map g_sensorBasicInfoMap; std::mutex g_sensorBasicInfoMutex; -constexpr int32_t GET_HDI_SERVICE_COUNT = 5; +constexpr int32_t GET_HDI_SERVICE_COUNT = 25; constexpr uint32_t WAIT_MS = 200; constexpr int32_t HEADPOSTURE_FIFO_COUNT = 5; } // namespace