From: luozheng <1732036298@qq.com> Date: Mon, 2 Dec 2024 13:48:39 +0000 (+0800) Subject: 优化音乐播放器蓝牙耳机连接状态显示 X-Git-Tag: fd230_release_V1.3.102~3^2~9^2~1 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1486%2Fhead;p=mirrors%2FFD230.git 优化音乐播放器蓝牙耳机连接状态显示 --- diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 4cf44dfae..83908096c 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -557,7 +557,7 @@ namespace OHOS ScreenModels::GetInstance()->InitKvStorage(); VocassistModel::GetInstance()->Init(); HeartModel::GetInstance()->Init(); - BluetoothModel::GetInstance()->Init(); + // BluetoothModel::GetInstance()->Init(); TraingModel::GetInstance()->Init(); // 训练消息订阅 TakephotosModel::GetInstance()->Init(); // 拍照消息订阅 MessageModel::GetInstance().Init(); // 消息订阅监听 diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h index 8f76d5b50..157c3002e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h @@ -1,8 +1,8 @@ /* * @Author: penglei 1624952103@qq.com * @Date: 2024-08-23 10:50:37 - * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-09-23 16:59:22 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-12-02 19:24:01 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -33,6 +33,7 @@ int uapi_reconnect_(void); int get_BT_is_init(void); +void cm_initBluetoothDeviceList(void); #ifdef __cplusplus } #endif 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 0f7384c0c..6cb7f137e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -2011,7 +2011,10 @@ int uapi_open_br_scan(void) // } - +void cm_initBluetoothDeviceList(void) +{ + BluetoothModel::GetInstance()->Init(); +} #ifdef __cplusplus } diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp index 78459ee2e..1a4e9d81a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-02-18 09:09:13 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-11-27 17:16:20 + * @LastEditTime: 2024-12-02 21:31:22 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp */ #include "settings/include/SettingModel.h" @@ -14,7 +14,7 @@ #include "PhoneService.h" #include "phoneservice/include/PhoneService.h" #include "BluetoothModel.h" - +#include "player/include/MusicPlayerSourceView.h" extern "C" { #include "custom_runtime.h" @@ -127,6 +127,10 @@ namespace OHOS { BluetoothServiceOptionsView::GetInstance()->Button_UPdata(); } + if(MusicPlayerSourceView::GetInstance()) + { + MusicPlayerSourceView::GetInstance()->UpdateBluetoothHeadsetConnectLabel(); + } } // 更新蓝牙连接状态 diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 992bb120f..2ca730c21 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -73,6 +73,7 @@ #include "broadcast_feature.h" #include "battery_service.h" #include "cywee_hal.h" +#include "bluetooth/include/BluetoothModelC.h" errcode_t uapi_create_osThread_custom(app_task_definition_t *task_cfg) { @@ -497,6 +498,7 @@ void startup_post_init_task(void) // cm_initializeVoLTECall(); //initialize4GCapability(); //initializeMotionRecognition(); + cm_initBluetoothDeviceList(); LOS_Msleep(5000);