diff --git a/frameworks/cj/BUILD.gn b/frameworks/cj/BUILD.gn index 7198ec1e84cdd511b201ce480d383b2af95e345a..af43f0f632b78976cd5993ae98bce0e9d42d5bb5 100644 --- a/frameworks/cj/BUILD.gn +++ b/frameworks/cj/BUILD.gn @@ -43,9 +43,7 @@ ohos_shared_library("cj_sensor_ffi") { deps = [ "$SUBSYSTEM_DIR/frameworks/native:sensor_interface_native" ] external_deps = [ - "c_utils:utils", "hilog:libhilog", - "napi:cj_bind_ffi", "napi:cj_bind_native", ] diff --git a/frameworks/cj/include/cj_sensor_ffi.h b/frameworks/cj/include/cj_sensor_ffi.h index 7296d13460992145afeadc66f35b3785b16821fd..c3f1cae2edc82f34856251290747da5e6c7cb92a 100644 --- a/frameworks/cj/include/cj_sensor_ffi.h +++ b/frameworks/cj/include/cj_sensor_ffi.h @@ -16,8 +16,6 @@ #ifndef OHOS_CJ_SENSOR_FFI_H #define OHOS_CJ_SENSOR_FFI_H -#include - #include "cj_sensor_visibility.h" #include "sensor_agent_type.h" diff --git a/frameworks/cj/src/cj_sensor_impl.cpp b/frameworks/cj/src/cj_sensor_impl.cpp index 5b8d50c7653edfa94c5b5bead59ba281665af172..ae5739b78759580ff7a6aced4116747e6a14881c 100644 --- a/frameworks/cj/src/cj_sensor_impl.cpp +++ b/frameworks/cj/src/cj_sensor_impl.cpp @@ -15,13 +15,7 @@ #include "cj_sensor_impl.h" -#include -#include -#include - #include "cj_lambda.h" -#include "cj_sensor_ffi.h" -#include "errors.h" #include "geomagnetic_field.h" #include "sensor_agent.h" #include "sensor_algorithm.h" diff --git a/frameworks/js/napi/BUILD.gn b/frameworks/js/napi/BUILD.gn index dbbfda132ef0b13ef30b25228a55e07123133df8..7fde7b06be299fd86a6758fa692fb50a3e7181c7 100644 --- a/frameworks/js/napi/BUILD.gn +++ b/frameworks/js/napi/BUILD.gn @@ -37,10 +37,7 @@ ohos_shared_library("libsensor") { cfi_cross_dso = true debug = false } - deps = [ - "$SUBSYSTEM_DIR/frameworks/native:sensor_interface_native", - "$SUBSYSTEM_DIR/utils/common:libsensor_utils", - ] + deps = [ "$SUBSYSTEM_DIR/frameworks/native:sensor_interface_native" ] external_deps = [ "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", @@ -48,8 +45,6 @@ ohos_shared_library("libsensor") { "hilog:libhilog", "ipc:ipc_single", "napi:ace_napi", - "safwk:system_ability_fwk", - "samgr:samgr_proxy", ] relative_install_dir = "module" part_name = "sensor" diff --git a/frameworks/native/BUILD.gn b/frameworks/native/BUILD.gn index 097d94fd466925195060615ca0adad45982a3cff..5b048b1b2505e73ba7debfbd6a65e7474df2c870 100644 --- a/frameworks/native/BUILD.gn +++ b/frameworks/native/BUILD.gn @@ -143,17 +143,13 @@ ohos_shared_library("sensor_interface_native") { ubsan = true } - deps = [ - "$SUBSYSTEM_DIR/frameworks/native:libsensor_client", - "$SUBSYSTEM_DIR/frameworks/native:libsensor_ndk", - ] + deps = [ "$SUBSYSTEM_DIR/frameworks/native:libsensor_client" ] external_deps = [ "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", "ipc:ipc_single", - "safwk:system_ability_fwk", ] part_name = "sensor" @@ -182,7 +178,6 @@ ohos_shared_library("ohsensor") { deps = [ "$SUBSYSTEM_DIR/frameworks/native:libsensor_client", - "$SUBSYSTEM_DIR/frameworks/native:libsensor_ndk", "$SUBSYSTEM_DIR/frameworks/native:sensor_interface_native", "$SUBSYSTEM_DIR/utils/ipc:libsensor_ipc", ] @@ -192,7 +187,6 @@ ohos_shared_library("ohsensor") { "eventhandler:libeventhandler", "hilog:libhilog", "ipc:ipc_single", - "safwk:system_ability_fwk", ] relative_install_dir = "ndk" diff --git a/frameworks/native/include/fd_listener.h b/frameworks/native/include/fd_listener.h index 7c4424d8d9e457e32319c0778b99dee6fe495464..d1d61df6a491e8183d40a30c066e8676593c7a2a 100644 --- a/frameworks/native/include/fd_listener.h +++ b/frameworks/native/include/fd_listener.h @@ -16,8 +16,6 @@ #ifndef FD_LISTENER_H #define FD_LISTENER_H -#include "file_descriptor_listener.h" - #include "sensor_data_channel.h" namespace OHOS { @@ -28,7 +26,6 @@ public: ~FdListener() = default; void OnReadable(int32_t fd) override; void OnShutdown(int32_t fd) override; - void OnException(int32_t fd) override; void SetChannel(SensorDataChannel *channel); DISALLOW_COPY_AND_MOVE(FdListener); diff --git a/frameworks/native/include/geomagnetic_field.h b/frameworks/native/include/geomagnetic_field.h index 1c3dd4c136427e05a7eda15da657b51398a26448..d09501358f7ea50643847fb568a2a355cb68c663 100644 --- a/frameworks/native/include/geomagnetic_field.h +++ b/frameworks/native/include/geomagnetic_field.h @@ -16,7 +16,6 @@ #ifndef GEOMAGNETIC_FIELD_H #define GEOMAGNETIC_FIELD_H -#include #include class GeomagneticField { diff --git a/frameworks/native/include/sensor_agent_proxy.h b/frameworks/native/include/sensor_agent_proxy.h index e1e44219eee990a7ff0b6427dfed8b29bc7bb479..58e8bd1f5ff5d0d2be2c815839a6694491ccc6d2 100644 --- a/frameworks/native/include/sensor_agent_proxy.h +++ b/frameworks/native/include/sensor_agent_proxy.h @@ -16,14 +16,10 @@ #ifndef SENSOR_PROXY_H #define SENSOR_PROXY_H -#include -#include #include #include -#include "refbase.h" #include "singleton.h" -#include "sensor_agent_type.h" #include "sensor_data_channel.h" namespace OHOS { diff --git a/frameworks/native/include/sensor_algorithm.h b/frameworks/native/include/sensor_algorithm.h index 83bee7e20faa3b084731e07ce13bdc95429ebf33..a3143dadccfaddd3f0fdafd0860306d36cbdb11c 100644 --- a/frameworks/native/include/sensor_algorithm.h +++ b/frameworks/native/include/sensor_algorithm.h @@ -16,7 +16,6 @@ #ifndef SENSOR_ALGORITHM_H #define SENSOR_ALGORITHM_H -#include #include class SensorAlgorithm { diff --git a/frameworks/native/include/sensor_client_proxy.h b/frameworks/native/include/sensor_client_proxy.h index ce9b2712e73fa0b0eb698a03953fb44845e125f4..04b01f5618e94b0b1e3ab371a7b72f598927b38e 100755 --- a/frameworks/native/include/sensor_client_proxy.h +++ b/frameworks/native/include/sensor_client_proxy.h @@ -17,9 +17,7 @@ #define SENSOR_CLIENT_PROXY_H #include "iremote_proxy.h" -#include "nocopyable.h" -#include "i_sensor_client.h" #include "sensor_agent_type.h" namespace OHOS { diff --git a/frameworks/native/include/sensor_client_stub.h b/frameworks/native/include/sensor_client_stub.h index 4a8a3d6b96a6e5cb046f6cb08d3d4b039c10e55b..674558e3d581ebc951a0ab1968381a63c5a69098 100755 --- a/frameworks/native/include/sensor_client_stub.h +++ b/frameworks/native/include/sensor_client_stub.h @@ -17,7 +17,6 @@ #define SENSOR_CLIENT_STUB_H #include "iremote_stub.h" -#include "message_parcel.h" #include "i_sensor_client.h" diff --git a/frameworks/native/include/sensor_data_channel.h b/frameworks/native/include/sensor_data_channel.h index 167707c91fac96457c2a2163e2a681bf1c453198..ddd3947827a8e1b7d34258f2e16105ce5cf103c4 100644 --- a/frameworks/native/include/sensor_data_channel.h +++ b/frameworks/native/include/sensor_data_channel.h @@ -16,9 +16,6 @@ #ifndef SENSOR_DATA_CHANNEL_H #define SENSOR_DATA_CHANNEL_H -#include -#include -#include #include #include "sensor_agent_type.h" diff --git a/frameworks/native/include/sensor_event_handler.h b/frameworks/native/include/sensor_event_handler.h index 710d6cd129498e0c1f8f1946db78b48f698d46bd..de42153261906140804d838d619328b4f9a9406b 100755 --- a/frameworks/native/include/sensor_event_handler.h +++ b/frameworks/native/include/sensor_event_handler.h @@ -17,7 +17,6 @@ #define SENSOR_EVENT_HANDLER_H #include "event_handler.h" -#include "event_runner.h" namespace OHOS { namespace Sensors { diff --git a/frameworks/native/include/sensor_file_descriptor_listener.h b/frameworks/native/include/sensor_file_descriptor_listener.h index 6c2439aed191e60d405a6b0d6d4c023bcbb8eff7..e0fbced8acf95fa6f9200d48cdd959c0985de9f3 100644 --- a/frameworks/native/include/sensor_file_descriptor_listener.h +++ b/frameworks/native/include/sensor_file_descriptor_listener.h @@ -16,9 +16,6 @@ #ifndef SENSOR_FILE_DESCRIPTOR_LISTENER_H #define SENSOR_FILE_DESCRIPTOR_LISTENER_H -#include - -#include "file_descriptor_listener.h" #include "sensor_data_channel.h" namespace OHOS { @@ -29,7 +26,6 @@ public: ~SensorFileDescriptorListener(); void OnReadable(int32_t fileDescriptor) override; void OnShutdown(int32_t fileDescriptor) override; - void OnException(int32_t fileDescriptor) override; void SetChannel(SensorDataChannel *channel); void ExcuteCallback(int32_t length); diff --git a/frameworks/native/include/sensor_service_client.h b/frameworks/native/include/sensor_service_client.h index 963dc9067a8cde16ae2a642ebb7a512a12961826..f07db3ee0b0200113e531af027aabcaf31476b1a 100755 --- a/frameworks/native/include/sensor_service_client.h +++ b/frameworks/native/include/sensor_service_client.h @@ -16,20 +16,14 @@ #ifndef SENSOR_SERVICE_CLIENT_H #define SENSOR_SERVICE_CLIENT_H -#include #include -#include #include "iservice_registry.h" #include "singleton.h" -#include "active_info.h" -#include "sensor_agent_type.h" -#include "sensor_basic_data_channel.h" #include "sensor_basic_info.h" #include "sensor_client_stub.h" #include "sensor_data_channel.h" -#include "sensor.h" #include "sensor_service_proxy.h" #include "stream_socket.h" diff --git a/frameworks/native/src/fd_listener.cpp b/frameworks/native/src/fd_listener.cpp index e54a94b7a8c9cd439780bf012aeaa710216f6a94..807ca6d5a43347c69fd11b71dbd8b852fe8b2055 100644 --- a/frameworks/native/src/fd_listener.cpp +++ b/frameworks/native/src/fd_listener.cpp @@ -15,9 +15,6 @@ #include "fd_listener.h" -#include - -#include "sensor_errors.h" #include "stream_socket.h" #undef LOG_TAG @@ -77,16 +74,5 @@ void FdListener::OnShutdown(int32_t fd) DisconnectFun disconnect = channel_->GetDisconnectFun(); disconnect(); } - -void FdListener::OnException(int32_t fd) -{ - CALL_LOG_ENTER; - if (fd < 0) { - SEN_HILOGE("Invalid fd, fd:%{public}d", fd); - } - CHKPV(channel_); - DisconnectFun disconnect = channel_->GetDisconnectFun(); - disconnect(); -} } // namespace Sensors } // namespace OHOS diff --git a/frameworks/native/src/geomagnetic_field.cpp b/frameworks/native/src/geomagnetic_field.cpp index d437db8964164ca542e2a781d170e46826b661a1..c05327c61a052ca9c04d3cd7cf24b2d7b0c5c978 100644 --- a/frameworks/native/src/geomagnetic_field.cpp +++ b/frameworks/native/src/geomagnetic_field.cpp @@ -15,10 +15,8 @@ #include "geomagnetic_field.h" -#include #include -#include "sensor_errors.h" #include "sensor_utils.h" using namespace OHOS::Sensors; diff --git a/frameworks/native/src/sensor_agent_proxy.cpp b/frameworks/native/src/sensor_agent_proxy.cpp index 61cdfb01bfe68415609d0b314c10a7a9bb38f372..caeb154dcfd4dd891f679a560d47e941d8eeb0ab 100644 --- a/frameworks/native/src/sensor_agent_proxy.cpp +++ b/frameworks/native/src/sensor_agent_proxy.cpp @@ -15,11 +15,7 @@ #include "sensor_agent_proxy.h" -#include - #include "print_sensor_data.h" -#include "securec.h" -#include "sensor_errors.h" #include "sensor_service_client.h" #undef LOG_TAG #define LOG_TAG "SensorAgentProxy" diff --git a/frameworks/native/src/sensor_algorithm.cpp b/frameworks/native/src/sensor_algorithm.cpp index be96d33614863826c0d9ceb73a47fb48d2ee8ac6..bf275d8df95232a5f4cdeeee034fa68e431a9714 100644 --- a/frameworks/native/src/sensor_algorithm.cpp +++ b/frameworks/native/src/sensor_algorithm.cpp @@ -14,9 +14,6 @@ */ #include "sensor_algorithm.h" -#include -#include - #include "sensor_errors.h" #include "sensor_utils.h" diff --git a/frameworks/native/src/sensor_client_stub.cpp b/frameworks/native/src/sensor_client_stub.cpp index d51e7382131688df8351a00c7ec39447b89671a7..6a6f44355ab29a992173bc3a7b0a572949d83913 100644 --- a/frameworks/native/src/sensor_client_stub.cpp +++ b/frameworks/native/src/sensor_client_stub.cpp @@ -15,7 +15,6 @@ #include "sensor_client_stub.h" -#include "message_parcel.h" #include "sensor_log.h" #undef LOG_TAG diff --git a/frameworks/native/src/sensor_data_channel.cpp b/frameworks/native/src/sensor_data_channel.cpp index 372178fa31939603c5c35bf837dd80a6903fc435..8d3109e75f870307905b567370206f1a11ab510f 100644 --- a/frameworks/native/src/sensor_data_channel.cpp +++ b/frameworks/native/src/sensor_data_channel.cpp @@ -13,10 +13,6 @@ * limitations under the License. */ -#include "sensor_data_channel.h" - -#include "errors.h" - #include "fd_listener.h" #include "sensor_errors.h" #include "sensor_file_descriptor_listener.h" diff --git a/frameworks/native/src/sensor_file_descriptor_listener.cpp b/frameworks/native/src/sensor_file_descriptor_listener.cpp index 6d9eeca28c7149332a62cacf1b8e4c3b77a7034d..074ee3af44018cd8b55a2160aedd357e0a90d788 100644 --- a/frameworks/native/src/sensor_file_descriptor_listener.cpp +++ b/frameworks/native/src/sensor_file_descriptor_listener.cpp @@ -15,10 +15,7 @@ #include "sensor_file_descriptor_listener.h" #include "print_sensor_data.h" -#include "sensor_agent_type.h" -#include "sensor_basic_data_channel.h" #include "sensor_errors.h" -#include "sys/socket.h" #undef LOG_TAG #define LOG_TAG "SensorFileDescriptorListener" @@ -102,18 +99,5 @@ void SensorFileDescriptorListener::OnShutdown(int32_t fileDescriptor) CHKPV(channel_); channel_->DestroySensorDataChannel(); } - -void SensorFileDescriptorListener::OnException(int32_t fileDescriptor) -{ - if (fileDescriptor < 0) { - SEN_HILOGE("Invalid fd:%{public}d", fileDescriptor); - } - if (receiveDataBuff_ != nullptr) { - delete[] receiveDataBuff_; - receiveDataBuff_ = nullptr; - } - CHKPV(channel_); - channel_->DestroySensorDataChannel(); -} } // namespace Sensors } // namespace OHOS \ No newline at end of file diff --git a/frameworks/native/src/sensor_service_client.cpp b/frameworks/native/src/sensor_service_client.cpp index 0397d053d7bb9ccd922ca2a8fcd1bf05191015f3..34c80a41a9d42be4431408ee98396a1149b62c88 100644 --- a/frameworks/native/src/sensor_service_client.cpp +++ b/frameworks/native/src/sensor_service_client.cpp @@ -15,11 +15,6 @@ #include "sensor_service_client.h" -#include -#include -#include -#include - #include "death_recipient_template.h" #ifdef HIVIEWDFX_HISYSEVENT_ENABLE #include "hisysevent.h" @@ -27,12 +22,8 @@ #ifdef HIVIEWDFX_HITRACE_ENABLE #include "hitrace_meter.h" #endif // HIVIEWDFX_HITRACE_ENABLE -#include "ipc_skeleton.h" #include "sensor_agent_proxy.h" -#include "sensor_errors.h" -#include "sensor_service_proxy.h" #include "system_ability_definition.h" -#include "rust_binding.h" #undef LOG_TAG #define LOG_TAG "SensorServiceClient" diff --git a/services/hdi_connection/adapter/include/sensor_event_callback.h b/services/hdi_connection/adapter/include/sensor_event_callback.h index 90ce52fe3c2fbf579504d32007df35f5106dbd2d..46b5d1b942e73540956240cf0763036aa90f3794 100644 --- a/services/hdi_connection/adapter/include/sensor_event_callback.h +++ b/services/hdi_connection/adapter/include/sensor_event_callback.h @@ -19,8 +19,6 @@ #include "v2_1/isensor_callback.h" #include "v2_1/sensor_types.h" -#include "sensor_data_event.h" - using OHOS::HDI::Sensor::V2_1::HdfSensorEvents; using OHOS::HDI::Sensor::V2_1::ISensorCallback; diff --git a/services/hdi_connection/adapter/src/compatible_connection.cpp b/services/hdi_connection/adapter/src/compatible_connection.cpp index 9c07aa2ab32b24ab1b725daa5978be8ca191c435..a368fda1fdc1ac6a949af331c06aee83e4cc8e6e 100644 --- a/services/hdi_connection/adapter/src/compatible_connection.cpp +++ b/services/hdi_connection/adapter/src/compatible_connection.cpp @@ -14,8 +14,6 @@ */ #include "compatible_connection.h" -#include - #include "securec.h" #include "sensor_errors.h" diff --git a/services/hdi_connection/adapter/src/hdi_connection.cpp b/services/hdi_connection/adapter/src/hdi_connection.cpp index a30e0c34d2d50d1f3416a34147719745022c17a4..bdca2348eb8058d166d552cce1f5ce247553dccb 100644 --- a/services/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/hdi_connection/adapter/src/hdi_connection.cpp @@ -15,7 +15,6 @@ #include "hdi_connection.h" #include -#include #include #ifdef HIVIEWDFX_HISYSEVENT_ENABLE diff --git a/services/hdi_connection/adapter/src/sensor_event_callback.cpp b/services/hdi_connection/adapter/src/sensor_event_callback.cpp index 091af57c3534d1bf5fc29751fbcea2875e591eae..d99d308055c4c37bb38a4cb5529882abcc8c5a04 100644 --- a/services/hdi_connection/adapter/src/sensor_event_callback.cpp +++ b/services/hdi_connection/adapter/src/sensor_event_callback.cpp @@ -18,7 +18,6 @@ #include "hdi_connection.h" #include "print_sensor_data.h" -#include "sensor_agent_type.h" #include "sensor_errors.h" #undef LOG_TAG diff --git a/services/hdi_connection/hardware/include/hdi_service_impl.h b/services/hdi_connection/hardware/include/hdi_service_impl.h index 50e6101b589ab7c2f0ff80c0d827e974f82b40a7..49b0191cd2065e84edff488a46f0eb35f4e29e57 100644 --- a/services/hdi_connection/hardware/include/hdi_service_impl.h +++ b/services/hdi_connection/hardware/include/hdi_service_impl.h @@ -16,9 +16,7 @@ #ifndef HDI_SERVICE_IMPL_H #define HDI_SERVICE_IMPL_H -#include #include -#include #include "sensor_agent_type.h" #include "singleton.h" diff --git a/services/hdi_connection/hardware/src/hdi_service_impl.cpp b/services/hdi_connection/hardware/src/hdi_service_impl.cpp index 1021cffa4a96fac3c5a7d84cd58fd01117a3ba5b..bf1c15e9f2605ab011c6b1308b94df6df63f55e1 100644 --- a/services/hdi_connection/hardware/src/hdi_service_impl.cpp +++ b/services/hdi_connection/hardware/src/hdi_service_impl.cpp @@ -14,11 +14,8 @@ */ #include "hdi_service_impl.h" -#include #include #include -#include -#include #include "sensor_errors.h" diff --git a/services/hdi_connection/interface/include/i_sensor_hdi_connection.h b/services/hdi_connection/interface/include/i_sensor_hdi_connection.h index 06a53f4476f5676cd74ec115369e9e6fea5a8212..5997a9b65500d4df04e5a3bf261b4448ece0e078 100644 --- a/services/hdi_connection/interface/include/i_sensor_hdi_connection.h +++ b/services/hdi_connection/interface/include/i_sensor_hdi_connection.h @@ -16,7 +16,6 @@ #ifndef I_SENSOR_HDI_CONNECTION_H #define I_SENSOR_HDI_CONNECTION_H -#include #include #include "report_data_callback.h" #include "sensor.h" diff --git a/services/hdi_connection/interface/include/sensor_hdi_connection.h b/services/hdi_connection/interface/include/sensor_hdi_connection.h index 67c14bb4a0216a15fc9b73c967087c3bb139d7b3..df45cfd38ac89c8018a24cdd065258c9b499f1ad 100644 --- a/services/hdi_connection/interface/include/sensor_hdi_connection.h +++ b/services/hdi_connection/interface/include/sensor_hdi_connection.h @@ -16,7 +16,6 @@ #ifndef SENSOR_HDI_CONNECTION_H #define SENSOR_HDI_CONNECTION_H -#include #include #include "i_sensor_hdi_connection.h" diff --git a/services/include/client_info.h b/services/include/client_info.h index 5187e570e37a66c5e2c772b220bf7190a56a1f08..f0b76b40af8311027018fa29a774f9d8d4d7d082 100644 --- a/services/include/client_info.h +++ b/services/include/client_info.h @@ -19,22 +19,16 @@ #include #include #include -#include -#include -#include -#include "refbase.h" #include "singleton.h" #include "accesstoken_kit.h" #include "iremote_object.h" -#include "nocopyable.h" #include "app_thread_info.h" #include "sensor_basic_data_channel.h" #include "sensor_basic_info.h" #include "sensor_channel_info.h" -#include "sensor_data_event.h" namespace OHOS { namespace Sensors { diff --git a/services/include/fifo_cache_data.h b/services/include/fifo_cache_data.h index b459a32c93ff9c604964ed0c536c4c933dca76d1..f95dcdf203a173c8cbad89afa37304f68c22f8ac 100644 --- a/services/include/fifo_cache_data.h +++ b/services/include/fifo_cache_data.h @@ -16,11 +16,7 @@ #ifndef FIFO_CACHE_DATA_H #define FIFO_CACHE_DATA_H -#include - -#include "nocopyable.h" #include "refbase.h" -#include "sensor_data_event.h" #include "sensor_basic_data_channel.h" namespace OHOS { diff --git a/services/include/flush_info_record.h b/services/include/flush_info_record.h index 02b77689edfada921f4bbd720cf4ba01db5163c1..003e676ee26d4fbda81f90f40d0ccb449e5fbc63 100644 --- a/services/include/flush_info_record.h +++ b/services/include/flush_info_record.h @@ -16,17 +16,8 @@ #ifndef FLUSH_INFO_RECORD_H #define FLUSH_INFO_RECORD_H -#include -#include -#include - -#include "nocopyable.h" -#include "refbase.h" -#include "singleton.h" - #include "client_info.h" #include "sensor_agent_type.h" -#include "sensor_basic_data_channel.h" #include "sensor_errors.h" #ifdef HDF_DRIVERS_INTERFACE_SENSOR #include "sensor_hdi_connection.h" diff --git a/services/include/sensor_data_processer.h b/services/include/sensor_data_processer.h index c0794915ae60917aee6c49704bd0416cc5d8461a..c344aee3b26eaf90b576eae183cb2b479b43d94a 100755 --- a/services/include/sensor_data_processer.h +++ b/services/include/sensor_data_processer.h @@ -16,23 +16,15 @@ #ifndef SENSORS_DATA_PROCESSER_H #define SENSORS_DATA_PROCESSER_H -#include -#include - -#include "refbase.h" - -#include "nocopyable.h" - -#include "client_info.h" #include "fifo_cache_data.h" #include "flush_info_record.h" -#include "report_data_callback.h" -#include "sensor.h" #include "sensor_hdi_connection.h" -#include "sensor_data_event.h" namespace OHOS { namespace Sensors { +namespace { + std::unordered_map sensorMap_; +} class SensorDataProcesser : public RefBase { public: explicit SensorDataProcesser(const std::unordered_map &sensorMap); @@ -60,7 +52,6 @@ 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_dump.h b/services/include/sensor_dump.h index 98df5086eda72e83a3f907352ce7dabbd6c387b7..62e29e741f84232aac6d14f1819f467a7e710dff 100644 --- a/services/include/sensor_dump.h +++ b/services/include/sensor_dump.h @@ -16,12 +16,6 @@ #ifndef SENSOR_DUMP_H #define SENSOR_DUMP_H -#include - -#include "singleton.h" - -#include "nocopyable.h" - #include "client_info.h" #include "sensor.h" #include "sensor_agent_type.h" diff --git a/services/include/sensor_manager.h b/services/include/sensor_manager.h index acc8c879bbe969dc67d01fa67059b3471b53d869..14661e76a52435c22c9fa92de8db56a0b86ee1d3 100644 --- a/services/include/sensor_manager.h +++ b/services/include/sensor_manager.h @@ -16,15 +16,10 @@ #ifndef SENSOR_MANAGER_H #define SENSOR_MANAGER_H -#include #include -#include -#include "client_info.h" -#include "flush_info_record.h" #ifdef HDF_DRIVERS_INTERFACE_SENSOR #include "sensor_data_processer.h" -#include "sensor_hdi_connection.h" #else #include "sensor.h" #endif // HDF_DRIVERS_INTERFACE_SENSOR @@ -57,7 +52,6 @@ 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_power_policy.h b/services/include/sensor_power_policy.h index e8333b8d56056294f0cd03695a531ec6c992a4ee..c8be31665d9a5eb73cb4ca468ff4b47b74402e30 100644 --- a/services/include/sensor_power_policy.h +++ b/services/include/sensor_power_policy.h @@ -16,15 +16,7 @@ #ifndef SENSOR_POWER_POLICY_H #define SENSOR_POWER_POLICY_H -#include -#include -#include - -#include "nocopyable.h" - #include "active_info.h" -#include "client_info.h" -#include "sensor_errors.h" #include "sensor_manager.h" #include "stream_session.h" #ifdef HDF_DRIVERS_INTERFACE_SENSOR diff --git a/services/include/sensor_service.h b/services/include/sensor_service.h index 8260e14be5dee64818369892b0c2db8efdd0160e..22b8cedeb409c37bbc23239f7b0c31f702253595 100644 --- a/services/include/sensor_service.h +++ b/services/include/sensor_service.h @@ -16,18 +16,10 @@ #ifndef SENSOR_SERVICE_H #define SENSOR_SERVICE_H -#include -#include -#include - -#include "nocopyable.h" #include "system_ability.h" -#include "client_info.h" #include "death_recipient_template.h" -#include "sensor_data_event.h" #include "sensor_delayed_sp_singleton.h" -#include "sensor_manager.h" #include "sensor_power_policy.h" #include "sensor_service_stub.h" #include "stream_server.h" diff --git a/services/include/stream_server.h b/services/include/stream_server.h index c97f3a934a2d261f600ab0d79ce7e3de9562c84b..5605e8b57ac1bb8098697cc5cfe3b0b0cf10e55d 100644 --- a/services/include/stream_server.h +++ b/services/include/stream_server.h @@ -16,7 +16,6 @@ #ifndef STREAM_SERVER_H #define STREAM_SERVER_H -#include #include #include "stream_session.h" diff --git a/services/src/client_info.cpp b/services/src/client_info.cpp index db983ce0cbf98d53406c91be21528cb2bebe4f9b..e683b0595ceb889a2d8f494df91be00e0ee3d1fa 100644 --- a/services/src/client_info.cpp +++ b/services/src/client_info.cpp @@ -13,13 +13,8 @@ * limitations under the License. */ -#include "client_info.h" - -#include - #include "permission_util.h" #include "securec.h" -#include "sensor_errors.h" #include "sensor_manager.h" #ifdef HDF_DRIVERS_INTERFACE_SENSOR #include "sensor_hdi_connection.h" diff --git a/services/src/flush_info_record.cpp b/services/src/flush_info_record.cpp index b39c14955aad89a887baebd5b1621fe67ef33b67..799a8f232ac243a383548d5f9279dc2592331ab3 100644 --- a/services/src/flush_info_record.cpp +++ b/services/src/flush_info_record.cpp @@ -15,8 +15,6 @@ #include "flush_info_record.h" -#include "sensor_errors.h" - #undef LOG_TAG #define LOG_TAG "FlushInfoRecord" diff --git a/services/src/sensor_data_processer.cpp b/services/src/sensor_data_processer.cpp index 6574c2359d81dd456f6eed684abfdf7b895427b0..c008752dc34936885f3031ff3748bd11e728f077 100755 --- a/services/src/sensor_data_processer.cpp +++ b/services/src/sensor_data_processer.cpp @@ -18,17 +18,11 @@ #include #include #include -#include #ifdef HIVIEWDFX_HISYSEVENT_ENABLE #include "hisysevent.h" #endif // HIVIEWDFX_HISYSEVENT_ENABLE #include "print_sensor_data.h" -#include "permission_util.h" -#include "securec.h" -#include "sensor_basic_data_channel.h" -#include "sensor_errors.h" -#include "system_ability_definition.h" #undef LOG_TAG #define LOG_TAG "SensorDataProcesser" diff --git a/services/src/sensor_dump.cpp b/services/src/sensor_dump.cpp index 767222bb5b8aaf73f4a3eb03642a0dfa83a40e4b..bc6f670fee414730cf4d31e0355eac77ac0778e8 100644 --- a/services/src/sensor_dump.cpp +++ b/services/src/sensor_dump.cpp @@ -18,12 +18,8 @@ #include #include -#include -#include -#include #include "securec.h" -#include "sensor_agent_type.h" #include "sensor_errors.h" #undef LOG_TAG diff --git a/services/src/sensor_manager.cpp b/services/src/sensor_manager.cpp index 50cb8580d1598322a87361d1af2ee8dd5b89ab34..439dbfdba8ab84ec0c0780a54976c996c695e1d4 100644 --- a/services/src/sensor_manager.cpp +++ b/services/src/sensor_manager.cpp @@ -17,12 +17,7 @@ #include -#include "iservice_registry.h" - -#include "sensor.h" -#include "sensor_data_event.h" -#include "sensor_errors.h" - +#include "sensor_data_processer.h" #undef LOG_TAG #define LOG_TAG "SensorManager" diff --git a/services/src/sensor_power_policy.cpp b/services/src/sensor_power_policy.cpp index 2debb6c20fc330128bfae07a43ff499f7fad8959..f4adf2a9bd6366b75e919140ff51ca0ded353c1e 100644 --- a/services/src/sensor_power_policy.cpp +++ b/services/src/sensor_power_policy.cpp @@ -15,8 +15,6 @@ #include "sensor_power_policy.h" -#include "sensor.h" -#include "sensor_agent_type.h" #ifdef OHOS_BUILD_ENABLE_RUST #include "rust_binding.h" #endif // OHOS_BUILD_ENABLE_RUST diff --git a/services/src/sensor_service.cpp b/services/src/sensor_service.cpp index d529ce197e8182cba7ed024c1958b6da6b1009c5..1ec41d89ea6c1eed78aa6cd721a953373c7afffd 100644 --- a/services/src/sensor_service.cpp +++ b/services/src/sensor_service.cpp @@ -17,15 +17,11 @@ #include #include -#include #include -#include -#include "accesstoken_kit.h" #ifdef HIVIEWDFX_HISYSEVENT_ENABLE #include "hisysevent.h" #endif // HIVIEWDFX_HISYSEVENT_ENABLE -#include "iservice_registry.h" #ifdef MEMMGR_ENABLE #include "mem_mgr_client.h" #endif // MEMMGR_ENABLE @@ -33,10 +29,8 @@ #include "permission_util.h" #include "print_sensor_data.h" -#include "securec.h" -#include "sensor.h" +#include "sensor_data_processer.h" #include "sensor_dump.h" -#include "sensor_errors.h" #include "system_ability_definition.h" #undef LOG_TAG diff --git a/utils/common/include/permission_util.h b/utils/common/include/permission_util.h index b073d147ba21ac307952e5d82c6a8f868cfbbdc3..49223da52f8b2543dfcf645b173386b35998017d 100644 --- a/utils/common/include/permission_util.h +++ b/utils/common/include/permission_util.h @@ -16,9 +16,6 @@ #ifndef PERMISSION_UTIL_H #define PERMISSION_UTIL_H -#include -#include - #include "access_token.h" #include "singleton.h" diff --git a/utils/common/include/sensor.h b/utils/common/include/sensor.h index 1782b13cafcafae42208755ecc5613fc49ea3b58..fabc175a591863e6e6a27a4d2bddeefea520d6e1 100644 --- a/utils/common/include/sensor.h +++ b/utils/common/include/sensor.h @@ -16,9 +16,6 @@ #ifndef SENSOR_H #define SENSOR_H -#include -#include - #include "parcel.h" namespace OHOS { diff --git a/utils/common/include/sensor_basic_data_channel.h b/utils/common/include/sensor_basic_data_channel.h index a1293ea314ca7cb488191c76c9a6753b09495b29..449dbf9d8f4a0f5a4d92f0b269b01cbbe3bc8f5a 100644 --- a/utils/common/include/sensor_basic_data_channel.h +++ b/utils/common/include/sensor_basic_data_channel.h @@ -17,10 +17,8 @@ #define SENSOR_BASIC_DATA_CHANNEL_H #include -#include #include "message_parcel.h" -#include "refbase.h" #include "sensor_data_event.h" diff --git a/utils/common/include/sensor_channel_info.h b/utils/common/include/sensor_channel_info.h index 8f39d221f616731c116ad43650f9532ffd979d4c..f988b6784f7f62ead3d84efa7e1f5bb69ef6351e 100644 --- a/utils/common/include/sensor_channel_info.h +++ b/utils/common/include/sensor_channel_info.h @@ -16,9 +16,7 @@ #ifndef SENSOR_CHANNEL_INFO_H #define SENSOR_CHANNEL_INFO_H -#include #include -#include namespace OHOS { namespace Sensors { diff --git a/utils/common/include/sensor_errors.h b/utils/common/include/sensor_errors.h index e242775248c1866475eca6b606d129949f8d5254..243dc2e32c25ac1fb878ec0af228dd21f1a6f6f1 100644 --- a/utils/common/include/sensor_errors.h +++ b/utils/common/include/sensor_errors.h @@ -19,8 +19,6 @@ #include #include -#include "hilog/log.h" - namespace OHOS { namespace Sensors { constexpr int32_t MAX_SENSOR_COUNT = 200; diff --git a/utils/common/src/print_sensor_data.cpp b/utils/common/src/print_sensor_data.cpp index 1d1e5140327f74dc83c210b47f972a47b8ee0479..208472d9e209e632b01afe064eacd20f065bb42e 100644 --- a/utils/common/src/print_sensor_data.cpp +++ b/utils/common/src/print_sensor_data.cpp @@ -15,9 +15,6 @@ #include "print_sensor_data.h" -#include -#include - #ifdef HIVIEWDFX_HISYSEVENT_ENABLE #include "hisysevent.h" #endif // HIVIEWDFX_HISYSEVENT_ENABLE diff --git a/utils/ipc/include/net_packet.h b/utils/ipc/include/net_packet.h index c12bc9abaca9cde01e7070d41a19301fcd04774c..d1ca30d191cd237029c9a6277d9c13ce32ad101c 100644 --- a/utils/ipc/include/net_packet.h +++ b/utils/ipc/include/net_packet.h @@ -16,7 +16,6 @@ #ifndef NET_PACKET_H #define NET_PACKET_H -#include "proto.h" #include "stream_buffer.h" #undef LOG_TAG diff --git a/utils/ipc/include/stream_buffer.h b/utils/ipc/include/stream_buffer.h index 8db8a871f940169cfb7f6159d0d057fc207f03c0..0bc6f66b28c795d796f34d13fc496dffc3d92980 100644 --- a/utils/ipc/include/stream_buffer.h +++ b/utils/ipc/include/stream_buffer.h @@ -17,7 +17,6 @@ #define STREAM_BUFFER_H #include -#include #include "nocopyable.h" #include "securec.h" diff --git a/utils/ipc/include/stream_session.h b/utils/ipc/include/stream_session.h index e29a2ea8fa362267c7483a50d08fd0fc2d31dec2..031acd179399c4e8b7e7e823c47c1394436a2a17 100644 --- a/utils/ipc/include/stream_session.h +++ b/utils/ipc/include/stream_session.h @@ -19,10 +19,8 @@ #include #include "accesstoken_kit.h" -#include "nocopyable.h" #include "net_packet.h" -#include "proto.h" #ifdef OHOS_BUILD_ENABLE_RUST #include "rust_binding.h" #endif // OHOS_BUILD_ENABLE_RUST diff --git a/utils/ipc/include/stream_socket.h b/utils/ipc/include/stream_socket.h index 3a445568a2ab890a57a64b2bb7ba2aeb7e4a3308..e2144c3f406f18ba81b77b082afb37accb5e5db5 100644 --- a/utils/ipc/include/stream_socket.h +++ b/utils/ipc/include/stream_socket.h @@ -16,13 +16,10 @@ #ifndef STREAM_SOCKET_H #define STREAM_SOCKET_H -#include #include #include -#include "nocopyable.h" - #include "circle_stream_buffer.h" #include "net_packet.h" #ifdef OHOS_BUILD_ENABLE_RUST diff --git a/utils/ipc/src/circle_stream_buffer.cpp b/utils/ipc/src/circle_stream_buffer.cpp index 1123531913c09f1e908fa13c45857f58bb096aab..f861b676720502c988db3fcc976e62e5a643f1f4 100644 --- a/utils/ipc/src/circle_stream_buffer.cpp +++ b/utils/ipc/src/circle_stream_buffer.cpp @@ -15,8 +15,6 @@ #include "circle_stream_buffer.h" -#include "sensor_errors.h" - namespace OHOS { namespace Sensors { bool CircleStreamBuffer::CheckWrite(size_t size) diff --git a/utils/ipc/src/net_packet.cpp b/utils/ipc/src/net_packet.cpp index 309bdc20f7f08199132b75e8b4cbdbc8ba2cff8b..d58775e352b6eb9e42ed329525b079dc1d6036fd 100644 --- a/utils/ipc/src/net_packet.cpp +++ b/utils/ipc/src/net_packet.cpp @@ -15,8 +15,6 @@ #include "net_packet.h" -#include "sensor_errors.h" - namespace OHOS { namespace Sensors { NetPacket::NetPacket(MessageId msgId) : msgId_(msgId) diff --git a/utils/ipc/src/stream_session.cpp b/utils/ipc/src/stream_session.cpp index 39f0b8c49302a21a650dcdf4b06f504c0e586117..a5ebe79706cc8dc094a71054d02803f33baa4a31 100644 --- a/utils/ipc/src/stream_session.cpp +++ b/utils/ipc/src/stream_session.cpp @@ -15,11 +15,8 @@ #include "stream_session.h" -#include #include -#include "proto.h" -#include "sensor_errors.h" #include "stream_socket.h" #undef LOG_TAG diff --git a/utils/ipc/src/stream_socket.cpp b/utils/ipc/src/stream_socket.cpp index e77dbb1dd4cbc76d79e3db76ee76b889978e5298..b7823b285447259ee956b3e500e05cd31a56a737 100644 --- a/utils/ipc/src/stream_socket.cpp +++ b/utils/ipc/src/stream_socket.cpp @@ -15,10 +15,6 @@ #include "stream_socket.h" -#include - -#include "sensor_errors.h" - namespace OHOS { namespace Sensors { #ifndef OHOS_BUILD_ENABLE_RUST