diff --git a/frameworks/native/sensor/src/sensor_agent_proxy.cpp b/frameworks/native/sensor/src/sensor_agent_proxy.cpp index a5522d8da0ca6718f903581500c9fd884d121b93..126e24ef39ff98726f6df4183c76312187367037 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()) {} 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/plugin/src/sensor_js.cpp b/interfaces/plugin/src/sensor_js.cpp index 74072a2cf2a7ffa67575f5a21af74407aefa00d9..b15abe0ec4a3e88b0c4f1564265edba02bd45bfc 100644 --- a/interfaces/plugin/src/sensor_js.cpp +++ b/interfaces/plugin/src/sensor_js.cpp @@ -227,7 +227,7 @@ static napi_value On(napi_env env, napi_callback_info info) return nullptr; } interval = GetCppInt64(value, env); - HiLog::Debug(LABEL, "%{public}s interval is %{public}lld", __func__, interval); + HiLog::Debug(LABEL, "%{public}s interval is %{public}" PRId64, __func__, interval); } int32_t ret = SubscribeSensor(sensorTypeId, interval, DataCallbackImpl); if (ret != OHOS::ERR_OK) { diff --git a/services/sensor/hdi_connection/adapter/include/hdi_connection.h b/services/sensor/hdi_connection/adapter/include/hdi_connection.h index b5f26cb5b213d037c2a3ba96707af4f35d4d2458..95cd55168cb55c90111018901d0a7d8ced9113a0 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_; 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_dump.cpp b/services/sensor/src/sensor_dump.cpp index 6ef5503aabd8b21c22258621938c91cf14b0f1d4..fe4f22d0b1c8d4fee9ec994073d01f278cfab78e 100644 --- a/services/sensor/src/sensor_dump.cpp +++ b/services/sensor/src/sensor_dump.cpp @@ -144,10 +144,10 @@ bool SensorDump::DumpSensorList(int32_t fd, const std::vector &sensors, auto sensorId = sensor.GetSensorId(); dprintf(fd, "sensorId:%8u | sensorType:%s | sensorName:%s | vendorName:%s | maxRange:%f" - "| fifoMaxEventCount:%d | minSamplePeriodNs:%lld | maxSamplePeriodNs:%lld\n", + "| fifoMaxEventCount:%d | minSamplePeriodNs:%" PRId64 " | maxSamplePeriodNs:%" PRId64 "\n", sensorId, sensorMap_[sensorId].c_str(), sensor.GetSensorName().c_str(), sensor.GetVendorName().c_str(), - sensor.GetMaxRange(), sensor.GetFifoMaxEventCount(), (long long) { sensor.GetMinSamplePeriodNs() }, - (long long) { sensor.GetMaxSamplePeriodNs() }); + sensor.GetMaxRange(), sensor.GetFifoMaxEventCount(), sensor.GetMinSamplePeriodNs(), + sensor.GetMaxSamplePeriodNs()); } return true; } 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))) {