From a930b88892596712a2c1a42a9833fa4199b2464c Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Mon, 10 Mar 2025 11:32:34 +0800 Subject: [PATCH] Modified branch difference Signed-off-by: li-yaoyao777 --- hisysevent.yaml | 8 +++++--- services/src/sensor_service.cpp | 4 ++-- test/unittest/coverage/sensor_basic_data_channel_test.cpp | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hisysevent.yaml b/hisysevent.yaml index 7cd09bad..78d173be 100755 --- a/hisysevent.yaml +++ b/hisysevent.yaml @@ -15,15 +15,17 @@ domain: SENSOR ENABLE_SENSOR: __BASE: {type: STATISTIC, level: MINOR, tag: PowerStats, desc: When registering enable sensor} - UID: {type: INT32, desc: calling uid} PKG_NAME: {type: STRING, desc: package name} TYPE: {type: INT32, desc: type} + UID: {type: INT32, desc: calling uid} + PID: {type: INT32, desc: calling pid} DISABLE_SENSOR: __BASE: {type: STATISTIC, level: MINOR, tag: PowerStats, desc: When unregistering disable sensor} - UID: {type: INT32, desc: calling uid} - PKG_NAME: {type: STRING, desc: package name} TYPE: {type: INT32, desc: type} + PKG_NAME: {type: STRING, desc: package name} + UID: {type: INT32, desc: calling uid} + PID: {type: INT32, desc: calling pid} DATA_CHANNEL_EXCEPTION: __BASE: {type: FAULT, level: MINOR, desc: sensor data channel exception} diff --git a/services/src/sensor_service.cpp b/services/src/sensor_service.cpp index aa0b5e46..1be04a9d 100644 --- a/services/src/sensor_service.cpp +++ b/services/src/sensor_service.cpp @@ -210,13 +210,13 @@ void SensorService::ReportSensorSysEvent(int32_t sensorId, bool enable, int32_t int32_t uid = clientInfo_.GetUidByPid(pid); if (enable) { HiSysEventWrite(HiSysEvent::Domain::SENSOR, "ENABLE_SENSOR", HiSysEvent::EventType::STATISTIC, - "LEVEL", logLevel, "UID", uid, "PKG_NAME", packageName, "TYPE", sensorId); + "LEVEL", logLevel, "PKG_NAME", packageName, "TYPE", sensorId, "UID", uid, "PID", pid); SEN_HILOGI("PackageName:%{public}s open the sensor, sensorId:%{public}d, pid:%{public}d, " "samplingPeriodNs:%{public}" PRId64 ", samplingPeriodNs:%{public}" PRId64, packageName.c_str(), sensorId, pid, samplingPeriodNs, maxReportDelayNs); } else { HiSysEventWrite(HiSysEvent::Domain::SENSOR, "DISABLE_SENSOR", HiSysEvent::EventType::STATISTIC, - "LEVEL", logLevel, "UID", uid, "PKG_NAME", packageName, "TYPE", sensorId); + "LEVEL", logLevel, "PKG_NAME", packageName, "TYPE", sensorId, "UID", uid, "PID", pid); SEN_HILOGI("PackageName:%{public}s close the sensor, sensorId:%{public}d, pid:%{public}d", packageName.c_str(), sensorId, pid); } diff --git a/test/unittest/coverage/sensor_basic_data_channel_test.cpp b/test/unittest/coverage/sensor_basic_data_channel_test.cpp index fea4471a..56e47c44 100644 --- a/test/unittest/coverage/sensor_basic_data_channel_test.cpp +++ b/test/unittest/coverage/sensor_basic_data_channel_test.cpp @@ -140,7 +140,7 @@ HWTEST_F(SensorBasicDataChannelTest, ReceiveData_001, TestSize.Level1) SensorBasicDataChannel sensorChannel = SensorBasicDataChannel(); char buff[128] = {}; int32_t ret = sensorChannel.ReceiveData([this] (int32_t length) { - this->ReceiveData(length); + this->ReceiveData(length); }, static_cast(buff), sizeof(buff)); ASSERT_EQ(ret, ERROR); -- Gitee