From: hcj <1224667075@qq.com> Date: Thu, 19 Dec 2024 07:50:48 +0000 (+0800) Subject: 增加A2DP SNK端功耗日志保存 X-Git-Tag: v1.3.113-repair_tp~18^2~41 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1533%2F3;p=mirrors%2FFD230.git 增加A2DP SNK端功耗日志保存 --- 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,