From 51c7af83a183d5a5802a5cc8ac22ca07c522845b Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Thu, 19 Dec 2024 15:50:48 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0A2DP=20SNK=E7=AB=AF=E5=8A=9F?= =?utf8?q?=E8=80=97=E6=97=A5=E5=BF=97=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/bluetooth/src/BluetoothModel.cpp | 9 +++++++++ code/sdk/drivers/peripheral/utils/custom_save_runtime.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp index 85a190917..2d76de6fc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -1544,6 +1544,9 @@ static void BtA2dpSnkStartStreamReqCb(bd_addr_t *bd_addr) WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "addr: ****%02x%02x%02x%02x \n", bd_addr->addr[3], bd_addr->addr[2], bd_addr->addr[1], bd_addr->addr[0]); /* 3 2 1 0 idx */ BtA2dpSnkAudioCreate(); + + uapi_save_runtime_log(RUNTIME_LOG_BR_A2DP_SNK_START_STREAM); + if(PlayersModel::GetInstance()->GetMusicSource())//如果是手机音乐才更新显示 GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PlayersModel::set_player_state, OHOS::PlayersModel::GetInstance(),true)); // PlayersModel::GetInstance()->get_avrcp_ct_get_element_attributes(); @@ -1553,10 +1556,16 @@ static void BtA2dpSnkPlayingStateChangedCb(bd_addr_t *bd_addr, int playing_state { WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "addr: ****%02x%02x%02x%02x playing_state: %x\n", bd_addr->addr[3], bd_addr->addr[2], bd_addr->addr[1], bd_addr->addr[0], playing_state); /* 3 2 1 0 idx */ + if (playing_state == A2DP_NOT_PLAYING) { if(PlayersModel::GetInstance()->GetMusicSource())//如果是手机音乐才更新显示 GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PlayersModel::set_player_state, OHOS::PlayersModel::GetInstance(),false)); BtA2dpSnkAudioDestroy(); + uapi_save_runtime_log(RUNTIME_LOG_BR_A2DP_SNK_NOT_PLAYING); + } + else + { + uapi_save_runtime_log(RUNTIME_LOG_BR_A2DP_SNK_PLAYING); } } diff --git a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h index 94b018b28..cd5a32f27 100644 --- a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h +++ b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h @@ -56,6 +56,9 @@ typedef enum { RUNTIME_LOG_BR_DISCONNECT_HFP, RUNTIME_LOG_BR_CONNECT_A2DP, RUNTIME_LOG_BR_DISCONNECT_A2DP, + RUNTIME_LOG_BR_A2DP_SNK_START_STREAM, + RUNTIME_LOG_BR_A2DP_SNK_NOT_PLAYING, + RUNTIME_LOG_BR_A2DP_SNK_PLAYING, RUNTIME_LOG_BR_CONNECT_A2DP_HEADSET, RUNTIME_LOG_BR_DISCONNECT_A2DP_HEADSET, -- 2.17.1