From 889932c428b54364dc8446f19e04d43c99001cb9 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 7 Dec 2024 16:14:09 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3=E8=BF=9E=E6=8E=A5=E8=80=B3?= =?utf8?q?=E6=9C=BA=E5=90=8E=E8=80=B3=E6=9C=BA=E6=93=8D=E6=8E=A7=E6=89=8B?= =?utf8?q?=E8=A1=A8=EF=BC=88=E4=B8=8A=E4=B8=80=E9=A6=96=EF=BC=8C=E4=B8=8B?= =?utf8?q?=E4=B8=80=E9=A6=96=EF=BC=89=E9=9F=B3=E4=B9=90=E6=AD=BB=E6=9C=BA?= =?utf8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/fd230app/nativelauncher/src/NativeLauncher.cpp | 3 +++ .../fd230app/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp | 1 + .../wearable/fd230app/nativeui/player/src/PlayersView.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index ab8b95e77..0383f6a35 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -305,6 +305,7 @@ extern "C" uint8_t uapi_dev_runtime_get_lock_status(void); #include "bleEvent.h" #include "../../../../../../drivers/peripheral/config/include/ConfigModelC.h" #include "vibrator_service.h" +#include namespace OHOS { @@ -563,6 +564,8 @@ namespace OHOS MessageModel::GetInstance().Init(); // 消息订阅监听 AssistantModel::GetInstance()->Init(); // 语音助手消息订阅 GoalModel::GetInstance().GoalModelInitdata(); + //音乐列表初始化,放在nativelauncher 初始化,防止手表连接耳机时,操控耳机控制手表音乐造成死机 + do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_MUSICNAME_READ, nullptr, 0); // 初始化默认首页 ScreenModels::GetInstance()->PreLoadAppimages(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp index 6702977f9..fa26ec868 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp @@ -111,6 +111,7 @@ void BtAvrcpTgNotifyVolumeChangedProc(uint8_t a2dp_volume) void UsingPressButtonStatusCallback(td_u32 keyOperation, td_u32 keyValue) { bt_avrcp_tg_evt_status_param event; + // printf("keyOperation = %d, keyValue = %d\n"); switch (keyOperation) { case AVRCP_KEY_VOLUME_UP: // 耳机控制手表加减音量不走key_operation事件 case AVRCP_KEY_VOLUME_DOWN: // 减小音量 diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp index 8f2a9a7e4..aa2a8ee43 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp @@ -1051,7 +1051,7 @@ namespace OHOS // PlayersListGroup::GetInstance()->SetUpListCase(); // PlayersModel::GetInstance()->PlayerInit(); - do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_MUSICNAME_READ, nullptr, 0); + // do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_MUSICNAME_READ, nullptr, 0); SetTouchable(true); SetDraggable(true); return true; -- 2.17.1