电话增加呼叫失败处理 1171/6 1171/head
authorhcj <1224667075@qq.com>
Sat, 12 Oct 2024 11:55:28 +0000 (19:55 +0800)
committerhcj <1224667075@qq.com>
Sat, 12 Oct 2024 11:55:28 +0000 (19:55 +0800)
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp

index 8e5b3c4..9a3d984 100644 (file)
@@ -647,7 +647,7 @@ void MsgCenterNotifyHfpWatchHintProc(const Topic topic, Request* req)
     }
     
     //NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE);
-    
+
     if(NotificationManager::GetInstance()->HasNotifyShowing())
     NotificationManager::GetInstance()->StopNotify();
 
@@ -997,6 +997,13 @@ void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req)
     char* call_data = (char*)malloc(req->len);
     int32 ret = memcpy_s(call_data, req->len, req->data, req->len);
 
+    if(strcmp("callfail",call_data)==0)
+    {
+        cat1_phone_state_change_cb(OPERATE_WATCH_FINISH);
+        free(call_data);
+        return;
+    }
+
     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]=='+')
@@ -1021,7 +1028,8 @@ void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req)
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OPERATE_WATCH_FINISH");
         cat1_phone_state_change_cb(OPERATE_WATCH_FINISH);
     }
-    //free(call_data);
+
+    free(call_data);
     
 }
 
index a169079..e3fece0 100644 (file)
@@ -745,6 +745,7 @@ void cat1_call_dial(char* phonenum)
 {
     bool volte = OHOS::ConfigModel::GetInstance()->GetVoLTE_Call();
     if (volte == true){
+         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"cat1_call_dial\n");
         udp_send_msg_toCat1(UDP_CMD_DIAL_NUMB,phonenum);
     }
         
@@ -1279,6 +1280,10 @@ static int udp_packet_parse(char *rx_buffer, int len)
                 }
        
             }
+            if(strstr(msg_buffer,"callfail")!=NULL)
+            {
+                cat1_handle_call_disconnected("callfail");
+            }
             break;
         case UDP_MSG_GET_TELECON_DMP_TIMESEC://暂时不用