diff --git a/frameworks/native/sensor/include/my_event_handler.h b/frameworks/native/sensor/include/my_event_handler.h index 3b89c93bd67ecff4c538200a48e6626567e81d2b..8f30f92bb283c426975a9ea8684d0049017c75c1 100755 --- a/frameworks/native/sensor/include/my_event_handler.h +++ b/frameworks/native/sensor/include/my_event_handler.h @@ -34,4 +34,4 @@ public: }; } // namespace Sensors } // namespace OHOS -#endif // MY_EVENT_HANDLER_H \ No newline at end of file +#endif // MY_EVENT_HANDLER_H diff --git a/frameworks/native/sensor/src/my_event_handler.cpp b/frameworks/native/sensor/src/my_event_handler.cpp index 802c128633623283dbfa441252b09789ac046f49..b6f067ffa1d6393d0c9b7e52ceb2279310044ab6 100755 --- a/frameworks/native/sensor/src/my_event_handler.cpp +++ b/frameworks/native/sensor/src/my_event_handler.cpp @@ -32,4 +32,4 @@ MyEventHandler::MyEventHandler(const std::shared_ptr &runner):Event */ void MyEventHandler::ProcessEvent(const InnerEvent::Pointer &event){} } // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/frameworks/native/sensor/src/my_file_descriptor_listener.cpp b/frameworks/native/sensor/src/my_file_descriptor_listener.cpp index a562164c05af4f51c649b3575a03e8b4e875fe10..a61e7271d7080de668de2e3e4e880334564758d2 100644 --- a/frameworks/native/sensor/src/my_file_descriptor_listener.cpp +++ b/frameworks/native/sensor/src/my_file_descriptor_listener.cpp @@ -113,4 +113,4 @@ void MyFileDescriptorListener::OnException(int32_t fileDescriptor) } } } // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/frameworks/native/sensor/src/sensor_agent_proxy.cpp b/frameworks/native/sensor/src/sensor_agent_proxy.cpp index a5522d8da0ca6718f903581500c9fd884d121b93..80b4b4781236d5f61f2a5d0e58fd52a26c671a26 100644 --- a/frameworks/native/sensor/src/sensor_agent_proxy.cpp +++ b/frameworks/native/sensor/src/sensor_agent_proxy.cpp @@ -75,7 +75,7 @@ std::mutex SensorAgentProxy::chanelMutex_; std::map SensorAgentProxy::g_subscribeMap; std::map SensorAgentProxy::g_unsubscribeMap; -SensorAgentProxy::SensorAgentProxy() +SensorAgentProxy::SensorAgentProxy() : dataChannel_(new (std::nothrow) SensorDataChannel()) {} @@ -358,4 +358,4 @@ int32_t SensorAgentProxy::GetAllSensors(SensorInfo **sensorInfo, int32_t *count) return OHOS::Sensors::SUCCESS; } } // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/interfaces/native/include/geomagnetic_field.h b/interfaces/native/include/geomagnetic_field.h index 2031e505e45dbb0a4ac1dc0301105f275bc19f13..4e3704817448e97fdab272b19c8f4aa399973f85 100755 --- a/interfaces/native/include/geomagnetic_field.h +++ b/interfaces/native/include/geomagnetic_field.h @@ -86,4 +86,4 @@ private: double ToDegrees(double angrad); static double ToRadians(double angdeg); }; -#endif // GEOMAGNETIC_FIELD_H \ No newline at end of file +#endif // GEOMAGNETIC_FIELD_H diff --git a/interfaces/native/include/sensor_algorithm.h b/interfaces/native/include/sensor_algorithm.h index 4dd157f01cf9880a2a8022e0b147b5dc664d6735..e8d96685ae4b4a109471e823e3e545724df1f657 100644 --- a/interfaces/native/include/sensor_algorithm.h +++ b/interfaces/native/include/sensor_algorithm.h @@ -42,6 +42,7 @@ public: int32_t createRotationAndInclination(std::vector gravity, std::vector geomagnetic, std::vector &rotationMatrix, std::vector &inclinationMatrix); + private: int32_t transformCoordinateSystemImpl(std::vector inRotationMatrix, int32_t axisX, int32_t axisY, std::vector &outRotationMatrix); diff --git a/interfaces/native/src/geomagnetic_field.cpp b/interfaces/native/src/geomagnetic_field.cpp index 1b7c0f2d61c259036ff671e5ae89b6fd8bbdf6e5..2cb30749b899fe8488e1e1711b17bde7338fa1af 100644 --- a/interfaces/native/src/geomagnetic_field.cpp +++ b/interfaces/native/src/geomagnetic_field.cpp @@ -309,4 +309,3 @@ float GeomagneticField::ObtainTotalIntensity() float totalIntensity = static_cast(sqrt(sumOfSquares)); return totalIntensity; } - diff --git a/interfaces/native/src/sensor_agent.cpp b/interfaces/native/src/sensor_agent.cpp index e7e8b14fc39a6d1c3f1a6d0e0f541997be79c134..ff40ebba129c9dc814e2c6f84db885f2a4ff6b1b 100755 --- a/interfaces/native/src/sensor_agent.cpp +++ b/interfaces/native/src/sensor_agent.cpp @@ -117,4 +117,4 @@ int32_t SetOption(int32_t sensorId, const SensorUser *user, int32_t option) return OHOS::Sensors::ERROR; } return proxy->SetOption(sensorId, user, option); -} \ No newline at end of file +} diff --git a/interfaces/native/src/sensor_algorithm.cpp b/interfaces/native/src/sensor_algorithm.cpp index 6742b4d42a4209650b264b566e8358b530b17ca0..932dfac6b90f8e7203367ee07d84b9ebe65cfb29 100644 --- a/interfaces/native/src/sensor_algorithm.cpp +++ b/interfaces/native/src/sensor_algorithm.cpp @@ -351,4 +351,4 @@ int32_t SensorAlgorithm::createRotationAndInclination(std::vector gravity inclinationMatrix[15] = 1.0f; } return OHOS::Sensors::SUCCESS; -} \ No newline at end of file +} diff --git a/interfaces/plugin/include/sensor_js.h b/interfaces/plugin/include/sensor_js.h index 00d01db9892937b5db2c372609e232eac7f93c73..4ae20f057833a108bd3eef33dcad4621dece15d2 100755 --- a/interfaces/plugin/include/sensor_js.h +++ b/interfaces/plugin/include/sensor_js.h @@ -21,4 +21,4 @@ static int32_t UnsubscribeSensor(int32_t sensorTypeId); static void DataCallbackImpl(SensorEvent *event); static int32_t SubscribeSensor(int32_t sensorTypeId, int64_t interval, RecordSensorCallback callback); -#endif // SENSOR_JS_H \ No newline at end of file +#endif // SENSOR_JS_H diff --git a/interfaces/plugin/include/sensor_system_js.h b/interfaces/plugin/include/sensor_system_js.h index 3b8dd9bd2530dfde679813c3a4d9df1324629dff..dfff58da30a3dbd8ac7fdc6c03f67fcd08fa611e 100644 --- a/interfaces/plugin/include/sensor_system_js.h +++ b/interfaces/plugin/include/sensor_system_js.h @@ -45,4 +45,4 @@ napi_value UnsubscribeMagnetic(napi_env env, napi_callback_info info); napi_value SubscribeHall(napi_env env, napi_callback_info info); napi_value UnsubscribeHall(napi_env env, napi_callback_info info); -#endif // SENSOR_SYSTEM_JS_H \ No newline at end of file +#endif // SENSOR_SYSTEM_JS_H diff --git a/interfaces/plugin/src/sensor_napi_utils.cpp b/interfaces/plugin/src/sensor_napi_utils.cpp index 40fb28462e185d6b2ce47df8627da13959ae9aa6..ff5b905bd7529276c290ca8f7d37d98919c9d582 100644 --- a/interfaces/plugin/src/sensor_napi_utils.cpp +++ b/interfaces/plugin/src/sensor_napi_utils.cpp @@ -494,4 +494,4 @@ void EmitPromiseWork(AsyncCallbackInfo *asyncCallbackInfo) }, (void*)asyncCallbackInfo, &asyncCallbackInfo->asyncWork); napi_queue_async_work(asyncCallbackInfo->env, asyncCallbackInfo->asyncWork); -} \ No newline at end of file +} diff --git a/services/sensor/hdi_connection/adapter/include/compatible_connection.h b/services/sensor/hdi_connection/adapter/include/compatible_connection.h index 958fb80d3d64ecdc2408ae50c1cba0079f355e9f..c175b1f4700407b54889a4eb04797a247b9fbfac 100644 --- a/services/sensor/hdi_connection/adapter/include/compatible_connection.h +++ b/services/sensor/hdi_connection/adapter/include/compatible_connection.h @@ -56,4 +56,4 @@ private: }; } // namespace Sensors } // namespace OHOS -#endif // COMPATIBLE_CONNECTION_H \ No newline at end of file +#endif // COMPATIBLE_CONNECTION_H diff --git a/services/sensor/hdi_connection/adapter/include/hdi_connection.h b/services/sensor/hdi_connection/adapter/include/hdi_connection.h index b5f26cb5b213d037c2a3ba96707af4f35d4d2458..f2a2c3f958b0e795a5db8083fa9307f7894e685f 100644 --- a/services/sensor/hdi_connection/adapter/include/hdi_connection.h +++ b/services/sensor/hdi_connection/adapter/include/hdi_connection.h @@ -53,6 +53,7 @@ public: sptr getReportDataCallback(); void ProcessDeathObserver(const wptr &object); + private: DISALLOW_COPY_AND_MOVE(HdiConnection); static ZReportDataCb reportDataCb_; @@ -67,4 +68,4 @@ private: }; } // namespace Sensors } // namespace OHOS -#endif // HDI_CONNECTION_H \ No newline at end of file +#endif // HDI_CONNECTION_H diff --git a/services/sensor/hdi_connection/adapter/src/compatible_connection.cpp b/services/sensor/hdi_connection/adapter/src/compatible_connection.cpp index 13b0d0dba45a8c43eef04db5e81f90eb63fa7c35..6f8386483df26a5226b0643dd1a9eaf87316c8bd 100644 --- a/services/sensor/hdi_connection/adapter/src/compatible_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/compatible_connection.cpp @@ -179,4 +179,4 @@ int32_t CompatibleConnection::DestroyHdiConnection() return ERR_OK; } } // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/services/sensor/hdi_connection/adapter/src/sensor_event_callback.cpp b/services/sensor/hdi_connection/adapter/src/sensor_event_callback.cpp index 0c3d7c88069bffedadfd6a9589b72e0b647cc427..815f85ec76f5e7400636819b77ca24df62cb659e 100644 --- a/services/sensor/hdi_connection/adapter/src/sensor_event_callback.cpp +++ b/services/sensor/hdi_connection/adapter/src/sensor_event_callback.cpp @@ -55,4 +55,4 @@ int32_t SensorEventCallback::OnDataEvent(const HdfSensorEvents& event) return ERR_OK; } } // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h b/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h index 9c9d041e278c1d9981a60108e02f2fa35c06e069..d0c3d108bd69ade327a5555efa586254804722f1 100644 --- a/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h +++ b/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h @@ -61,4 +61,4 @@ private: }; } // namespace Sensors } // namespace OHOS -#endif // HDI_SERVICE_IMPL_H \ No newline at end of file +#endif // HDI_SERVICE_IMPL_H diff --git a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp index a4c0f50f9f7009fb184907d544366aa628b65787..d9cc86a6243255080fc09c34baf19f1968076dce 100644 --- a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp +++ b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp @@ -157,4 +157,4 @@ int32_t HdiServiceImpl::Unregister() return ERR_OK; } } // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/services/sensor/hdi_connection/interface/src/sensor_hdi_connection.cpp b/services/sensor/hdi_connection/interface/src/sensor_hdi_connection.cpp index 78e631623b4efe91ce2f5addaeaa063ad11117f3..c395270638105e85658701d820994661570fd8c4 100644 --- a/services/sensor/hdi_connection/interface/src/sensor_hdi_connection.cpp +++ b/services/sensor/hdi_connection/interface/src/sensor_hdi_connection.cpp @@ -145,3 +145,4 @@ int32_t SensorHdiConnection::DestroyHdiConnection() } } // namespace Sensors } // namespace OHOS + diff --git a/services/sensor/include/fifo_cache_data.h b/services/sensor/include/fifo_cache_data.h index 22d257988d1414b3e42b14123bdfe17009c008ac..fcfdfcd51c049e04baea37902b4c0b41fbaafa84 100755 --- a/services/sensor/include/fifo_cache_data.h +++ b/services/sensor/include/fifo_cache_data.h @@ -46,4 +46,4 @@ private: }; } // namespace Sensors } // namespace OHOS -#endif // FIFO_CACHE_DATA_H \ No newline at end of file +#endif // FIFO_CACHE_DATA_H diff --git a/services/sensor/include/sensor_service.h b/services/sensor/include/sensor_service.h index 95b0f40a1671782b53c955355e3727b34ade7276..94687ae3b84eaef2c1a844f699f4c123aa7cf014 100644 --- a/services/sensor/include/sensor_service.h +++ b/services/sensor/include/sensor_service.h @@ -20,7 +20,6 @@ #include #include - #include "nocopyable.h" #include "system_ability.h" @@ -40,6 +39,7 @@ enum class SensorServiceState { class SensorService : public SystemAbility, public SensorServiceStub { DECLARE_SYSTEM_ABILITY(SensorService) + public: explicit SensorService(int32_t systemAbilityId, bool runOnCreate = false); diff --git a/services/sensor/src/sensor_service.cpp b/services/sensor/src/sensor_service.cpp index 0072026f44a272eaa050be112888e97f9085e2a8..5a753265597df663442023a8542b1ba0af15f009 100644 --- a/services/sensor/src/sensor_service.cpp +++ b/services/sensor/src/sensor_service.cpp @@ -236,7 +236,7 @@ ErrCode SensorService::SaveSubscriber(uint32_t sensorId, int64_t samplingPeriodN ErrCode SensorService::EnableSensor(uint32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u, samplingPeriodNs : %{public}" + HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u, samplingPeriodNs : %{public}" PRId64, __func__, sensorId, samplingPeriodNs); if ((sensorId == INVALID_SENSOR_ID) || ((samplingPeriodNs != 0L) && ((maxReportDelayNs / samplingPeriodNs) > MAX_EVENT_COUNT))) {