From 9380135d9cba90bd39ba7bb42226b778229de360 Mon Sep 17 00:00:00 2001 From: zhujc0606 Date: Thu, 6 Apr 2023 17:22:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?IssueNo:state=5Fregistry=20=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E4=BD=93=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: state_registry Sig: SIG_Telephony Feature or Bugfix:state_registry 结构体整改 Binary Source: No Signed-off-by: zhujc0606 Change-Id: Ib7a235346ed0b752f281bfa740ed91156ba46f77 --- frameworks/js/napi/include/event_listener.h | 8 ++++---- .../js/napi/include/napi_state_registry.h | 2 +- frameworks/js/napi/include/update_contexts.h | 2 +- frameworks/js/napi/include/update_infos.h | 20 +++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frameworks/js/napi/include/event_listener.h b/frameworks/js/napi/include/event_listener.h index a22960b..06be4a5 100644 --- a/frameworks/js/napi/include/event_listener.h +++ b/frameworks/js/napi/include/event_listener.h @@ -24,10 +24,10 @@ namespace OHOS { namespace Telephony { struct EventListener { - napi_env env; - TelephonyUpdateEventType eventType; - int32_t slotId; - napi_ref callbackRef; + napi_env env = nullptr; + TelephonyUpdateEventType eventType = TelephonyUpdateEventType::EVENT_CALL_STATE_UPDATE; + int32_t slotId = 0; + napi_ref callbackRef = nullptr; std::shared_ptr isDeleting = nullptr; }; } // namespace Telephony diff --git a/frameworks/js/napi/include/napi_state_registry.h b/frameworks/js/napi/include/napi_state_registry.h index b38c4ab..6652a24 100644 --- a/frameworks/js/napi/include/napi_state_registry.h +++ b/frameworks/js/napi/include/napi_state_registry.h @@ -67,7 +67,7 @@ struct ObserverContext : BaseContext { int32_t slotId = DEFAULT_SIM_SLOT_ID; TelephonyUpdateEventType eventType = TelephonyUpdateEventType::NONE_EVENT_TYPE; int32_t errorCode = 0; - std::list removeListenerList; + std::list removeListenerList {}; }; } // namespace Telephony } // namespace OHOS diff --git a/frameworks/js/napi/include/update_contexts.h b/frameworks/js/napi/include/update_contexts.h index 4d4a966..dd20ddf 100644 --- a/frameworks/js/napi/include/update_contexts.h +++ b/frameworks/js/napi/include/update_contexts.h @@ -48,7 +48,7 @@ struct SignalListContext : EventListener { }; struct NetworkStateContext : EventListener { - sptr networkState; + sptr networkState = nullptr; NetworkStateContext &operator=(const NetworkStateUpdateInfo &info) { networkState = info.networkState_; diff --git a/frameworks/js/napi/include/update_infos.h b/frameworks/js/napi/include/update_infos.h index ef35aa0..e9982df 100644 --- a/frameworks/js/napi/include/update_infos.h +++ b/frameworks/js/napi/include/update_infos.h @@ -34,20 +34,20 @@ struct UpdateInfo { }; struct CallStateUpdateInfo : public UpdateInfo { - int32_t callState_; - std::u16string phoneNumber_; + int32_t callState_ = 0; + std::u16string phoneNumber_ = u""; CallStateUpdateInfo(int32_t slotId, int32_t callStateParam, std::u16string phoneNumberParam) : UpdateInfo(slotId), callState_(callStateParam), phoneNumber_(phoneNumberParam) {} }; struct SignalUpdateInfo : public UpdateInfo { - std::vector> signalInfoList_; + std::vector> signalInfoList_ {}; SignalUpdateInfo(int32_t slotId, std::vector> infoList) : UpdateInfo(slotId), signalInfoList_(infoList) {} }; struct NetworkStateUpdateInfo : public UpdateInfo { - sptr networkState_; + sptr networkState_ = nullptr; NetworkStateUpdateInfo(int32_t slotId, sptr state) : UpdateInfo(slotId), networkState_(state) {} }; @@ -60,30 +60,30 @@ struct SimStateUpdateInfo : public UpdateInfo { }; struct CellInfomationUpdate : public UpdateInfo { - std::vector> cellInfoVec_; + std::vector> cellInfoVec_ {}; CellInfomationUpdate(int32_t slotId, const std::vector> &cellInfo) : UpdateInfo(slotId), cellInfoVec_(cellInfo) {} }; struct CellularDataConnectState : public UpdateInfo { - int32_t dataState_; - int32_t networkType_; + int32_t dataState_ = 0; + int32_t networkType_ = 0; CellularDataConnectState(int32_t slotId, int32_t dataState, int32_t networkType) : UpdateInfo(slotId), dataState_(dataState), networkType_(networkType) {} }; struct CellularDataFlowUpdate : public UpdateInfo { - int32_t flowType_; + int32_t flowType_ = 0; CellularDataFlowUpdate(int32_t slotId, int32_t flowType) : UpdateInfo(slotId), flowType_(flowType) {} }; struct CfuIndicatorUpdate : public UpdateInfo { - bool cfuResult_; + bool cfuResult_ = false; CfuIndicatorUpdate(int32_t slotId, bool cfuResult) : UpdateInfo(slotId), cfuResult_(cfuResult) {} }; struct VoiceMailMsgIndicatorUpdate : public UpdateInfo { - bool voiceMailMsgResult_; + bool voiceMailMsgResult_ = false; VoiceMailMsgIndicatorUpdate(int32_t slotId, bool voiceMailMsgResult) : UpdateInfo(slotId), voiceMailMsgResult_(voiceMailMsgResult) {} }; -- Gitee From df062214f0cd39b365239f57da6d69471335d2c1 Mon Sep 17 00:00:00 2001 From: zhujc0606 Date: Sat, 15 Apr 2023 17:13:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?IssueNo:state=5Fregistry=20=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E4=BD=93=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: state_registry Sig: SIG_Telephony Feature or Bugfix:state_registry Binary Source: No Signed-off-by: zhujc0606 Change-Id: Iab26713afc4448ca851a5cc92fcab4647c491ef9 --- frameworks/js/napi/include/event_listener.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/js/napi/include/event_listener.h b/frameworks/js/napi/include/event_listener.h index 06be4a5..a266861 100644 --- a/frameworks/js/napi/include/event_listener.h +++ b/frameworks/js/napi/include/event_listener.h @@ -25,7 +25,7 @@ namespace OHOS { namespace Telephony { struct EventListener { napi_env env = nullptr; - TelephonyUpdateEventType eventType = TelephonyUpdateEventType::EVENT_CALL_STATE_UPDATE; + TelephonyUpdateEventType eventType = TelephonyUpdateEventType::NONE_EVENT_TYPE; int32_t slotId = 0; napi_ref callbackRef = nullptr; std::shared_ptr isDeleting = nullptr; -- Gitee