修复创建BT服务时序问题导致的蓝牙状态不对,导致的蓝牙电话异常问题 1627/3 1627/head
authorhcj <1224667075@qq.com>
Tue, 14 Jan 2025 07:35:32 +0000 (15:35 +0800)
committerhcj <1224667075@qq.com>
Tue, 14 Jan 2025 07:35:32 +0000 (15:35 +0800)
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp
code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp

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;