From 61d05b1827de6cddd96316088181a5fe9480ed7a Mon Sep 17 00:00:00 2001 From: mayunteng Date: Mon, 15 May 2023 11:28:28 +0000 Subject: [PATCH 1/2] Special modification Signed-off-by: mayunteng Change-Id: If67987c38cf877db14c4aa5f96b79a3ab9309131 --- .../coordination/src/js_event_target.cpp | 4 +- frameworks/js/napi/src/devicestatus_napi.cpp | 2 +- .../unittest/src/interaction_manager_test.cpp | 44 +++++++++-------- .../innerkits/include/idevicestatus_storage.h | 4 +- .../innerkits/include/stationary_data.h | 12 ++--- .../innerkits/include/stationary_manager.h | 8 ++-- libs/include/algorithm/algo_base.h | 22 ++++----- libs/src/devicestatus_data_parse.cpp | 2 +- .../src/device_status_algorithm_test.cpp | 2 +- .../include/coordination_event_manager.h | 8 ++-- .../include/coordination_softbus_adapter.h | 2 +- .../src/coordination_event_handler.cpp | 4 +- .../coordination/src/coordination_sm.cpp | 12 ++--- .../interaction/drag/include/drag_manager.h | 3 +- .../drag/include/state_change_notify.h | 6 +-- services/native/include/devicestatus_dumper.h | 2 +- .../unittest/src/devicestatus_agent_test.cpp | 47 ++++++++++++++++--- .../src/devicestatus_client_test.cpp | 21 +++++++-- utils/common/include/devicestatus_define.h | 7 --- utils/common/src/devicestatus_permission.cpp | 4 +- utils/ipc/include/net_packet.h | 2 +- 21 files changed, 126 insertions(+), 92 deletions(-) mode change 100755 => 100644 frameworks/js/napi/interaction/coordination/src/js_event_target.cpp mode change 100755 => 100644 services/native/include/devicestatus_dumper.h diff --git a/frameworks/js/napi/interaction/coordination/src/js_event_target.cpp b/frameworks/js/napi/interaction/coordination/src/js_event_target.cpp old mode 100755 new mode 100644 index 2142af727..71e87022d --- a/frameworks/js/napi/interaction/coordination/src/js_event_target.cpp +++ b/frameworks/js/napi/interaction/coordination/src/js_event_target.cpp @@ -37,7 +37,9 @@ JsEventTarget::JsEventTarget() { CALL_DEBUG_ENTER; auto ret = coordinationListener_.insert({ COOPERATE, std::vector>() }); - CK(ret.second, DeviceStatus::VAL_NOT_EXP); + if (!ret.second) { + FI_HILOGW("Failed to insert, errCode:%{public}d", static_cast(DeviceStatus::VAL_NOT_EXP)); + } } void JsEventTarget::EmitJsPrepare(sptr cb, const std::string& deviceId, CoordinationMessage msg) diff --git a/frameworks/js/napi/src/devicestatus_napi.cpp b/frameworks/js/napi/src/devicestatus_napi.cpp index b6509d5c9..db837de1d 100644 --- a/frameworks/js/napi/src/devicestatus_napi.cpp +++ b/frameworks/js/napi/src/devicestatus_napi.cpp @@ -44,7 +44,7 @@ std::map> DeviceStatusNapi::callbackMap_; napi_ref DeviceStatusNapi::devicestatusValueRef_ = nullptr; struct ResponseEntity { - OnChangedValue value; + OnChangedValue value { VALUE_INVALID }; }; void DeviceStatusCallback::OnDeviceStatusChanged(const Data& devicestatusData) diff --git a/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp b/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp index afd106187..0251e34d1 100644 --- a/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp +++ b/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp @@ -130,9 +130,7 @@ void InteractionManagerTest::SetUpTestCase() g_deviceTouchId = mouseAndTouch.second; } -void InteractionManagerTest::SetUp() -{ -} +void InteractionManagerTest::SetUp() {} void InteractionManagerTest::TearDown() { @@ -745,11 +743,11 @@ HWTEST_F(InteractionManagerTest, GetDragTargetPid_Touch, TestSize.Level1) } /** -* @tc.name: InteractionManagerTest_TouchEventDispatch -* @tc.desc: Get Drag Target Pid -* @tc.type: FUNC -* @tc.require: -*/ + * @tc.name: InteractionManagerTest_TouchEventDispatch + * @tc.desc: Get Drag Target Pid + * @tc.type: FUNC + * @tc.require: + */ HWTEST_F(InteractionManagerTest, TouchEventDispatch, TestSize.Level1) { CALL_TEST_DEBUG; @@ -782,11 +780,11 @@ HWTEST_F(InteractionManagerTest, TouchEventDispatch, TestSize.Level1) } /** -* @tc.name: InteractionManagerTest_MouseEventDispatch -* @tc.desc: Get Drag Target Pid -* @tc.type: FUNC -* @tc.require: -*/ + * @tc.name: InteractionManagerTest_MouseEventDispatch + * @tc.desc: Get Drag Target Pid + * @tc.type: FUNC + * @tc.require: + */ HWTEST_F(InteractionManagerTest, MouseEventDispatch, TestSize.Level1) { CALL_TEST_DEBUG; @@ -818,11 +816,11 @@ HWTEST_F(InteractionManagerTest, MouseEventDispatch, TestSize.Level1) } /** -* @tc.name: InteractionManagerTest_SetDragWindowVisible -* @tc.desc: Set Drag Window Visible -* @tc.type: FUNC -* @tc.require: -*/ + * @tc.name: InteractionManagerTest_SetDragWindowVisible + * @tc.desc: Set Drag Window Visible + * @tc.type: FUNC + * @tc.require: + */ HWTEST_F(InteractionManagerTest, InteractionManagerTest_SetDragWindowVisible, TestSize.Level1) { CALL_TEST_DEBUG; @@ -835,11 +833,11 @@ HWTEST_F(InteractionManagerTest, InteractionManagerTest_SetDragWindowVisible, Te } /** -* @tc.name: InteractionManagerTest_GetShadowOffset -* @tc.desc: Get Shadow Offset -* @tc.type: FUNC -* @tc.require: -*/ + * @tc.name: InteractionManagerTest_GetShadowOffset + * @tc.desc: Get Shadow Offset + * @tc.type: FUNC + * @tc.require: + */ HWTEST_F(InteractionManagerTest, InteractionManagerTest_GetShadowOffset, TestSize.Level1) { CALL_TEST_DEBUG; diff --git a/interfaces/innerkits/include/idevicestatus_storage.h b/interfaces/innerkits/include/idevicestatus_storage.h index d254f55e8..945b6b294 100644 --- a/interfaces/innerkits/include/idevicestatus_storage.h +++ b/interfaces/innerkits/include/idevicestatus_storage.h @@ -26,8 +26,8 @@ namespace DeviceStatus { class IdevicestatusStorage : public IRemoteBroker { public: struct DeviceStatusRecord { - Type type; - OnChangedValue value; + Type type { TYPE_INVALID }; + OnChangedValue value { VALUE_INVALID }; std::string date; std::string time; }; diff --git a/interfaces/innerkits/include/stationary_data.h b/interfaces/innerkits/include/stationary_data.h index 24648b373..242f057da 100644 --- a/interfaces/innerkits/include/stationary_data.h +++ b/interfaces/innerkits/include/stationary_data.h @@ -77,11 +77,11 @@ enum Action { }; struct Data { - Type type; - OnChangedValue value; - Status status; - Action action; - double movement; + Type type { TYPE_INVALID }; + OnChangedValue value { VALUE_INVALID }; + Status status { STATUS_INVALID }; + Action action { ACTION_INVALID }; + double movement { 0.0 }; bool operator !=(const Data& r) const { @@ -94,7 +94,7 @@ struct Data { }; typedef struct DeviceStatusJsonData { - int32_t type; + int32_t type { -1 }; std::string json; }DeviceStatusJsonD; diff --git a/interfaces/innerkits/include/stationary_manager.h b/interfaces/innerkits/include/stationary_manager.h index 23003cd5e..e5f2bd91c 100644 --- a/interfaces/innerkits/include/stationary_manager.h +++ b/interfaces/innerkits/include/stationary_manager.h @@ -32,10 +32,10 @@ class StationaryManager { public: /** - * @brief 获取StationaryManager实例。 - * @return StationaryManager实例。 - * @since 9 - */ + * @brief 获取StationaryManager实例。 + * @return StationaryManager实例。 + * @since 9 + */ static StationaryManager *GetInstance(); /** diff --git a/libs/include/algorithm/algo_base.h b/libs/include/algorithm/algo_base.h index 344ddebd2..166bc2305 100644 --- a/libs/include/algorithm/algo_base.h +++ b/libs/include/algorithm/algo_base.h @@ -55,22 +55,22 @@ protected: }; struct { - float x; - float y; - float z; - double resultantAcc; - double pitch; - double roll; + float x { 0.0 }; + float y { 0.0 }; + float z { 0.0 }; + double resultantAcc { 0.0 }; + double pitch { 0.0 }; + double roll { 0.0 }; } algoPara_ {}; int32_t state_ = UNKNOWN; int32_t counter_ = COUNTER_THRESHOLD; - Data reportInfo_ {TYPE_INVALID, - VALUE_INVALID, - STATUS_INVALID, - ACTION_INVALID, - 0.0}; + Data reportInfo_ { TYPE_INVALID, + VALUE_INVALID, + STATUS_INVALID, + ACTION_INVALID, + 0.0 }; SensorCallback algoCallback_; std::shared_ptr callback_ { nullptr }; diff --git a/libs/src/devicestatus_data_parse.cpp b/libs/src/devicestatus_data_parse.cpp index 16ae87113..9d21ed902 100644 --- a/libs/src/devicestatus_data_parse.cpp +++ b/libs/src/devicestatus_data_parse.cpp @@ -135,7 +135,7 @@ std::string DeviceStatusDataParse::ReadJsonFile(const std::string &filePath) int32_t DeviceStatusDataParse::GetFileSize(const std::string& filePath) { - struct stat statbuf = {0}; + struct stat statbuf = { 0 }; if (stat(filePath.c_str(), &statbuf) != 0) { DEV_HILOGE(SERVICE, "Get file size error"); return INVALID_FILE_SIZE; diff --git a/libs/test/unittest/src/device_status_algorithm_test.cpp b/libs/test/unittest/src/device_status_algorithm_test.cpp index b16947368..8fc9ad4b2 100644 --- a/libs/test/unittest/src/device_status_algorithm_test.cpp +++ b/libs/test/unittest/src/device_status_algorithm_test.cpp @@ -98,7 +98,7 @@ HWTEST_F(DeviceStatusAlgorithmTest, DeviceStatusAlgorithmTest002, TestSize.Level GTEST_LOG_(INFO) << "DeviceStatusAlgorithmTest002 end"; } -/* +/** * @tc.name: DeviceStatusVeriticalTest * @tc.desc: test devicestatus Veritical Algorithm * @tc.type: FUNC diff --git a/services/interaction/coordination/include/coordination_event_manager.h b/services/interaction/coordination/include/coordination_event_manager.h index 4131ba243..88bf9ca87 100644 --- a/services/interaction/coordination/include/coordination_event_manager.h +++ b/services/interaction/coordination/include/coordination_event_manager.h @@ -41,12 +41,12 @@ public: struct EventInfo : public RefBase { EventType type; - SessionPtr sess; - MessageId msgId; - int32_t userData; + SessionPtr sess { nullptr }; + MessageId msgId { MessageId::INVALID }; + int32_t userData { -1 }; std::string deviceId; CoordinationMessage msg; - bool state; + bool state { false }; }; void AddCoordinationEvent(sptr event); diff --git a/services/interaction/coordination/include/coordination_softbus_adapter.h b/services/interaction/coordination/include/coordination_softbus_adapter.h index a2162d83b..d11dc4ccf 100644 --- a/services/interaction/coordination/include/coordination_softbus_adapter.h +++ b/services/interaction/coordination/include/coordination_softbus_adapter.h @@ -42,7 +42,7 @@ public: struct DataPacket { MessageId messageId; - uint32_t dataLen; + uint32_t dataLen { 0 }; uint8_t data[0]; }; int32_t StartRemoteCoordination(const std::string &localNetworkId, const std::string &remoteNetworkId); diff --git a/services/interaction/coordination/src/coordination_event_handler.cpp b/services/interaction/coordination/src/coordination_event_handler.cpp index 90aa2ea95..7fa2d32c4 100644 --- a/services/interaction/coordination/src/coordination_event_handler.cpp +++ b/services/interaction/coordination/src/coordination_event_handler.cpp @@ -25,9 +25,7 @@ constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, MSDP_DOMAIN_ID, "Coord } // namespace CoordinationEventHandler::CoordinationEventHandler( const std::shared_ptr &runner) - : AppExecFwk::EventHandler(runner) -{ -} + : AppExecFwk::EventHandler(runner) {} bool CoordinationEventHandler::ProxyPostTask(const Callback &callback, int64_t delayTime) { diff --git a/services/interaction/coordination/src/coordination_sm.cpp b/services/interaction/coordination/src/coordination_sm.cpp index 3afe9df8a..84d3290cb 100644 --- a/services/interaction/coordination/src/coordination_sm.cpp +++ b/services/interaction/coordination/src/coordination_sm.cpp @@ -808,13 +808,9 @@ void CoordinationSM::InterceptorConsumer::OnInputEvent(std::shared_ptr axisEvent) const -{ -} +void CoordinationSM::InterceptorConsumer::OnInputEvent(std::shared_ptr axisEvent) const {} -void CoordinationSM::MonitorConsumer::OnInputEvent(std::shared_ptr keyEvent) const -{ -} +void CoordinationSM::MonitorConsumer::OnInputEvent(std::shared_ptr keyEvent) const {} void CoordinationSM::MonitorConsumer::OnInputEvent(std::shared_ptr pointerEvent) const { @@ -842,9 +838,7 @@ void CoordinationSM::MonitorConsumer::OnInputEvent(std::shared_ptr axisEvent) const -{ -} +void CoordinationSM::MonitorConsumer::OnInputEvent(std::shared_ptr axisEvent) const {} void CoordinationSM::RegisterStateChange(CooStateChangeType type, std::function callback) diff --git a/services/interaction/drag/include/drag_manager.h b/services/interaction/drag/include/drag_manager.h index 8ef870ae8..bcce1bcab 100644 --- a/services/interaction/drag/include/drag_manager.h +++ b/services/interaction/drag/include/drag_manager.h @@ -35,8 +35,7 @@ namespace Msdp { namespace DeviceStatus { class DragManager : public IDragManager { public: - DragManager() - {} + DragManager() {} ~DragManager() = default; DISALLOW_COPY_AND_MOVE(DragManager); diff --git a/services/interaction/drag/include/state_change_notify.h b/services/interaction/drag/include/state_change_notify.h index 714780af3..58f3811ad 100644 --- a/services/interaction/drag/include/state_change_notify.h +++ b/services/interaction/drag/include/state_change_notify.h @@ -32,9 +32,9 @@ public: ~StateChangeNotify() = default; struct MessageInfo { - MessageId msgId; - SessionPtr session; - DragState state; + MessageId msgId { MessageId::INVALID }; + SessionPtr session { nullptr }; + DragState state { DragState::ERROR }; bool operator==(std::shared_ptr info) { if (info == nullptr || info->session == nullptr) { diff --git a/services/native/include/devicestatus_dumper.h b/services/native/include/devicestatus_dumper.h old mode 100755 new mode 100644 index f170e2530..2c15106d9 --- a/services/native/include/devicestatus_dumper.h +++ b/services/native/include/devicestatus_dumper.h @@ -42,7 +42,7 @@ struct AppInfo { int32_t pid {}; Security::AccessToken::AccessTokenID tokenId; std::string packageName; - Type type; + Type type { TYPE_INVALID }; sptr callback { nullptr }; }; struct DeviceStatusRecord { diff --git a/services/native/test/unittest/src/devicestatus_agent_test.cpp b/services/native/test/unittest/src/devicestatus_agent_test.cpp index 8ff0f499c..56bee969b 100644 --- a/services/native/test/unittest/src/devicestatus_agent_test.cpp +++ b/services/native/test/unittest/src/devicestatus_agent_test.cpp @@ -143,6 +143,11 @@ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest003, TestSize.Level1) GTEST_LOG_(INFO) << "DeviceStatusAgentTest003 end"; } +/** + * @tc.name: DeviceStatusAgentTest004 + * @tc.desc: test subscribing lid open event + * @tc.type: FUNC + */ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest004, TestSize.Level1) { GTEST_LOG_(INFO) << "DeviceStatusAgentTest004 start"; @@ -159,9 +164,14 @@ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest004, TestSize.Level1) GTEST_LOG_(INFO) << "DeviceStatusAgentTest004 end"; } +/** + * @tc.name: DeviceStatusAgentTest005 + * @tc.desc: test subscribing lid open event + * @tc.type: FUNC + */ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest005, TestSize.Level1) { - GTEST_LOG_(INFO) << "DeviceStatusAgentTest007 start"; + GTEST_LOG_(INFO) << "DeviceStatusAgentTest005 start"; std::shared_ptr agentEvent = std::make_shared(); int32_t ret = g_agent1->SubscribeAgentEvent(Type::TYPE_INVALID, ActivityEvent::ENTER_EXIT, @@ -174,9 +184,14 @@ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest005, TestSize.Level1) GTEST_LOG_(INFO) << "DeviceStatusAgentTest005 end"; } +/** + * @tc.name: DeviceStatusAgentTest006 + * @tc.desc: test subscribing lid open event + * @tc.type: FUNC + */ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest006, TestSize.Level1) { - GTEST_LOG_(INFO) << "DeviceStatusAgentTest008 start"; + GTEST_LOG_(INFO) << "DeviceStatusAgentTest006 start"; std::shared_ptr agentEvent = std::make_shared(); int32_t ret = g_agent1->SubscribeAgentEvent(static_cast(10), ActivityEvent::ENTER_EXIT, @@ -189,9 +204,14 @@ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest006, TestSize.Level1) GTEST_LOG_(INFO) << "DeviceStatusAgentTest006 end"; } +/** + * @tc.name: DeviceStatusAgentTest007 + * @tc.desc: test subscribing lid open event for 2 client + * @tc.type: FUNC + */ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest007, TestSize.Level1) { - GTEST_LOG_(INFO) << "DeviceStatusAgentTest009 start"; + GTEST_LOG_(INFO) << "DeviceStatusAgentTest007 start"; g_agentTest = Type::TYPE_LID_OPEN; Type type = g_agentTest; std::shared_ptr agentEvent = @@ -211,9 +231,14 @@ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest007, TestSize.Level1) GTEST_LOG_(INFO) << "DeviceStatusAgentTest007 end"; } +/** + * @tc.name: DeviceStatusAgentTest008 + * @tc.desc: test subscribing lid open event + * @tc.type: FUNC + */ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest008, TestSize.Level1) { - GTEST_LOG_(INFO) << "DeviceStatusAgentTest010 start"; + GTEST_LOG_(INFO) << "DeviceStatusAgentTest008 start"; std::shared_ptr agentEvent = nullptr; int32_t ret = g_agent1->SubscribeAgentEvent(Type::TYPE_LID_OPEN, ActivityEvent::ENTER_EXIT, ReportLatencyNs::LONG, agentEvent); @@ -222,9 +247,14 @@ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest008, TestSize.Level1) GTEST_LOG_(INFO) << "DeviceStatusAgentTest008 end"; } +/** + * @tc.name: DeviceStatusAgentTest009 + * @tc.desc: test subscribing lid open event for 3 client + * @tc.type: FUNC + */ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest009, TestSize.Level1) { - GTEST_LOG_(INFO) << "DeviceStatusAgentTest013 start"; + GTEST_LOG_(INFO) << "DeviceStatusAgentTest009 start"; g_agentTest = Type::TYPE_HORIZONTAL_POSITION; Type type = g_agentTest; std::shared_ptr agentEvent = @@ -250,9 +280,14 @@ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest009, TestSize.Level1) GTEST_LOG_(INFO) << "DeviceStatusAgentTest009 end"; } +/** + * @tc.name: DeviceStatusAgentTest0010 + * @tc.desc: test subscribing lid open event + * @tc.type: FUNC + */ HWTEST_F (DeviceStatusAgentTest, DeviceStatusAgentTest010, TestSize.Level1) { - GTEST_LOG_(INFO) << "DeviceStatusAgentTest014 start"; + GTEST_LOG_(INFO) << "DeviceStatusAgentTest010 start"; g_agentTest = Type::TYPE_LID_OPEN; Type type = g_agentTest; std::shared_ptr agentEvent = diff --git a/test/systemtest/src/devicestatus_client_test.cpp b/test/systemtest/src/devicestatus_client_test.cpp index 53782ee42..2e279f476 100644 --- a/test/systemtest/src/devicestatus_client_test.cpp +++ b/test/systemtest/src/devicestatus_client_test.cpp @@ -165,7 +165,7 @@ HWTEST_F(DeviceStatusClientTest, DeviceStatusCallbackTest006, TestSize.Level0) } /** - * @tc.name: GetDeviceStatusDataTest + * @tc.name: GetDeviceStatusDataTest007 * @tc.desc: test get devicestatus data in proxy * @tc.type: FUNC */ @@ -184,7 +184,7 @@ HWTEST_F(DeviceStatusClientTest, GetDeviceStatusDataTest007, TestSize.Level0) } /** - * @tc.name: GetDeviceStatusDataTest + * @tc.name: GetDeviceStatusDataTest008 * @tc.desc: test get devicestatus data in proxy * @tc.type: FUNC */ @@ -203,7 +203,7 @@ HWTEST_F(DeviceStatusClientTest, GetDeviceStatusDataTest008, TestSize.Level0) } /** - * @tc.name: GetDeviceStatusDataTest + * @tc.name: GetDeviceStatusDataTest009 * @tc.desc: test get devicestatus data in proxy * @tc.type: FUNC */ @@ -221,6 +221,11 @@ HWTEST_F(DeviceStatusClientTest, GetDeviceStatusDataTest009, TestSize.Level0) DEV_HILOGD(SERVICE, "GetDeviceStatusDataTest009 end"); } +/** + * @tc.name: GetDeviceStatusDataTest010 + * @tc.desc: test get devicestatus data in proxy + * @tc.type: FUNC + */ HWTEST_F(DeviceStatusClientTest, GetDeviceStatusDataTest010, TestSize.Level0) { GTEST_LOG_(INFO) << "GetDeviceStatusDataTest010 Enter"; @@ -235,6 +240,11 @@ HWTEST_F(DeviceStatusClientTest, GetDeviceStatusDataTest010, TestSize.Level0) GTEST_LOG_(INFO) << "GetDeviceStatusDataTest010 end"; } +/** + * @tc.name: GetDeviceStatusDataTest011 + * @tc.desc: test get devicestatus data in proxy + * @tc.type: FUNC + */ HWTEST_F(DeviceStatusClientTest, GetDeviceStatusDataTest011, TestSize.Level0) { GTEST_LOG_(INFO) << "GetDeviceStatusDataTest011 Enter"; @@ -249,6 +259,11 @@ HWTEST_F(DeviceStatusClientTest, GetDeviceStatusDataTest011, TestSize.Level0) GTEST_LOG_(INFO) << "GetDeviceStatusDataTest011 end"; } +/** + * @tc.name: GetDeviceStatusDataTest012 + * @tc.desc: test get devicestatus data in proxy + * @tc.type: FUNC + */ HWTEST_F(DeviceStatusClientTest, GetDeviceStatusDataTest012, TestSize.Level0) { GTEST_LOG_(INFO) << "GetDeviceStatusDataTest012 Enter"; diff --git a/utils/common/include/devicestatus_define.h b/utils/common/include/devicestatus_define.h index 20a6251f0..c4074b69b 100644 --- a/utils/common/include/devicestatus_define.h +++ b/utils/common/include/devicestatus_define.h @@ -104,13 +104,6 @@ namespace DeviceStatus { } \ } while (0) -#define CK(cond, ec) \ - do { \ - if (!(cond)) { \ - FI_HILOGE("CK(%{public}s), errCode:%{public}d", #cond, ec); \ - } \ - } while (0) - #define CHK_PID_AND_TID() \ do { \ FI_HILOGD("%{public}s, (%{public}d), pid:%{public}d threadId:%{public}" PRIu64, \ diff --git a/utils/common/src/devicestatus_permission.cpp b/utils/common/src/devicestatus_permission.cpp index 3e2f7510c..9a9ffa38c 100644 --- a/utils/common/src/devicestatus_permission.cpp +++ b/utils/common/src/devicestatus_permission.cpp @@ -21,7 +21,7 @@ namespace OHOS { namespace Msdp { namespace DeviceStatus { -bool DeviceStatusPermission::CheckCallingPermission(const string &permissionName) +bool DeviceStatusPermission::CheckCallingPermission(const std::string &permissionName) { Security::AccessToken::AccessTokenID callingToken = IPCSkeleton::GetCallingTokenID(); int32_t auth = Security::AccessToken::AccessTokenKit::VerifyAccessToken(callingToken, permissionName); @@ -33,7 +33,7 @@ bool DeviceStatusPermission::CheckCallingPermission(const string &permissionName } } -string DeviceStatusPermission::GetAppInfo() +std::string DeviceStatusPermission::GetAppInfo() { pid_t pid = IPCSkeleton::GetCallingPid(); uid_t uid = IPCSkeleton::GetCallingUid(); diff --git a/utils/ipc/include/net_packet.h b/utils/ipc/include/net_packet.h index 3e82ea8bc..e2e6f355a 100644 --- a/utils/ipc/include/net_packet.h +++ b/utils/ipc/include/net_packet.h @@ -20,7 +20,7 @@ #pragma pack(1) using PACKHEAD = struct PackHead { - MessageId idMsg; + MessageId idMsg { MessageId::INVALID }; int32_t size; }; #pragma pack() -- Gitee From 043f8d9bc105663eaa5823891c67ad455057bf7b Mon Sep 17 00:00:00 2001 From: mayunteng Date: Tue, 16 May 2023 08:18:46 +0000 Subject: [PATCH 2/2] Special modification Signed-off-by: mayunteng Change-Id: I0b57b9d2527620a9c8408267d6f17443225fca02 --- .../coordination/include/coordination_event_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/interaction/coordination/include/coordination_event_manager.h b/services/interaction/coordination/include/coordination_event_manager.h index 88bf9ca87..df1340964 100644 --- a/services/interaction/coordination/include/coordination_event_manager.h +++ b/services/interaction/coordination/include/coordination_event_manager.h @@ -40,12 +40,12 @@ public: enum EventType { LISTENER, ENABLE, START, STOP, STATE }; struct EventInfo : public RefBase { - EventType type; + EventType type { LISTENER }; SessionPtr sess { nullptr }; MessageId msgId { MessageId::INVALID }; int32_t userData { -1 }; std::string deviceId; - CoordinationMessage msg; + CoordinationMessage msg { CoordinationMessage::PREPARE }; bool state { false }; }; -- Gitee