From 4381f66085efa71cc805104720b7c90dca9be453 Mon Sep 17 00:00:00 2001 From: Caisking Date: Thu, 8 May 2025 16:45:21 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9players=E7=9A=84=E7=BC=96?= =?utf8?q?=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../bluetooth/include/BluetoothPresenter.h | 1 + .../nativeui/bluetooth/src/BluetoothModel.cpp | 14 +++++++++++--- .../nativeui/main/include/MainPresenterSample.h | 3 ++- .../nativeui/main/include/VolumeSettingPresenter.h | 2 +- .../nativeui/main/include/VolumeSettingView.h | 2 +- .../nativeui/main/src/VolumeSettingPresenter.cpp | 1 + .../nativeui/player/include/PlayersModel.h | 1 + .../nativeui/player/include/PlayersPresenter.h | 4 ++-- .../nativeui/player/include/PlayersView.h | 6 ++++-- .../nativeui/player/src/MusicPlayerTipView.cpp | 1 + .../src/notify/makephone_notification.cpp | 5 +++++ 11 files changed, 30 insertions(+), 10 deletions(-) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/include/BluetoothPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/include/BluetoothPresenter.h index 80289c1ec..920bc8776 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/include/BluetoothPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/include/BluetoothPresenter.h @@ -17,6 +17,7 @@ #include "components/ui_label_button.h" #include "components/ui_view_group.h" #include "VolumeSettingView.h" +#include "BluetoothModel.h" #include "UiViewId.h" #include "cmsis_os.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp index 55b24f97c..54e9fb1f6 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp @@ -7,7 +7,6 @@ #include #include "BluetoothModel.h" #include "BluetoothModelC.h" - #include "BluetoothWrapper.h" #include "BluetoothPresenter.h" #include "ConnectPhonePresenter.h" @@ -27,6 +26,8 @@ #include "bts_pbap.h" #include "ConfigModelC.h" #include "custom_utils.h" +#include "custom_runtime.h" + #ifdef SUPPORT_ALIPAY_SEC #include "alipay_feature.h" #endif @@ -36,9 +37,13 @@ #include "audio_manager_c_wrapper.h" #include "bts_avrcp_target.h" #include "msg_center_msg.h" +#include "client/msg_center_client.h" +#include "msg_center_protocol.h" #include "dfx_channel.h" #include "tcxo.h" -#include "custom_runtime.h" +#include "ui_service.h" +#include "font/ui_font_header.h" + #ifdef SUPPORT_BLE_SERVICE #include @@ -437,10 +442,13 @@ void BluetoothModel::SetUpConnedDevicesList() } SetConnedDevicesListClear(); unsigned int connedDevicesNum = 0; + + #ifdef SUPPORT_BLE_SERVICE int btpower = uapi_dev_runtime_get_bt_powerstat(); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BT Power %s , Setup GetPariedDevicesNum ret = %d, num = %d", btpower==1?"On":"Off",ret, connedDevicesNum); + #endif bool ret = gap_get_paired_devices_num(&connedDevicesNum); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BT Power %s , Setup GetPariedDevicesNum ret = %d, num = %d", btpower==1?"On":"Off",ret, connedDevicesNum); gap_paired_device_info_t *devInfo = (gap_paired_device_info_t*)malloc(sizeof(gap_paired_device_info_t) *connedDevicesNum); if (devInfo == nullptr) { diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/MainPresenterSample.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/MainPresenterSample.h index 39e323eb0..d544024bd 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/MainPresenterSample.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/MainPresenterSample.h @@ -15,7 +15,8 @@ #include "MainModel.h" #include "MainViewSample.h" #include "ModelListenerSample.h" -#include "PlayersView.h" +#include "player/include/PlayersView.h" + #include "Presenter.h" #include "components/root_view.h" #include "components/ui_swipe_view.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/VolumeSettingPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/VolumeSettingPresenter.h index a303b9052..d3e1bfdc1 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/VolumeSettingPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/VolumeSettingPresenter.h @@ -12,7 +12,7 @@ #include "components/ui_view_group.h" #include "components/ui_slider.h" #include "VolumeSettingView.h" -#include "PlayersView.h" +// #include "player/include/PlayersView.h" namespace OHOS { #define INCREASE_BUTTON "increaseButton" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/VolumeSettingView.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/VolumeSettingView.h index ac3db835b..ade8d2254 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/VolumeSettingView.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/VolumeSettingView.h @@ -11,7 +11,7 @@ #include "components/ui_button.h" #include "components/ui_view_group.h" #include "components/ui_slider.h" -#include "PlayersView.h" + #include "wearable_log.h" #include "VolumeSettingPresenter.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp index 7981beb21..d7ed2f75b 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp @@ -18,6 +18,7 @@ #include "notification_manager.h" #include "BluetoothHeadsetEvent.h" #include "bts_avrcp_controller.h" +#include "PlayersView.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersModel.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersModel.h index fc2a79257..0ad29d78c 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersModel.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersModel.h @@ -19,6 +19,7 @@ #include "player/include/PlayersPresenter.h" #include "bts_avrcp_controller.h" #include "PlayersCaseListAdapter.h" +#include namespace OHOS { using OHOS::Media::Player; using OHOS::Media::Source; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersPresenter.h index 2e2267e45..72f7a41e1 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersPresenter.h @@ -6,8 +6,8 @@ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersPresenter.h */ -#ifndef MUSIC_PLAYERS_PRESENTER_H -#define MUSIC_PLAYERS_PRESENTER_H +#ifndef PLAYERS_PRESENTER_H +#define PLAYERS_PRESENTER_H #include "gfx_utils/list.h" #include "ohos_types.h" #include "components/ui_view.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersView.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersView.h index 21761570c..53bf93012 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersView.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersView.h @@ -6,8 +6,10 @@ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersView.h */ -#ifndef MUSIC_PLAYERS_VIEW_H -#define MUSIC_PLAYERS_VIEW_H +#ifndef PLAYERS_VIEW_H +#define PLAYERS_VIEW_H + +#include "player/include/PlayersPresenter.h" #include #include "components/ui_image_view.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/src/MusicPlayerTipView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/src/MusicPlayerTipView.cpp index a61588330..e8ee30091 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/src/MusicPlayerTipView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/src/MusicPlayerTipView.cpp @@ -7,6 +7,7 @@ */ #include "player/include/MusicPlayerTipView.h" #include "player/include/PlayersPresenter.h" +#include "player/include/PlayersView.h" #include "player/include/PlayersModel.h" #include "wearable_log.h" #include "UiConfig.h" diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/makephone_notification.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/makephone_notification.cpp index 29c369a94..118bb320c 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/makephone_notification.cpp +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/makephone_notification.cpp @@ -17,8 +17,13 @@ #include "VolumeSettingView.h" #include "VolumeSettingPresenter.h" #include "ui_resource_image.h" +#include "audio_manager.h" namespace OHOS { + +using namespace Audio; +using Audio::AudioManager; + constexpr int32_t NOTIFY_THREE_SECONDS = 3000; constexpr int32_t NOTIFY_ONE_SECOND = 1000; constexpr int32_t NOTIFY_THIRTY_SECONDS = 30000; -- 2.17.1