From 6414ca8091bf94e47a6b574e7f41c7566b93e3ef Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 31 Dec 2025 15:01:17 +0800 Subject: [PATCH] =?utf8?q?1.=E8=A7=A3=E5=86=B3=E7=94=B5=E8=AF=9D=E7=95=8C?= =?utf8?q?=E9=9D=A2=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=202.=E8=A7=A3?= =?utf8?q?=E5=86=B3=E8=93=9D=E7=89=99=E7=94=B5=E8=AF=9D=E4=B8=8D=E8=83=BD?= =?utf8?q?=E6=8E=A5=E5=90=AC=E5=92=8C=E6=8C=82=E6=96=ADbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../makephone/include/MainCallingPresenter.h | 2 - .../nativeui/makephone/src/CallingView.cpp | 1 - .../makephone/src/MainCallingPresenter.cpp | 121 +++--------------- .../makephone/src/MainCallingView.cpp | 14 +- 4 files changed, 25 insertions(+), 113 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/include/MainCallingPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/include/MainCallingPresenter.h index 67d7e38f3..9883b057f 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/include/MainCallingPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/include/MainCallingPresenter.h @@ -26,9 +26,7 @@ public: ~MainCallingPresenter() override; void OnStart() override; - void OnPause() override; void OnResume() override; - void OnStop() override; static MainCallingPresenter *GetInstance(); void HonrsViewChange(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/CallingView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/CallingView.cpp index a55e4e38d..edd28acc0 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/CallingView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/CallingView.cpp @@ -386,7 +386,6 @@ void CallingView::text_updata_buf(const char *buf) const char*text_buf=label_number->GetText(); sprintf_s(new_buf,16,"%s%s",text_buf,buf); label_number->SetText(new_buf); - RootView::GetInstance()->Invalidate(); return; } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp index 654e5d4e0..f97e9a3a3 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp @@ -65,19 +65,11 @@ MainCallingPresenter *MainCallingPresenter::GetInstance() void MainCallingPresenter::OnStart() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::OnStart"); - - } -void MainCallingPresenter::OnPause(void) {} void MainCallingPresenter::OnResume(void) {} -void MainCallingPresenter::OnStop(void) -{ - RootView::GetInstance()->ClearOnKeyActListener(); - -} void MainCallingPresenter::HonrsViewChange() { @@ -191,14 +183,12 @@ bool MainCallingPresenter::HintsHandupClick() bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) { -#ifdef SUPPORT_CAT1_SERVICE UNUSED(event); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",view.GetViewId()); if (!InitPointerValue()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::InitPointerValue error"); return false; } - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",view.GetViewId()); if (strcmp(view.GetViewId(), "microphoneChange") == 0) { if (changeImage == 0) { changeImage = 1; @@ -212,16 +202,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) return false; view_->GetScreenView()->GetImageMicrophone()->SetSrc(PNG_230_MICROPHONE_CLOSE_IMAGE_PATH); } - if(CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) - { - SetMicMutecat1(true); - } - else - { - SetMicMute(true); - } - - + SetMicMute(true); } else { changeImage = 0; if(CallerLogModel::GetInstance()->GetCallStatus()) @@ -234,59 +215,25 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) return false; view_->GetScreenView()->GetImageMicrophone()->SetSrc(PNG_230_MICROPHONE_OPEN_IMAGE_PATH); } - if(CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) - { - SetMicMutecat1(false); - } - else - { - SetMicMute(false); - } + SetMicMute(false); } return true; } else if (strcmp(view.GetViewId(), "displayHandUp") == 0 || strcmp(view.GetViewId(), "callingHandUp") == 0|| strcmp(view.GetViewId(), "dialingHandUp") == 0) { if(strcmp(view.GetViewId(), "callingHandUp") == 0 || strcmp(view.GetViewId(), "dialingHandUp") == 0) { - if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) - { - - { - sos_falg_clean(); - } - - //cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - - cat1_call_hungup_timer(); - - - } - else - { - if (FinishCall() != 0) { + if (FinishCall() != 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::FinishCall() fail"); return false; - } } return true; } if (strcmp(view.GetViewId(), "displayHandUp") == 0) { - if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) - { - //cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - cat1_call_hungup_timer(); - return true; - //#endif - - } - else - { - // 手表拒接呼入来电 - if (RejectIncomingCall() != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::RejectIncomingCall() fail"); - return false; - } + // 手表拒接呼入来电 + if (RejectIncomingCall() != 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::RejectIncomingCall() fail"); + return false; } } if (FinishCall() != 0) { @@ -300,51 +247,21 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) HonrsViewChange(); } else if (strcmp(view.GetViewId(), "hintsHandup") == 0) { - - if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) - { - //cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - cat1_call_hungup_timer(); - - return true; - //#endif - - }else - { - if (!HintsHandupClick()) - { - return false; - } - } - - - - + if (!HintsHandupClick()) + { + return false; + } } else if (strcmp(view.GetViewId(), "answer") == 0) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::phone calling"); - if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MakephoneNotify 11111111 "); - cat1_call_answer(); - return true; - - //#endif - } - else - { - // 界面的显示和隐藏 - SetMicMute(false); - - // 手表接听呼入来电 - if (AcceptIncomingCall() != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::AcceptIncomingCall() fail"); - return false; - } - return true; + // 界面的显示和隐藏 + SetMicMute(false); + // 手表接听呼入来电 + if (AcceptIncomingCall() != 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::AcceptIncomingCall() fail"); + return false; } - - + return true; } else if ((strcmp(view.GetViewId(), "dial") == 0)) { @@ -443,7 +360,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) NativeAbility::GetInstance().EnterSlice(VIEW_BLUETOOTH_EARPHONE); } -#endif +// #endif return true; } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/MainCallingView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/MainCallingView.cpp index 8f16e2eb5..3f1db60c0 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/MainCallingView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/makephone/src/MainCallingView.cpp @@ -145,7 +145,6 @@ void MainCallingView::updataCallingname(void) if(displayView) displayView->updataCallingname(); - RootView::GetInstance()->Invalidate(); //callerDisplay->SetText(CallerLogModel::GetInstance()->Getphonename().c_str()); } @@ -158,8 +157,7 @@ void MainCallingView::update_headset_state(uint8_t data) { if(callView) { - callView->update_headset_state(data); - RootView::GetInstance()->Invalidate(); + callView->update_headset_state(data); } } @@ -175,13 +173,13 @@ void MainCallingView::OnStart() return; } - RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::MainCallingPresenter::GetInstance(); + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::MainCallingPresenter::GetInstance(); RootView::GetInstance()->SetOnKeyActListener(keyactListener); - RootView::GetInstance()->Add(displayGroup); - RootView::GetInstance()->Add(callingGroup); - RootView::GetInstance()->Add(screenGroup); - RootView::GetInstance()->Add(waitingGroup); + AddViewToRootContainer(displayGroup); + AddViewToRootContainer(callingGroup); + AddViewToRootContainer(screenGroup); + AddViewToRootContainer(waitingGroup); waitingGroup->SetVisible(false); callingGroup->SetVisible(false); -- 2.17.1