From 74ca8e34bb98bfd4478500d54e3c81d9fd0e6a1c Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 3 Jun 2026 11:32:20 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8Dsos=E6=9C=AA=E8=AE=BE=E7=BD=AE?= =?utf8?q?=E5=8F=B7=E7=A0=81=E6=97=B6=E5=91=BC=E5=87=BAsos=E7=95=8C?= =?utf8?q?=E9=9D=A2=E9=80=80=E5=87=BA=E4=B8=8D=E4=BA=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../msg_center/src/notify/phone_crt.cpp | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/n9/service/msg_center/src/notify/phone_crt.cpp b/code/sdk/application/wearable/n9/service/msg_center/src/notify/phone_crt.cpp index f31d4b7b7..58f2b23a1 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/src/notify/phone_crt.cpp +++ b/code/sdk/application/wearable/n9/service/msg_center/src/notify/phone_crt.cpp @@ -164,6 +164,30 @@ void start_SOS_phone_dail(void) namespace OHOS { + class CallViewEventListener : public OHOS::UIView::OnClickListener + { + public: + static CallViewEventListener *GetInstance() + { + static CallViewEventListener callViewEventListener; + return &callViewEventListener; + } + bool OnClick(OHOS::UIView& view, const OHOS::ClickEvent& event) override + { + if (strcmp(view.GetViewId(), "SOS_FAIL") == 0) + { + NotificationManager::GetInstance()->StopNotify(); + } + return true; + } + private: + CallViewEventListener(){}; + ~CallViewEventListener(){}; + CallViewEventListener(const CallViewEventListener &) = delete; + const CallViewEventListener &operator=(const CallViewEventListener &) = delete; + }; + + void phone_VibratorFunc(void); uint8 call_stat=0; @@ -501,8 +525,8 @@ UIViewGroup* SOS_cant_dial(void) alarm_labelbutton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 44); alarm_labelbutton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - // UIView::OnClickListener *button1Click = static_cast(CallViewEventListener::GetInstance()); - // alarm_labelbutton->SetOnClickListener(button1Click); + UIView::OnClickListener *button1Click = static_cast(CallViewEventListener::GetInstance()); + alarm_labelbutton->SetOnClickListener(button1Click); SOSView->Add(alarm_labelbutton); alarm_labelbutton->SetVisible(true); -- 2.17.1