From: luozheng <1732036298@qq.com> Date: Wed, 3 Jun 2026 03:32:20 +0000 (+0800) Subject: 修复sos未设置号码时呼出sos界面退出不了问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F3433%2F1;p=mirrors%2FFD230.git 修复sos未设置号码时呼出sos界面退出不了问题 --- 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);