diff --git a/services/include/sensor_data_processer.h b/services/include/sensor_data_processer.h index a4428b5ac2d68630bd400d3c3afd78874f27fe94..25731815338257c7fb7061b74293640de17efaaa 100755 --- a/services/include/sensor_data_processer.h +++ b/services/include/sensor_data_processer.h @@ -22,9 +22,6 @@ namespace OHOS { namespace Sensors { -namespace { - std::unordered_map sensorMap_; -} class SensorDataProcesser : public RefBase { public: explicit SensorDataProcesser(const std::unordered_map &sensorMap); @@ -52,6 +49,7 @@ private: std::mutex dataCountMutex_; std::unordered_map>> dataCountMap_; std::mutex sensorMutex_; + std::unordered_map sensorMap_; }; } // namespace Sensors } // namespace OHOS diff --git a/services/include/sensor_manager.h b/services/include/sensor_manager.h index dfe51ac989b409d9a6b1f42bc1333387892bb2d4..ab8370e9540947ef95d2ab7096037b9f4e00de7a 100644 --- a/services/include/sensor_manager.h +++ b/services/include/sensor_manager.h @@ -53,6 +53,7 @@ private: sptr reportDataCallback_ = nullptr; #endif // HDF_DRIVERS_INTERFACE_SENSOR ClientInfo &clientInfo_ = ClientInfo::GetInstance(); + std::unordered_map sensorMap_; std::mutex sensorMapMutex_; }; } // namespace Sensors diff --git a/services/include/sensor_service.h b/services/include/sensor_service.h index 5eb177280963c0598f5599dc704f2ffaec593d8d..22b8cedeb409c37bbc23239f7b0c31f702253595 100644 --- a/services/include/sensor_service.h +++ b/services/include/sensor_service.h @@ -93,6 +93,7 @@ private: std::mutex sensorsMutex_; std::mutex sensorMapMutex_; std::vector sensors_; + std::unordered_map sensorMap_; #ifdef HDF_DRIVERS_INTERFACE_SENSOR bool InitInterface(); bool InitDataCallback(); diff --git a/services/src/sensor_service.cpp b/services/src/sensor_service.cpp index 84f939d2c0fdc44dbaff95f82f83f214737e068a..3ede64e3f7517d35aa48ccbae8131532ab945133 100644 --- a/services/src/sensor_service.cpp +++ b/services/src/sensor_service.cpp @@ -29,7 +29,6 @@ #include "permission_util.h" #include "print_sensor_data.h" -#include "sensor_data_processer.h" #include "sensor_dump.h" #include "system_ability_definition.h"