From 012e883bd3e1f478358d628be13ddb823ae01015 Mon Sep 17 00:00:00 2001 From: Caisking Date: Fri, 5 Sep 2025 17:41:09 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8Dapp=E8=BF=9E=E6=8E=A5=E6=97=B6?= =?utf8?q?=E5=9B=9E=E8=B0=83=E6=9C=AA=E6=B3=A8=E5=86=8C=E5=AF=BC=E8=87=B4?= =?utf8?q?=E7=9A=84=E6=AD=BB=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativelauncher/src/NativeLauncher.cpp | 2 +- .../fd230app/nativeui/phoneservice/src/PhoneService.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 2bfe381f0..082577308 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -603,7 +603,7 @@ namespace OHOS // 初始化所有预加载slice InitAllNativeSlices(); - CallerLogModel::GetInstance()->InitPhoneService(); + // CallerLogModel::GetInstance()->InitPhoneService(); //可能初始化没有这么快 GoalModel::GetInstance().GoalModelInitdata(); // 活动数据初始化 // PresenterTask::GetInstance()->Init(); PlayersModel::GetInstance()->AudioInit(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp index f82c016f8..2e258e361 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -641,14 +641,14 @@ static void BtDisconnectedPro(void) { g_btConnState = PROFILE_STATE_DISCONNECTED; //(void)memset_s(g_bdAddr.addr, BD_ADDR_LEN, 0, BD_ADDR_LEN); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[BtDisconnectedPro] g_bdAddr: "); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BtDisconnectedPro] g_bdAddr: "); CatBdAddr(&g_bdAddr); // 通知APP蓝牙断开连接 PhoneServiceErrorCallback(ERROR_BT, PROFILE_STATE_DISCONNECTED); CallListInit(); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BtDisconnectedPro callState:%d", g_currCallState); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BtDisconnectedPro callState:%d", g_currCallState); if (g_currCallState == HFP_HF_CALL_STATE_INCOMING) { /* 处理呼入阶段,取消手表配对 */ hfp_hf_calls_info_t call = {0}; @@ -704,11 +704,13 @@ static void ConnStateChanged(const bd_addr_t *bdAddr, profile_connect_state_t st WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT disconnecting"); break; case PROFILE_STATE_DISCONNECTED: // 蓝牙断开连接 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT disconnected"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT disconnected"); BtDisconnectedPro(); //if(0==OHOS::uapi_a2dp_snk_get_device_connect_state() && 0==uapi_hfp_connect_state()) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BT_DISCONNECTED_TO_UI"); SendMsgToUIService(BT_DISCONNECTED_TO_UI, 0, nullptr, 0); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BT_DISCONNECTED_TO_MSGCENTER"); //SendMsgToMsgCenterService(BT_DISCONNECTED_TO_MSGCENTER, 0, nullptr, 0); } uapi_save_runtime_log(RUNTIME_LOG_BR_DISCONNECT_HFP); @@ -1849,6 +1851,7 @@ void PhoneServiceInit(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PhoneServiceInit] start"); g_scoFlag = HFP_SCO_STATE_DISCONNECTED; + OHOS::CallerLogModel::GetInstance()->InitPhoneService(); AudioInit(); InitMutex(); CallLogCreatDir(); -- 2.17.1