From: hcj <1224667075@qq.com> Date: Fri, 11 Oct 2024 03:49:48 +0000 (+0800) Subject: 增加+号过滤,挂断电话 X-Git-Tag: release_V1.2.70_20241020_135402~60^2~15 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1154%2F1;p=mirrors%2FFD230.git 增加+号过滤,挂断电话 --- 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; }