Merge #1627 into sdk602patch0911 from refs/changes/1627/head
author胡传军 <1224667075@qq.com>
Tue, 14 Jan 2025 16:48:33 +0000 (16:48 +0000)
committer袁清梦 <3449750381@qq.com>
Tue, 14 Jan 2025 16:48:33 +0000 (16:48 +0000)
Code review from 胡传军

* refs/changes/1627/head: (4 commits squashed)

  - 修改MP3最大下载死机问题

  - Merge branch &#39;sdk602patch0911&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0911

  - 修复ble传输最大容量内存泄漏问题

  - 修复创建BT服务时序问题导致的蓝牙状态不对,导致的蓝牙电话异常问题

Signed-off-by: aliyun8003852482 <1224667075@qq.com>
Reviewed-by: Caisking <3449750381@qq.com>
Reviewed-by: 罗正 <1732036298@qq.com>
Reviewed-by: aliyun8003852482 <1224667075@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Reviewed-by: aliyun6865282430 <1624952103@qq.com>
Merged-by: Caisking <3449750381@qq.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1627
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp
code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c

index 2d76de6..0bf9d35 100644 (file)
@@ -175,6 +175,7 @@ static int bluetooth_init_all(void)
     BtInitCallBacks();\r
     uapi_pbap_pce_reg_callback();\r
     BtA2dpInit();\r
+    PhoneServiceInit();\r
 \r
     if(uapi_dev_runtime_get_safemode_flag())\r
     {\r
index c6f0621..8bdf0c4 100644 (file)
@@ -156,6 +156,9 @@ void StatusReset(void)
         #endif
         
         {
+            #ifdef SUPPORT_CAT1_HFP_AG_SERV
+                do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_AUDIO_END, nullptr, 0);
+            #endif
             do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0);
         }
     }
@@ -220,19 +223,21 @@ static void CallTimerCallbackProc(int data)
    {    
         if(MainCallingView::GetInstance()->GetDisplayGroup())
         {
-            // if(!MainCallingView::GetInstance()->GetDisplayGroup()->IsVisible())
-            // {
-            //     if( volte_voice_state!=2)
-            //     {
-            //         do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0);
-            //     }
-            //     else if( && volte_voice_state()!=1)
-            //     {
-            //         do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0);
-            //     }
-                
+             #ifdef SUPPORT_CAT1_HFP_AG_SERV
+            if(!MainCallingView::GetInstance()->GetDisplayGroup()->IsVisible())
+            {
                
-            // }
+                if( headset_SCO_Is_connect()==false && volte_voice_state()!=1)
+                {
+                    if(volte_voice_state()==2)
+                    {
+                        do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0);
+                    }
+                    do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0);
+                }
+            }
+            #endif
+
         }
        
        
@@ -937,7 +942,7 @@ CallerLogModel::~CallerLogModel() {}
 void CallerLogModel::InitPhoneService()
 {
     WEARABLE_LOGD(HILOG_MODULE_AAFWK, "CallerLogModel::[InitPhoneService]::Init start");
-    PhoneServiceInit();
+   
     PhoneServiceCb serviceFoution;
 
     serviceFoution.callChanged = PhoneChangeStatusCallback;
index 8f95341..76689b2 100644 (file)
@@ -7118,6 +7118,8 @@ errcode_t decode_ota_json(ble_read_data *buffer_handle) {
             {\r
                 TRANSMIT_DATA=TRANS_OTA_FAIL;\r
                 CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);\r
+                cJSON_Delete(root);\r
+\r
                 return ERRCODE_FAIL;\r
             }\r
         }\r
@@ -7256,6 +7258,8 @@ errcode_t decode_mp3_json(ble_read_data *buffer_handle)
         if(IS_free_save_Mp3(ota_size_json->valueint)==false)\r
         {\r
             free(buffer_handle->file_recv_stat.file_name);\r
+            buffer_handle->file_recv_stat.file_name=NULL;\r
+\r
             TRANSMIT_DATA=TRANS_MP3_MAX_FAIL;\r
             CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);\r
 \r