Merge #1494 into sdk602patch0911 from refs/changes/1494/head 1498/target/1 1499/target/1
author罗正 <1732036298@qq.com>
Fri, 6 Dec 2024 02:17:06 +0000 (02:17 +0000)
committer袁清梦 <3449750381@qq.com>
Fri, 6 Dec 2024 02:17:06 +0000 (02:17 +0000)
Code review from 罗正

* refs/changes/1494/head: (8 commits squashed)

  - 将主界面进入applist界面Power键触发由释放事件改为按下事件,1.加快界面进入速度;2,解决手表息屏状态下(主界面)按Power键概率性会进入applist界面(需要多台手表验证)

  - 修复了音乐播放器从本地音乐切到手机音乐后音乐播放按钮显示不正确问题

  - Merge branch &#39;sdk602patch0911&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911

  - 解决音乐播放器界面进入音乐来源视图后在切换到音乐的调节音量视图旋转表冠不起作用问题

  - 解决绑定死机问题,待验证

  - Merge branch &#39;sdk602patch0911&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911

  - 解决在AI界面查找手表后,AI界面的60s常亮屏,被取消问题

  - 解决音乐播放器中音乐列表播放状态UI显示问题:如,索引0的歌曲若在播放中,在删除其他音乐后,当前音乐播放状态会变成未播放状态。

Signed-off-by: 罗正 <1732036298@qq.com>
Reviewed-by: Caisking <3449750381@qq.com>
Reviewed-by: 罗正 <1732036298@qq.com>
Reviewed-by: aliyun8003852482 <1224667075@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Reviewed-by: aliyun6865282430 <1624952103@qq.com>
Merged-by: Caisking <3449750381@qq.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1494
code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/fd230app/nativeui/player/include/PlayerListDelSongView.h
code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersView.h
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayerListDelSongView.cpp
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersCaseListAdapter.cpp
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp
code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp

index e3e25d4..027fc8c 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-20 15:14:43
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-16 18:26:13
+ * @LastEditTime: 2024-12-05 15:06:19
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h
  */
 #ifndef AI_VOICE_MODEL_H
@@ -95,6 +95,7 @@ namespace OHOS
         void ai_start_screen60s_timer(uint32_t interval = 30*1000);
         void ai_stop_screen60s_timer(void);
         void reset_ai_screen60s_timer_time();
+        bool get_screen60s_timer_is_stop(void);
 
         void start_listening_timer(uint32_t interval = 1000);
         void stop_listening_timer(void);
index d1486a9..16eb961 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-20 15:14:50
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-11-05 11:16:39
+ * @LastEditTime: 2024-12-05 15:04:21
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
  */
 #include "aivoice/include/AiVoiceModel.h"
@@ -795,6 +795,13 @@ namespace OHOS
         }
     }
 
+    bool AiVoiceModel::get_screen60s_timer_is_stop(void)
+    {
+        if(g_screen60s_timer == nullptr)
+            return true;
+        else
+            return false;
+    }
     static osTimerId_t g_listeningEndHandle = nullptr;
     static int8_t LISTENING_TIMEOUT = 10; // 10s钟无操作关闭该视图
     static void AIListeningCallbackProc(int data)
index e01aa52..9e8c3c9 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-08-05 15:20:03
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-12 18:24:31
+ * @LastEditTime: 2024-12-05 21:03:56
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayerListDelSongView.h
  */
 
@@ -44,7 +44,7 @@ namespace OHOS
         virtual ~PlayerListDelSongView();
         static PlayerListDelSongView *GetInstance(void);
         UIViewGroup *CreatePlayerListDelSongView();
-        void SetTheDelSongLabelStyle(const char *songName);
+        void SetTheDelSongLabelStyle(const char *songName,int index);
         void DeleteSongNameFile(void);
         UIButton *GetEnsureDeleteButton(void);
         UIButton *GetCancelDeleteButton(void);
@@ -65,6 +65,7 @@ namespace OHOS
         UIButton *cancelDeleteButton{nullptr};
 
         std::string delSongName;
+        int deleteSongIndex{0};
         UIView::OnDragListener *dragListener{nullptr};
         UIView::OnClickListener *buttonClickListener{nullptr};
 
index 3d2eba0..febe0e3 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com\r
  * @Date: 2024-08-05 15:20:03\r
  * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-10-19 14:38:21\r
+ * @LastEditTime: 2024-12-05 20:38:46\r
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersView.h\r
  */\r
 \r
@@ -98,6 +98,7 @@ namespace OHOS
         PlayersCaseListAdapter *GetMusicListAdapter(void);\r
 \r
         UIList *GetMusicListList(void);\r
+        void RefreshMusicListList(void);\r
         UICircleProgress *GetPlaybackProgress(void);\r
         UICheckBox::UICheckBoxState GetPlayerButtonState(void);\r
 \r
index 26e96a3..3750833 100644 (file)
@@ -85,9 +85,10 @@ namespace OHOS
 
     /// @brief 设置歌曲名标签样式
     /// @param songName 歌曲名
-    void PlayerListDelSongView::SetTheDelSongLabelStyle(const char *songName)
+    void PlayerListDelSongView::SetTheDelSongLabelStyle(const char *songName,int index)
     {
         delSongName = songName;
+        deleteSongIndex = index;
         if (songNameLabel != nullptr)
         {
             songNameLabel->SetText(PlayersModel::GetInstance()->getHexMusicNameFromMusicName(songName).c_str());
@@ -103,7 +104,20 @@ namespace OHOS
 
         if (uapi_delete_files(path.c_str()))
         {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Deleted file: %s successed!", path.c_str());
+            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Deleted file: %s successed!", path.c_str());
+            int index = PlayersModel::GetInstance()->GetCurrentIndex();
+            if(deleteSongIndex < index)
+            {
+                if(index - 1 < 0)
+                {
+                    index = 0;
+                }
+                else
+                {
+                    index--;
+                }
+                PlayersModel::GetInstance()->SetCurrentIndex(index);
+            }
         }
         else
         {
index 3dfd4f5..9fc2d12 100644 (file)
@@ -56,7 +56,7 @@ namespace OHOS
             playersView->ChangeView(PlayersView::MUSIC_LIST_VIEW, PlayersView::MUSIC_DELETE_VIEW);\r
             if (playersView->GetPlayerListDelSongView())\r
             {\r
-                playersView->GetPlayerListDelSongView()->SetTheDelSongLabelStyle(musicPlayName);\r
+                playersView->GetPlayerListDelSongView()->SetTheDelSongLabelStyle(musicPlayName, view.GetViewIndex());\r
             }\r
             return true;\r
         }\r
@@ -105,6 +105,7 @@ namespace OHOS
             }\r
             PlayersModel::GetInstance()->PlayerStat();\r
         }\r
+        playersView->RefreshMusicListList();//刷新音乐列表\r
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "index = %d ,uri = %s.", PlayersModel::GetInstance()->GetCurrentIndex(), PlayersModel::GetInstance()->GetPlayerUri().c_str());\r
         return true;\r
     }\r
index 041edf4..1cde3a6 100644 (file)
@@ -181,16 +181,6 @@ void PlayersModel::SetCurrentIndex(int16_t value)
 {
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayersModel::SetCurrentIndex,value = %d",value);
     currentIndex = value;
-    /* --------------------------------- 刷新音乐列表 --------------------------------- */
-    PlayersView *playersView = PlayersView::GetInstance();
-    if (playersView == nullptr) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "playersView null!");
-        return;
-    }
-    if(playersView->GetMusicListList()!=nullptr){
-        playersView->GetMusicListList()->RefreshList();
-    }
-    /* -------------------------------------------------------------------------- */
 }
 
 int16_t PlayersModel::GetPlayerModel(void)
index 2450e80..987d006 100644 (file)
@@ -460,7 +460,7 @@ void PlayersListGroup::SetUpListCase()
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "musicName = %s,index = %d",playerCaseInfo.sliceId,playerCaseInfo.index);\r
         playersCaseList_->PushBack(playerCaseInfo);\r
     }\r
-    PlayersModel::GetInstance()->showIdToMusicNameMapData();\r
+    // PlayersModel::GetInstance()->showIdToMusicNameMapData();//关闭打印\r
 }\r
 \r
 List<PlayerCaseInfo>& PlayersListGroup::GetCase()\r
index 3503e33..8f2a9a7 100644 (file)
@@ -127,6 +127,15 @@ namespace OHOS
         return musicList;\r
     }\r
 \r
+    /*刷新音乐列表*/\r
+    void PlayersView::RefreshMusicListList(void)\r
+    {\r
+        if(musicList)\r
+        {\r
+            musicList->RefreshList();\r
+        }\r
+    }\r
+\r
     /*获取音乐列表的适配器*/\r
     PlayersCaseListAdapter *PlayersView::GetMusicListAdapter(void)\r
     {\r
index 07dffb3..ac59001 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-03-25 17:33:47
- * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-11-27 10:53:09
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-12-05 15:18:11
  * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp
  * @details:实现查找手表的功能一般需要手表和智能手机之间的配合,通常是通过手机上的应用(App)或其他设备发送指令给手表,触发手表的查找功能。
  * 以下是基本的实现步骤:
@@ -40,6 +40,7 @@
 #include "vibrator_service.h"
 #include "../../../../../../../drivers/peripheral/utils/custom_runtime.h"
 #include <custom_utils.h>
+#include "aivoice/include/AiVoiceModel.h"
 
 namespace OHOS
 {
@@ -498,7 +499,10 @@ namespace OHOS
         FindWatchViewEventListener::GetInstance().FindWatchRingPlayStop();
         FindWatchViewEventListener::GetInstance().ResumeScreenBrightness();
         FindWatchViewEventListener::GetInstance().FindWatch_StopTimer();
-        ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON);
+        if(OHOS::AiVoiceModel::GetInstance().get_screen60s_timer_is_stop()) //如果在AI界面查找手表且60s的常亮屏定时器不在,可以取消常亮屏
+        {
+            ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON);
+        }
     }
 
     /* ----------------------- FindWatchRingPlayerListener ---------------------- */