From 4314efea5f1a69795e640216ae932d25d534a18f Mon Sep 17 00:00:00 2001 From: meng-xinhai Date: Tue, 25 Feb 2025 17:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E3=80=81map=E5=AE=B9=E5=99=A8=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: meng-xinhai Change-Id: If7199812e980a401eeedd869ef8954c5d7dde7e0 --- frameworks/cj/BUILD.gn | 2 -- frameworks/cj/include/cj_sensor_ffi.h | 2 -- frameworks/cj/src/cj_sensor_impl.cpp | 6 ------ frameworks/js/napi/BUILD.gn | 7 +------ frameworks/native/BUILD.gn | 8 +------- frameworks/native/include/fd_listener.h | 3 --- frameworks/native/include/geomagnetic_field.h | 1 - frameworks/native/include/sensor_agent_proxy.h | 4 ---- frameworks/native/include/sensor_algorithm.h | 1 - frameworks/native/include/sensor_client_proxy.h | 2 -- frameworks/native/include/sensor_client_stub.h | 1 - frameworks/native/include/sensor_data_channel.h | 3 --- frameworks/native/include/sensor_event_handler.h | 1 - .../include/sensor_file_descriptor_listener.h | 4 ---- .../native/include/sensor_service_client.h | 6 ------ frameworks/native/src/fd_listener.cpp | 14 -------------- frameworks/native/src/geomagnetic_field.cpp | 2 -- frameworks/native/src/sensor_agent_proxy.cpp | 4 ---- frameworks/native/src/sensor_algorithm.cpp | 3 --- frameworks/native/src/sensor_client_stub.cpp | 1 - frameworks/native/src/sensor_data_channel.cpp | 4 ---- .../src/sensor_file_descriptor_listener.cpp | 16 ---------------- frameworks/native/src/sensor_service_client.cpp | 9 --------- .../adapter/include/sensor_event_callback.h | 2 -- .../adapter/src/compatible_connection.cpp | 2 -- .../adapter/src/hdi_connection.cpp | 1 - .../adapter/src/sensor_event_callback.cpp | 1 - .../hardware/include/hdi_service_impl.h | 3 +-- .../hardware/src/hdi_service_impl.cpp | 3 --- .../interface/include/i_sensor_hdi_connection.h | 1 - .../interface/include/sensor_hdi_connection.h | 1 - services/include/client_info.h | 6 ------ services/include/fifo_cache_data.h | 4 ---- services/include/flush_info_record.h | 9 --------- services/include/sensor_data_processer.h | 15 +++------------ services/include/sensor_dump.h | 6 ------ services/include/sensor_manager.h | 5 ----- services/include/sensor_power_policy.h | 8 -------- services/include/sensor_service.h | 9 --------- services/include/stream_server.h | 1 - services/src/client_info.cpp | 5 ----- services/src/flush_info_record.cpp | 2 -- services/src/sensor_data_processer.cpp | 6 ------ services/src/sensor_dump.cpp | 4 ---- services/src/sensor_manager.cpp | 6 ------ services/src/sensor_power_policy.cpp | 2 -- services/src/sensor_service.cpp | 8 +------- utils/common/include/permission_util.h | 3 --- utils/common/include/sensor.h | 3 --- utils/common/include/sensor_basic_data_channel.h | 2 -- utils/common/include/sensor_channel_info.h | 2 -- utils/common/include/sensor_errors.h | 2 -- utils/common/src/print_sensor_data.cpp | 3 --- utils/ipc/include/net_packet.h | 1 - utils/ipc/include/stream_buffer.h | 1 - utils/ipc/include/stream_session.h | 2 -- utils/ipc/include/stream_socket.h | 3 --- utils/ipc/src/circle_stream_buffer.cpp | 2 -- utils/ipc/src/net_packet.cpp | 2 -- utils/ipc/src/stream_session.cpp | 3 --- utils/ipc/src/stream_socket.cpp | 4 ---- 61 files changed, 7 insertions(+), 240 deletions(-) diff --git a/frameworks/cj/BUILD.gn b/frameworks/cj/BUILD.gn index 7198ec1e..af43f0f6 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 7296d134..c3f1cae2 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 5b8d50c7..ae5739b7 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 dbbfda13..7fde7b06 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 097d94fd..5b048b1b 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 7c4424d8..d1d61df6 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 1c3dd4c1..d0950135 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 e1e44219..58e8bd1f 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 83bee7e2..a3143dad 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 ce9b2712..04b01f56 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 4a8a3d6b..674558e3 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 167707c9..ddd39478 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 710d6cd1..de421532 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 6c2439ae..e0fbced8 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 963dc906..f07db3ee 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 e54a94b7..807ca6d5 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 d437db89..c05327c6 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 61cdfb01..caeb154d 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 be96d336..bf275d8d 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 d51e7382..6a6f4435 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 372178fa..8d3109e7 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 6d9eeca2..074ee3af 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 67be234b..1f68748a 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 90ce52fe..46b5d1b9 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 9c07aa2a..a368fda1 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 a30e0c34..bdca2348 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 091af57c..d99d3080 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 50e6101b..bb0b3918 100644 --- a/services/hdi_connection/hardware/include/hdi_service_impl.h +++ b/services/hdi_connection/hardware/include/hdi_service_impl.h @@ -16,9 +16,8 @@ #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 1021cffa..bf1c15e9 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 06a53f44..5997a9b6 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 67c14bb4..df45cfd3 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 5187e570..f0b76b40 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 b459a32c..f95dcdf2 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 02b77689..003e676e 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 c0794915..c344aee3 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 98df5086..62e29e74 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 acc8c879..dfe51ac9 100644 --- a/services/include/sensor_manager.h +++ b/services/include/sensor_manager.h @@ -16,12 +16,8 @@ #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" @@ -57,7 +53,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 e8333b8d..c8be3166 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 8260e14b..5eb17728 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" @@ -101,7 +93,6 @@ 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/include/stream_server.h b/services/include/stream_server.h index c97f3a93..5605e8b5 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 db983ce0..e683b059 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 b39c1495..799a8f23 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 6574c235..c008752d 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 767222bb..bc6f670f 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 50cb8580..5d8e63d5 100644 --- a/services/src/sensor_manager.cpp +++ b/services/src/sensor_manager.cpp @@ -17,12 +17,6 @@ #include -#include "iservice_registry.h" - -#include "sensor.h" -#include "sensor_data_event.h" -#include "sensor_errors.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 2debb6c2..f4adf2a9 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 d529ce19..1ec41d89 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 b073d147..49223da5 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 1782b13c..fabc175a 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 a1293ea3..449dbf9d 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 8f39d221..f988b678 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 e2427752..243dc2e3 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 1d1e5140..208472d9 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 c12bc9ab..d1ca30d1 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 8db8a871..0bc6f66b 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 e29a2ea8..031acd17 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 3a445568..e2144c3f 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 11235319..f861b676 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 309bdc20..d58775e3 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 39f0b8c4..a5ebe797 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 e77dbb1d..b7823b28 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 -- Gitee