From 8035806e01504e1f0bf822cf032bdd62725fe33a Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Sat, 12 Oct 2024 17:24:45 +0800 Subject: [PATCH] =?utf8?q?=E6=8B=A8=E5=8F=B7=E5=AE=8C=E5=96=84=E9=83=A8?= =?utf8?q?=E5=88=86=E5=8F=AF=E8=83=BDBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../phone/src/DialingMethodPresenter.cpp | 6 +++--- .../nativeui/phone/src/MainPhonePresenter.cpp | 18 ++++++++++++++++-- .../nativeui/phone/src/MainPhoneView.cpp | 2 +- .../nativeui/phone/src/PhoneCallPresenter.cpp | 6 ++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/DialingMethodPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/DialingMethodPresenter.cpp index 10f51439c..2ee861d0e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/DialingMethodPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/DialingMethodPresenter.cpp @@ -56,7 +56,7 @@ namespace OHOS void DialingMethodPresenter::OnStop(void) { Presenter::OnStop(); - set_address_number(NULL); + //set_address_number(NULL); } bool DialingMethodPresenter::OnClick(UIView &view, const ClickEvent &event) @@ -174,7 +174,7 @@ namespace OHOS { NativeAbility::GetInstance().Back(); TelephonyInitInterface::X_DRAG_FLAG = false; - set_address_number(NULL); + //set_address_number(NULL); } } @@ -192,7 +192,7 @@ namespace OHOS if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { NativeAbility::GetInstance().Back(); - set_address_number(NULL); + //set_address_number(NULL); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhonePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhonePresenter.cpp index 3754a5d55..2d73f106d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhonePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhonePresenter.cpp @@ -62,13 +62,26 @@ namespace OHOS Presenter::OnStop(); } + static uint8_t MainPhonePresenter_atoi(const char* buf) + { + if(strstr(buf,"D_")) + { + return atoi(buf+2); + } + else + { + return 0; + } + } bool MainPhonePresenter::OnClick(UIView &view, const ClickEvent &event) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainPhonePresenter::OnClick"); std::string curViewId = view.GetViewId(); - int8_t id= atoi(view.GetViewId());//MainPhoneView::GetInstance()->get_delete_id(&view); - if(id!=0 && id<=20 && curViewId.length()<=2) + + int8_t id= MainPhonePresenter_atoi(view.GetViewId());//MainPhoneView::GetInstance()->get_delete_id(&view); + + if(id!=0 && id<=20 && curViewId.length()<=5) { MainPhoneView::GetInstance()->deletecallloginfo(id); return true; @@ -76,6 +89,7 @@ namespace OHOS if (curViewId == DIALINGMETHODBUTTON_VIEWID) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s OnClick", curViewId.c_str()); + set_address_number(NULL); NativeAbility::GetInstance().EnterSlice(VIEW_DIALING_METHOD); } else if (curViewId == FREQUENTLYCONTACTEDBUTTON_VIEWID) diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhoneView.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhoneView.cpp index 383d136ec..a368a73b7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhoneView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhoneView.cpp @@ -275,7 +275,7 @@ namespace OHOS } - static char *str_id[]={"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"}; + static char *str_id[]={"D_0","D_1","D_2","D_3","D_4","D_5","D_6","D_7","D_8","D_9","D_10","D_11","D_12","D_13","D_14","D_15","D_16","D_17","D_18","D_19","D_20"}; void MainPhoneView:: NewcalllogButtonExtupdata(CallLogInfo *data, uint8_t index,uint8_t i) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp index 3d50e6439..e9f5947e5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp @@ -127,6 +127,12 @@ namespace OHOS //NativeAbility::GetInstance().ChangeSlice(VIEW_PHONERING); //calldial_event_sendmsg_toUI((char *)phoneNumber.c_str()); //PhoneCallView::GetInstance()->container_child_SetVisible(true); + + if(phoneNumber.length()<=2) + { + return false; + } + if(TelephonyInitInterface::DIALINGMETHOD == DIALINGMETHOD_USINGWATCHSIM) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DIALINGMETHOD_USINGWATCHSIM"); -- 2.17.1