From: luozheng <1732036298@qq.com> Date: Wed, 14 Jan 2026 03:49:38 +0000 (+0800) Subject: 解决拨号界面按键监听息屏失效问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=6da1f1937db356bda660d70b58b4f1702fbfb08a;p=mirrors%2FFD230.git 解决拨号界面按键监听息屏失效问题 --- diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/include/PhoneCallPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/include/PhoneCallPresenter.h index 66fc97493..4dd464f13 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/include/PhoneCallPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/include/PhoneCallPresenter.h @@ -22,9 +22,7 @@ namespace OHOS virtual ~PhoneCallPresenter(); void OnStart() override; - void OnPause() override; void OnResume() override; - void OnStop() override; void Invalidate(); void UpdatePhoneNumberView(const std::string &number); static PhoneCallPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp index 3f7d003ac..7d90ee335 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp @@ -43,26 +43,11 @@ namespace OHOS void PhoneCallPresenter::OnStart() { - - Presenter::OnStart(); - } - - void PhoneCallPresenter::OnPause(void) - { - - Presenter::OnPause(); } void PhoneCallPresenter::OnResume(void) { - - Presenter::OnResume(); - } - - void PhoneCallPresenter::OnStop(void) - { - - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); } bool PhoneCallPresenter::OnDrag(UIView &view, const DragEvent &event) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/src/PhoneCallView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/src/PhoneCallView.cpp index e16416ea5..0c7891421 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/src/PhoneCallView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/phone/src/PhoneCallView.cpp @@ -262,7 +262,7 @@ namespace OHOS Init(); // 增加按键监听 RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::PhoneCallPresenter::GetInstance(); - RootView::GetInstance()->SetOnKeyActListener(keyactListener); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); }