From: luozheng <1732036298@qq.com> Date: Tue, 22 Oct 2024 06:38:29 +0000 (+0800) Subject: 优化查找手表的播放音频逻辑 X-Git-Tag: fd230_release_V1.3.102~188^2~20 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=b8aec7c16868d5b7bcaca656b4cc02c40521d901;p=mirrors%2FFD230.git 优化查找手表的播放音频逻辑 --- 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(); }