From b8aec7c16868d5b7bcaca656b4cc02c40521d901 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 22 Oct 2024 14:38:29 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E6=89=BE=E6=89=8B?= =?utf8?q?=E8=A1=A8=E7=9A=84=E6=92=AD=E6=94=BE=E9=9F=B3=E9=A2=91=E9=80=BB?= =?utf8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../service/msg_center/src/msg_center_customer.cpp | 2 +- .../msg_center/src/notify/findwatch_notification.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 3a58e6760..e9add819f 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -1254,7 +1254,7 @@ void MsgCenterNotifyCanCelFindWatchProc(const Topic topic, Request* req) unused(topic); unused(req); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyCanCelFindWatchProc !"); - FindWatchViewEventListener::GetInstance().PopInterCancelMusic(); + // FindWatchViewEventListener::GetInstance().PopInterCancelMusic(); if (FindWatchViewEventListener::GetInstance().GetFindWatchNotifyFlag() == true) { NotificationManager::GetInstance()->StopNotify(); } diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp index 0f6e1288b..a6481f7db 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-25 17:33:47 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-18 18:02:00 + * @LastEditTime: 2024-10-22 10:23:38 * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp * @details:实现查找手表的功能一般需要手表和智能手机之间的配合,通常是通过手机上的应用(App)或其他设备发送指令给手表,触发手表的查找功能。 * 以下是基本的实现步骤: @@ -69,7 +69,7 @@ namespace OHOS #ifdef SUPPORT_BLE_SERVICE setFindWatchFlag(2); // 表示已找到手表 #endif - FindWatchRingPlayStop(); + // FindWatchRingPlayStop(); NotificationManager::GetInstance()->StopNotify(); SetFindWatchNotifyFlag(false); // ResumeScreenBrightness(); @@ -96,7 +96,7 @@ namespace OHOS #ifdef SUPPORT_BLE_SERVICE setFindWatchFlag(2); // 表示已找到手表 #endif - FindWatchRingPlayStop(); + // FindWatchRingPlayStop(); NotificationManager::GetInstance()->StopNotify(); SetFindWatchNotifyFlag(false); // ResumeScreenBrightness(); @@ -292,6 +292,7 @@ namespace OHOS */ int FindWatchViewEventListener::FindWatchRingPlayStart(const char *path) { + FindWatchRingPlayStop(); // 如果playerCtr上音频资源没被释放,先释放 FindWatchRingPlayerInit(((path == nullptr) ? RingMusicName : path)); FindWatchRingPlayerStat(); return OHOS_SUCCESS; @@ -476,6 +477,7 @@ namespace OHOS FindWatchGroupView = nullptr; } + FindWatchViewEventListener::GetInstance().FindWatchRingPlayStop(); FindWatchViewEventListener::GetInstance().ResumeScreenBrightness(); FindWatchViewEventListener::GetInstance().FindWatch_StopTimer(); } -- 2.17.1