From d8a913e3be2e6537640b5c87e8886cc26f0e98aa Mon Sep 17 00:00:00 2001 From: sunwenyu123 Date: Wed, 29 Nov 2023 02:24:56 +0000 Subject: [PATCH] Modify coding normative issues in the project Signed-off-by: sunwenyu123 --- .../hdi_connection/adapter/include/compatible_connection.h | 4 ++-- services/hdi_connection/adapter/include/hdi_connection.h | 4 ++-- .../hdi_connection/adapter/include/sensor_event_callback.h | 4 ++-- .../hdi_connection/adapter/src/compatible_connection.cpp | 4 ++-- services/hdi_connection/adapter/src/hdi_connection.cpp | 6 +++--- .../hdi_connection/adapter/src/sensor_event_callback.cpp | 6 +++--- services/hdi_connection/hardware/include/hdi_service_impl.h | 4 ++-- services/hdi_connection/hardware/src/hdi_service_impl.cpp | 4 ++-- .../interface/include/i_sensor_hdi_connection.h | 4 ++-- .../interface/include/sensor_hdi_connection.h | 4 ++-- .../hdi_connection/interface/src/sensor_hdi_connection.cpp | 4 ++-- services/include/client_info.h | 4 ++-- services/include/fifo_cache_data.h | 4 ++-- services/include/flush_info_record.h | 4 ++-- services/include/sensor_data_processer.h | 4 ++-- services/include/sensor_dump.h | 4 ++-- services/include/sensor_manager.h | 4 ++-- services/include/sensor_power_policy.h | 4 ++-- services/include/sensor_service.h | 4 ++-- services/include/sensor_service_proxy.h | 4 ++-- services/include/sensor_service_stub.h | 4 ++-- services/include/stream_server.h | 4 ++-- services/src/client_info.cpp | 6 +++--- services/src/fifo_cache_data.cpp | 4 ++-- services/src/flush_info_record.cpp | 6 +++--- services/src/sensor_data_processer.cpp | 6 +++--- services/src/sensor_dump.cpp | 6 +++--- services/src/sensor_manager.cpp | 6 +++--- services/src/sensor_power_policy.cpp | 6 +++--- services/src/sensor_service.cpp | 6 +++--- services/src/sensor_service_stub.cpp | 6 +++--- services/src/stream_server.cpp | 6 +++--- 32 files changed, 75 insertions(+), 75 deletions(-) diff --git a/services/hdi_connection/adapter/include/compatible_connection.h b/services/hdi_connection/adapter/include/compatible_connection.h index f720f51e..75460182 100644 --- a/services/hdi_connection/adapter/include/compatible_connection.h +++ b/services/hdi_connection/adapter/include/compatible_connection.h @@ -41,6 +41,6 @@ private: static sptr reportDataCallback_; HdiServiceImpl &hdiServiceImpl_ = HdiServiceImpl::GetInstance(); }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // COMPATIBLE_CONNECTION_H \ No newline at end of file diff --git a/services/hdi_connection/adapter/include/hdi_connection.h b/services/hdi_connection/adapter/include/hdi_connection.h index d895dd61..fbc192b0 100644 --- a/services/hdi_connection/adapter/include/hdi_connection.h +++ b/services/hdi_connection/adapter/include/hdi_connection.h @@ -50,6 +50,6 @@ private: void SetSensorBasicInfoState(int32_t sensorId, bool state); void DeleteSensorBasicInfoState(int32_t sensorId); }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // HDI_CONNECTION_H \ No newline at end of file diff --git a/services/hdi_connection/adapter/include/sensor_event_callback.h b/services/hdi_connection/adapter/include/sensor_event_callback.h index 6cc72fbd..552e842e 100644 --- a/services/hdi_connection/adapter/include/sensor_event_callback.h +++ b/services/hdi_connection/adapter/include/sensor_event_callback.h @@ -29,6 +29,6 @@ public: virtual ~SensorEventCallback() {} int32_t OnDataEvent(const HdfSensorEvents &event) override; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // SENSOR_EVENT_CALLBACK_H diff --git a/services/hdi_connection/adapter/src/compatible_connection.cpp b/services/hdi_connection/adapter/src/compatible_connection.cpp index 1748a858..b9472c22 100644 --- a/services/hdi_connection/adapter/src/compatible_connection.cpp +++ b/services/hdi_connection/adapter/src/compatible_connection.cpp @@ -163,5 +163,5 @@ int32_t CompatibleConnection::DestroyHdiConnection() } return ERR_OK; } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/services/hdi_connection/adapter/src/hdi_connection.cpp b/services/hdi_connection/adapter/src/hdi_connection.cpp index f6cd5ed9..34350a81 100644 --- a/services/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/hdi_connection/adapter/src/hdi_connection.cpp @@ -38,7 +38,7 @@ std::map g_sensorBasicInfoMap; std::mutex g_sensorBasicInfoMutex; constexpr int32_t GET_HDI_SERVICE_COUNT = 5; constexpr uint32_t WAIT_MS = 200; -} // namespace +} // namespace ReportDataCb HdiConnection::reportDataCb_ = nullptr; sptr HdiConnection::reportDataCallback_ = nullptr; @@ -303,5 +303,5 @@ void HdiConnection::Reconnect() } } } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/hdi_connection/adapter/src/sensor_event_callback.cpp b/services/hdi_connection/adapter/src/sensor_event_callback.cpp index 6caf0e18..89286b61 100644 --- a/services/hdi_connection/adapter/src/sensor_event_callback.cpp +++ b/services/hdi_connection/adapter/src/sensor_event_callback.cpp @@ -26,7 +26,7 @@ namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "HdiConnection" }; std::unique_ptr HdiConnection_ = std::make_unique(); constexpr int32_t HEADPOSTURE_DATA_SIZE = 20; -} // namespace +} // namespace int32_t SensorEventCallback::OnDataEvent(const HdfSensorEvents &event) { @@ -74,5 +74,5 @@ int32_t SensorEventCallback::OnDataEvent(const HdfSensorEvents &event) ISensorHdiConnection::dataCondition_.notify_one(); return ERR_OK; } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/services/hdi_connection/hardware/include/hdi_service_impl.h b/services/hdi_connection/hardware/include/hdi_service_impl.h index fee4b17b..8d18640a 100644 --- a/services/hdi_connection/hardware/include/hdi_service_impl.h +++ b/services/hdi_connection/hardware/include/hdi_service_impl.h @@ -51,6 +51,6 @@ private: static int64_t reportInterval_; static std::atomic_bool isStop_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // HDI_SERVICE_IMPL_H \ No newline at end of file diff --git a/services/hdi_connection/hardware/src/hdi_service_impl.cpp b/services/hdi_connection/hardware/src/hdi_service_impl.cpp index ef76a32c..95c3bae7 100644 --- a/services/hdi_connection/hardware/src/hdi_service_impl.cpp +++ b/services/hdi_connection/hardware/src/hdi_service_impl.cpp @@ -287,5 +287,5 @@ int32_t HdiServiceImpl::Unregister() isStop_ = true; return ERR_OK; } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file 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 c9d9775e..7e3a7b5e 100644 --- a/services/hdi_connection/interface/include/i_sensor_hdi_connection.h +++ b/services/hdi_connection/interface/include/i_sensor_hdi_connection.h @@ -41,6 +41,6 @@ public: private: DISALLOW_COPY_AND_MOVE(ISensorHdiConnection); }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // I_SENSOR_HDI_CONNECTION_H \ No newline at end of file diff --git a/services/hdi_connection/interface/include/sensor_hdi_connection.h b/services/hdi_connection/interface/include/sensor_hdi_connection.h index 09a145b9..b8cbae26 100644 --- a/services/hdi_connection/interface/include/sensor_hdi_connection.h +++ b/services/hdi_connection/interface/include/sensor_hdi_connection.h @@ -54,6 +54,6 @@ private: Sensor GenerateHeadPostureSensor(); std::atomic_bool hdiConnectionStatus_ = false; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // SENSOR_HDI_CONNECTION_H \ No newline at end of file diff --git a/services/hdi_connection/interface/src/sensor_hdi_connection.cpp b/services/hdi_connection/interface/src/sensor_hdi_connection.cpp index 72fb9ed8..51bbafd1 100644 --- a/services/hdi_connection/interface/src/sensor_hdi_connection.cpp +++ b/services/hdi_connection/interface/src/sensor_hdi_connection.cpp @@ -350,5 +350,5 @@ int32_t SensorHdiConnection::DestroyHdiConnection() #endif // BUILD_VARIANT_ENG return ret; } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/include/client_info.h b/services/include/client_info.h index d90e919b..5187e570 100644 --- a/services/include/client_info.h +++ b/services/include/client_info.h @@ -105,6 +105,6 @@ private: std::unordered_set activeInfoCBPidSet_; static std::unordered_map> userGrantPermMap_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // CLIENT_INFO_H diff --git a/services/include/fifo_cache_data.h b/services/include/fifo_cache_data.h index 1a44751d..b459a32c 100644 --- a/services/include/fifo_cache_data.h +++ b/services/include/fifo_cache_data.h @@ -43,6 +43,6 @@ private: wptr channel_; std::vector fifoCacheData_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // FIFO_CACHE_DATA_H \ No newline at end of file diff --git a/services/include/flush_info_record.h b/services/include/flush_info_record.h index 9a0bc1ae..02b77689 100644 --- a/services/include/flush_info_record.h +++ b/services/include/flush_info_record.h @@ -64,6 +64,6 @@ private: std::unordered_map> flushInfo_; std::mutex flushInfoMutex_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // FLUSH_INFO_RECORD_H diff --git a/services/include/sensor_data_processer.h b/services/include/sensor_data_processer.h index 6998d34f..802cf040 100644 --- a/services/include/sensor_data_processer.h +++ b/services/include/sensor_data_processer.h @@ -62,6 +62,6 @@ private: std::mutex sensorMutex_; std::unordered_map sensorMap_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // endif SENSORS_DATA_PROCESSER_H diff --git a/services/include/sensor_dump.h b/services/include/sensor_dump.h index 1a311d3d..be667abb 100644 --- a/services/include/sensor_dump.h +++ b/services/include/sensor_dump.h @@ -47,6 +47,6 @@ private: std::string GetDataBySensorId(int32_t sensorId, SensorData &sensorData); static std::unordered_map sensorMap_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // SENSOR_DUMP_H diff --git a/services/include/sensor_manager.h b/services/include/sensor_manager.h index a3afe0a1..c7773640 100644 --- a/services/include/sensor_manager.h +++ b/services/include/sensor_manager.h @@ -60,6 +60,6 @@ private: std::unordered_map sensorMap_; std::mutex sensorMapMutex_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // SENSOR_MANAGER_H diff --git a/services/include/sensor_power_policy.h b/services/include/sensor_power_policy.h index 68281738..e8333b8d 100644 --- a/services/include/sensor_power_policy.h +++ b/services/include/sensor_power_policy.h @@ -51,6 +51,6 @@ private: std::mutex pidSensorInfoMutex_; std::unordered_map> pidSensorInfoMap_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // SENSOR_POWER_POLICY_H \ No newline at end of file diff --git a/services/include/sensor_service.h b/services/include/sensor_service.h index 6c5867f7..182d984b 100644 --- a/services/include/sensor_service.h +++ b/services/include/sensor_service.h @@ -115,6 +115,6 @@ private: }; #define POWER_POLICY SensorPowerPolicy::GetInstance() -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // SENSOR_SERVICE_H diff --git a/services/include/sensor_service_proxy.h b/services/include/sensor_service_proxy.h index 80804353..77116901 100644 --- a/services/include/sensor_service_proxy.h +++ b/services/include/sensor_service_proxy.h @@ -42,6 +42,6 @@ private: DISALLOW_COPY_AND_MOVE(SensorServiceProxy); static inline BrokerDelegator delegator_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // SENSOR_SERVICE_PROXY_H diff --git a/services/include/sensor_service_stub.h b/services/include/sensor_service_stub.h index 25a76d35..857bb5a1 100644 --- a/services/include/sensor_service_stub.h +++ b/services/include/sensor_service_stub.h @@ -49,6 +49,6 @@ private: ErrCode ResetSensorsInner(MessageParcel &data, MessageParcel &reply); std::unordered_map baseFuncs_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // SENSOR_SERVICE_STUB_H diff --git a/services/include/stream_server.h b/services/include/stream_server.h index b9496445..c97f3a93 100644 --- a/services/include/stream_server.h +++ b/services/include/stream_server.h @@ -41,6 +41,6 @@ protected: std::map idxPidMap_; std::map sessionsMap_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // STREAM_SERVER_H diff --git a/services/src/client_info.cpp b/services/src/client_info.cpp index 94a5cda1..649b15cf 100644 --- a/services/src/client_info.cpp +++ b/services/src/client_info.cpp @@ -38,7 +38,7 @@ constexpr int32_t MIN_MAP_SIZE = 0; constexpr uint32_t NO_STORE_EVENT = -2; constexpr uint32_t MAX_SUPPORT_CHANNEL = 200; constexpr uint32_t MAX_DUMP_DATA_SIZE = 10; -} // namespace +} // namespace std::unordered_map> ClientInfo::userGrantPermMap_ = { { ACTIVITY_MOTION_PERMISSION, { SENSOR_TYPE_ID_PEDOMETER_DETECTION, SENSOR_TYPE_ID_PEDOMETER } }, @@ -795,5 +795,5 @@ void ClientInfo::ChangeSensorPerm(AccessTokenID tokenId, const std::string &perm UpdatePermState(pid, sensorId, state); } } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/src/fifo_cache_data.cpp b/services/src/fifo_cache_data.cpp index a7484680..cb061697 100644 --- a/services/src/fifo_cache_data.cpp +++ b/services/src/fifo_cache_data.cpp @@ -60,5 +60,5 @@ sptr FifoCacheData::GetChannel() const { return channel_.promote(); } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/src/flush_info_record.cpp b/services/src/flush_info_record.cpp index 38535a4b..1d840746 100644 --- a/services/src/flush_info_record.cpp +++ b/services/src/flush_info_record.cpp @@ -24,7 +24,7 @@ using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "FlushInfoRecord" }; constexpr int32_t CHANNEL_NO_FLUSH = -1; -} // namespace +} // namespace std::unordered_map> FlushInfoRecord::GetFlushInfo() { @@ -94,5 +94,5 @@ ErrCode FlushInfoRecord::FlushProcess(const int32_t sensorId, const uint32_t fla } return ERR_OK; } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/src/sensor_data_processer.cpp b/services/src/sensor_data_processer.cpp index 34486f01..e91272f7 100644 --- a/services/src/sensor_data_processer.cpp +++ b/services/src/sensor_data_processer.cpp @@ -33,7 +33,7 @@ using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "SensorDataProcesser" }; const std::string SENSOR_REPORT_THREAD_NAME = "OS_SenProducer"; -} // namespace +} // namespace SensorDataProcesser::SensorDataProcesser(const std::unordered_map &sensorMap) { @@ -301,5 +301,5 @@ int32_t SensorDataProcesser::DataThread(sptr dataProcesser, } } while (1); } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/src/sensor_dump.cpp b/services/src/sensor_dump.cpp index 7a702a93..d82eb3de 100644 --- a/services/src/sensor_dump.cpp +++ b/services/src/sensor_dump.cpp @@ -47,7 +47,7 @@ enum { POSE_6DOF_DIMENSION = 15, DEFAULT_DIMENSION = 16, }; -} // namespace +} // namespace std::unordered_map SensorDump::sensorMap_ = { { SENSOR_TYPE_ID_ACCELEROMETER, "ACCELEROMETER" }, @@ -334,5 +334,5 @@ std::string SensorDump::GetDataBySensorId(int32_t sensorId, SensorData &sensorDa str.append("\n"); return str; } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/src/sensor_manager.cpp b/services/src/sensor_manager.cpp index 337c6b1f..fe870cb8 100644 --- a/services/src/sensor_manager.cpp +++ b/services/src/sensor_manager.cpp @@ -33,7 +33,7 @@ constexpr int32_t INVALID_SENSOR_ID = -1; #endif // HDF_DRIVERS_INTERFACE_SENSOR constexpr uint32_t PROXIMITY_SENSOR_ID = 50331904; constexpr float PROXIMITY_FAR = 5.0; -} // namespace +} // namespace #ifdef HDF_DRIVERS_INTERFACE_SENSOR void SensorManager::InitSensorMap(const std::unordered_map &sensorMap, @@ -212,5 +212,5 @@ void SensorManager::GetPackageName(AccessTokenID tokenId, std::string &packageNa } } } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/src/sensor_power_policy.cpp b/services/src/sensor_power_policy.cpp index 21d45239..0a90ad24 100644 --- a/services/src/sensor_power_policy.cpp +++ b/services/src/sensor_power_policy.cpp @@ -34,7 +34,7 @@ SensorManager &sensorManager_ = SensorManager::GetInstance(); #ifdef HDF_DRIVERS_INTERFACE_SENSOR SensorHdiConnection &sensorHdiConnection_ = SensorHdiConnection::GetInstance(); #endif // HDF_DRIVERS_INTERFACE_SENSOR -} // namespace +} // namespace bool SensorPowerPolicy::CheckFreezingSensor(int32_t sensorId) { @@ -260,5 +260,5 @@ void SensorPowerPolicy::ReportActiveInfo(const ActiveInfo &activeInfo, } } } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/services/src/sensor_service.cpp b/services/src/sensor_service.cpp index 6ada9b6f..b083a731 100644 --- a/services/src/sensor_service.cpp +++ b/services/src/sensor_service.cpp @@ -39,7 +39,7 @@ const bool G_REGISTER_RESULT = SystemAbility::MakeAndRegisterAbility(g_sensorSer constexpr int32_t INVALID_PID = -1; constexpr int64_t MAX_EVENT_COUNT = 1000; std::atomic_bool g_isRegister = false; -} // namespace +} // namespace SensorService::SensorService() : SystemAbility(SENSOR_SERVICE_ABILITY_ID, true), state_(SensorServiceState::STATE_STOPPED) @@ -582,5 +582,5 @@ void SensorService::PermStateChangeCb::PermStateChangeCallback(Security::AccessT server_->clientInfo_.ChangeSensorPerm(result.tokenID, result.permissionName, (result.permStateChangeType != 0)); } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/src/sensor_service_stub.cpp b/services/src/sensor_service_stub.cpp index c0827673..e23c5866 100755 --- a/services/src/sensor_service_stub.cpp +++ b/services/src/sensor_service_stub.cpp @@ -33,7 +33,7 @@ namespace Sensors { using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "SensorServiceStub" }; -} // namespace +} // namespace SensorServiceStub::SensorServiceStub() { @@ -311,5 +311,5 @@ ErrCode SensorServiceStub::ResetSensorsInner(MessageParcel &data, MessageParcel } return ResetSensors(); } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/services/src/stream_server.cpp b/services/src/stream_server.cpp index 05f7c6dc..5a55d8c5 100644 --- a/services/src/stream_server.cpp +++ b/services/src/stream_server.cpp @@ -27,7 +27,7 @@ namespace { constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "StreamServer" }; constexpr int32_t INVALID_PID = -1; constexpr int32_t INVALID_FD = -1; -} // namespace +} // namespace StreamServer::~StreamServer() { @@ -169,5 +169,5 @@ void StreamServer::DelSession(int32_t pid) } } } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file -- Gitee