From 2ac97b9c1b256445e74c7c5d59768cb6f7331105 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Fri, 11 Oct 2024 11:49:48 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0+=E5=8F=B7=E8=BF=87=E6=BB=A4?= =?utf8?q?=EF=BC=8C=E6=8C=82=E6=96=AD=E7=94=B5=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/callerlog/src/CallerLogModel.cpp | 6 ++-- .../makephone/src/MainCallingPresenter.cpp | 8 +++++ .../msg_center/src/msg_center_customer.cpp | 35 ++++++++++++------- .../msg_center/src/notify/transmitting.cpp | 5 +-- .../slip/cat1Service/cat1_server_hal.cpp | 6 +++- 5 files changed, 40 insertions(+), 20 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp index aafc868dc..508f3069f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp @@ -22,6 +22,7 @@ #include "vibrator_service.h" #include "custom_runtime.h" +#include "dial_sos_c.h" #ifdef __cplusplus extern "C" { #endif @@ -578,11 +579,8 @@ static void WatchFinishHandle(void) } g_phoneStatus = PHONE_SINGLE_STATUS; - if(get_falg_SOS()) - { - sos_falg_add(); + sos_falg_clean(); } -} void CAT1_ChangeStatusScreendisplay(int lastStatus) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp index fcb146827..f2d4347d6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp @@ -22,6 +22,7 @@ #include "phoneaddressmodel.h" #include "bletest.h" #include "NativeAbility.h" +#include "dial_sos_c.h" namespace OHOS { static MainCallingPresenter *g_pMainView = nullptr; static constexpr int32 NUM_10 = 10; @@ -224,9 +225,16 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) { if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) { + + { + sos_falg_clean(); + } + cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + cat1_call_hungup(); + } else { diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 4a8d2f101..1ebb93539 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -1032,18 +1032,14 @@ void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req) NotificationManager::GetInstance()->ShowNotify(showSOSNotify, (uint16_t)topic, true); return; } - - cat1_call_dial(call_data); - - CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len); - CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); - - cat1_phone_state_change_cb(OPERATE_DIALING); - NotificationManager::GetInstance()->SetWatchCallStatus(true); + cat1_call_dial(call_data); + CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len); + CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); + cat1_phone_state_change_cb(OPERATE_DIALING); + NotificationManager::GetInstance()->SetWatchCallStatus(true); } free(call_data); - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); } //电话结束处理函数 void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req) @@ -1052,8 +1048,7 @@ void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req) unused(req); // just stop the notify - AlarmClockModel::GetInstance()->AlarmPlayerStop(); - // AlarmViewEventListener::GetInstance()->CancelAlarmRing(); + //AlarmClockModel::GetInstance()->AlarmPlayerStop(); if(!NotificationManager::GetInstance()->GetWatchCallStatus()) { return; @@ -1062,11 +1057,25 @@ void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req) if (req == NULL) return ; char* call_data = (char*)malloc(req->len); int32 ret = memcpy_s(call_data, req->len, req->data, req->len); - if(strcmp(CallerLogModel::GetInstance()->GetPhoneNumber().c_str(),call_data)!=0 && + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s %s",call_data,CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + uint8_t offset_watch =0; + if(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()[0]=='+') + { + offset_watch++; + } + + uint8_t offset_call =0; + if(call_data[0]=='+') + { + offset_call++; + } + + if(strcmp(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()+offset_watch,call_data+offset_call)!=0 && CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourceCat1) { - + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "no OPERATE_WATCH_FINISH"); } else { diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp index 71bc38beb..fcb1e1e45 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp @@ -543,7 +543,8 @@ namespace OHOS // Set additional property Title->SetText("音乐传输中"); - Title->SetTextId (STR_DIAL_DOWNLOADING_TITLE); + Title->SetTextId (STR_MUSIC_TRANSMIT); + Title->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); Title->SetRollSpeed(0); @@ -917,7 +918,7 @@ namespace OHOS uapi_hfp_disconnect(); } } - else + else if(Transmitting_falg!=OTA_UPDATA_FAIL) { if(uapi_dev_runtime_get_bt_powerstat() && cm_get_HFP_switch()) { diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp index 365883285..051073155 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp @@ -64,11 +64,15 @@ static errcode_t cat1msg_event_notify(char* callno) CustomEventPublish(TOPIC_EVENT_CAT1_SIGNAL_UPDATE,(uint8_t*)callno,strlen(callno)+1); return 0; } +std::string call_number_end; int callend_event_sendmsg_toUI(char* callno) { /**通过UI事件发送Notify*/ - GraphicService::GetInstance()->PostGraphicEvent(std::bind(callend_event_notify, callno)); + call_number_end=std::string(callno); + //call_number_end.erase(std::remove(call_number.begin(),call_number.end(),' '),call_number.end()); + + GraphicService::GetInstance()->PostGraphicEvent(std::bind(callend_event_notify,(char *)call_number_end.c_str())); return ERRCODE_SUCC; } -- 2.17.1