From: luozheng <1732036298@qq.com> Date: Mon, 11 Aug 2025 09:56:17 +0000 (+0800) Subject: 解决电话界面右滑退出死机问题 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~191 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=75b1a24c2f795e437ce79c9f2bdd3af24532adf8;p=mirrors%2FFD230.git 解决电话界面右滑退出死机问题 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/DialingMethodPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/DialingMethodPresenter.h index 8eb9dbd06..e6d7a51ad 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/DialingMethodPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/DialingMethodPresenter.h @@ -26,10 +26,6 @@ namespace OHOS virtual ~DialingMethodPresenter(); void OnStart() override; - void OnPause() override; - void OnResume() override; - void OnStop() override; - static DialingMethodPresenter *GetInstance(); private: diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/MainPhonePresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/MainPhonePresenter.h index 0ee5bbacc..bd64969cb 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/MainPhonePresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/MainPhonePresenter.h @@ -30,13 +30,7 @@ namespace OHOS virtual ~MainPhonePresenter(); void OnStart() override; - void OnPause() override; - void OnResume() override; - void OnStop() override; - - - static MainPhonePresenter *GetInstance(); private: diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/PhoneDirPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/PhoneDirPresenter.h index fba0444e4..06b42f574 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/PhoneDirPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/include/PhoneDirPresenter.h @@ -20,9 +20,6 @@ namespace OHOS virtual ~PhoneDirPresenter(); void OnStart() override; - void OnPause() override; - void OnResume() override; - void OnStop() override; static PhoneDirPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp index a76fd5021..9e1dc329b 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp @@ -46,23 +46,6 @@ namespace OHOS void DialingMethodPresenter::OnStart() { - Presenter::OnStart(); - } - - void DialingMethodPresenter::OnPause(void) - { - Presenter::OnPause(); - } - - void DialingMethodPresenter::OnResume(void) - { - Presenter::OnResume(); - } - - void DialingMethodPresenter::OnStop(void) - { - Presenter::OnStop(); - //set_address_number(NULL); } bool DialingMethodPresenter::OnClick(UIView &view, const ClickEvent &event) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodView.cpp index ec86a806d..086433ab2 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodView.cpp @@ -806,14 +806,13 @@ namespace OHOS void DialingMethodView::OnStart() { - View::OnStart(); DialingMethodViewInit(); init_no_HFP(); init_no_sim(); init_open_hfp(); // 增加按键监听 RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::DialingMethodPresenter::GetInstance(); - RootView::GetInstance()->SetOnKeyActListener(keyactListener); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); DialingMethodScrollView->Add(DialingMethodTitleLabel); @@ -827,7 +826,7 @@ namespace OHOS DialingMethodScrollView->Add(OPEN_HFP_ScrollView); - RootView::GetInstance()->Add(DialingMethodScrollView); + AddViewToRootContainer(DialingMethodScrollView); } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/MainPhonePresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/MainPhonePresenter.cpp index c6ee00a76..dde55b50a 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/MainPhonePresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/MainPhonePresenter.cpp @@ -50,22 +50,6 @@ namespace OHOS void MainPhonePresenter::OnStart() { - Presenter::OnStart(); - } - - void MainPhonePresenter::OnPause(void) - { - Presenter::OnPause(); - } - - void MainPhonePresenter::OnResume(void) - { - Presenter::OnResume(); - } - - void MainPhonePresenter::OnStop(void) - { - Presenter::OnStop(); } static uint8_t MainPhonePresenter_atoi(const char* buf) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/PhoneDirPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/PhoneDirPresenter.cpp index b35904285..ec297e0d7 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/PhoneDirPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/PhoneDirPresenter.cpp @@ -39,30 +39,10 @@ namespace OHOS void PhoneDirPresenter::OnStart() { - - Presenter::OnStart(); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PhoneDirPresenter::"); Set_onepage_address=false; } - void PhoneDirPresenter::OnPause(void) - { - - Presenter::OnPause(); - } - - void PhoneDirPresenter::OnResume(void) - { - - Presenter::OnResume(); - } - - void PhoneDirPresenter::OnStop(void) - { - - Presenter::OnStop(); - } - bool PhoneDirPresenter::OnDrag(UIView &view, const DragEvent &event) { diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/record/include/RecordingPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/record/include/RecordingPresenter.h index 59f0a36d2..289720e63 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/record/include/RecordingPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/record/include/RecordingPresenter.h @@ -135,9 +135,6 @@ namespace OHOS virtual ~RecordingPresenter(); void OnStart() override; - void OnPause() override; - void OnResume() override; - void OnStop() override; static RecordingPresenter *GetInstance(); int convertNumericDateTime(const char *numericDateTime, char *formattedDateTime); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/record/src/RecordingPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/record/src/RecordingPresenter.cpp index 3b9176657..76a34812d 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/record/src/RecordingPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/record/src/RecordingPresenter.cpp @@ -40,12 +40,13 @@ namespace OHOS RecordingPresenter::~RecordingPresenter() { + p_RecordingModel->ClearRecordingPlayer(); + StopRecord(); g_pRecordPresenter = nullptr; } RecordingPresenter *RecordingPresenter::GetInstance() { - return g_pRecordPresenter; } @@ -58,24 +59,6 @@ namespace OHOS // ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); } - void RecordingPresenter::OnPause(void) - { - Presenter::OnPause(); - } - - void RecordingPresenter::OnResume(void) - { - - Presenter::OnResume(); - } - - void RecordingPresenter::OnStop(void) - { - p_RecordingModel->ClearRecordingPlayer(); - StopRecord(); - // ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); - } - bool RecordingPresenter::OnDrag(UIView &view, const DragEvent &event) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnDrag"); diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp index 50645ddae..35f6dacef 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp @@ -74,7 +74,7 @@ UIView::~UIView() #endif ClearBackgroundBlur(); if (parent_ != nullptr) { - GRAPHIC_LOGE("UIView::~UIView failed, parent is not nullptr! Need to remove from parent component first"); + GRAPHIC_LOGE("UIView::~UIView failed, parent is not nullptr! Need to remove from parent component first,type:%d",GetViewType()); } if (transMap_ != nullptr) { delete transMap_;