增加+号过滤,挂断电话 1154/1 1154/head
authorhcj <1224667075@qq.com>
Fri, 11 Oct 2024 03:49:48 +0000 (11:49 +0800)
committerhcj <1224667075@qq.com>
Fri, 11 Oct 2024 03:49:48 +0000 (11:49 +0800)
code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp

index aafc868..508f306 100644 (file)
@@ -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)
 {
index fcb1468..f2d4347 100644 (file)
@@ -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
             {
index 4a8d2f1..1ebb935 100644 (file)
@@ -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
     {
index 71bc38b..fcb1e1e 100644 (file)
@@ -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())
             {
index 3658832..0510731 100644 (file)
@@ -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;
 }