Merge #1172 into sdk602patch0911 from refs/changes/1172/head
author罗正 <1732036298@qq.com>
Sat, 12 Oct 2024 13:25:57 +0000 (13:25 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Sat, 12 Oct 2024 13:25:57 +0000 (13:25 +0000)
Code review from 罗正

* refs/changes/1172/head: (7 commits squashed)

  - #99解决,,给可以滚动视图添加表冠控制旋转表冠一直触发(需求)

  - 关机动画使用IMG_SRC_FILE_PATH而不用IMG_SRC_IMAGE_INFO ,解决关机动画出现慢问题

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

  - #429,解决弧形列表风格,功能界面返回列表界面默认回到列表头部位置(需求)

  - #969,解决,韩语,秒表计时界面有遮挡bug

  - 查找手机增加打印,方便分析出现查找手机为什么会有失灵的情况

  - 运动识别添加设置弹窗优先级

Signed-off-by: 罗正 <1732036298@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1172
13 files changed:
code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistModel.h
code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistPresenter.h
code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp
code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistView.cpp
code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneModel.h
code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneModel.cpp
code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp
code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchPresenter.h
code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchView.cpp
code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp

index 8474614..9bd793f 100644 (file)
@@ -45,6 +45,10 @@ public:
     uint16_t GetStartIndex(void);
     void SetHeadItemY(int index);
     int GetHeadItemY(void);
+    void SetArcListStartIndex(uint16_t index);
+    uint16_t GetArcListStartIndex(void);
+    void GetArcListHeadItemY(int y);
+    int GetArcListHeadItemY(void);
     void ApplistUpdate(void);
     void SetPresenter(ApplistPresenter *p);
     AppListStyle GetCurrentStyle(void);
@@ -61,8 +65,10 @@ private:
     int32 bundleLen = 0;
     uint8 appLen = 0;
 
-    uint16_t startIndex = 0;
-    int headItemY = 0;
+    uint16_t arcListstartIndex = 0; // 圆弧列表起始位置
+    int arcListheadItemY = 0;       // 圆弧列表头部位置
+    uint16_t startIndex = 0;        // 列表起始位置
+    int headItemY = 0;              // 列表头部位置
     bool initFlag{false};
 };
 }
index 29d65a1..f68c1f5 100644 (file)
@@ -35,6 +35,10 @@ namespace OHOS {
         uint16_t GetStartIndex(void);
         void SetHeadItemY(int y);
         int GetHeadItemY(void);
+        void SetArcListStartIndex(uint16_t index);
+        uint16_t GetArcListStartIndex(void);
+        void SetArcListHeadItemY(int y);
+        int GetArcListHeadItemY(void);
         uint8_t GetListItemNum(void);
         ApplistView* GetAppListView();
         AppListStyle GetCurrentStyle(void);
index 6602e79..ae71146 100644 (file)
@@ -227,6 +227,29 @@ namespace OHOS
         return headItemY;
     }
 
+    //设置弧形列表的起始位置
+    void ApplistModel::SetArcListStartIndex(uint16_t index)
+    {
+        arcListstartIndex = index;
+    }
+
+    //获取弧形列表的起始位置
+    uint16_t ApplistModel::GetArcListStartIndex(void)
+    {
+        return arcListstartIndex;
+    }
+
+    //设置弧形列表的头部位置
+    void ApplistModel::GetArcListHeadItemY(int y)
+    {
+        arcListheadItemY = y;
+    }
+    //获取弧形列表的头部位置
+    int ApplistModel::GetArcListHeadItemY(void)
+    {
+        return arcListheadItemY;
+    }
+
     void ApplistModel::ApplistUpdate(void)
     {
         ResolvingJSAppItems();
index 564c309..9269219 100644 (file)
@@ -239,6 +239,31 @@ namespace OHOS
         return model->GetHeadItemY();
     }
 
+    //设置弧形列表起始索引
+    void ApplistPresenter::SetArcListStartIndex(uint16_t index)
+    {
+        model->SetArcListStartIndex(index);
+        return;
+    }
+
+    //获取弧形列表起始索引
+    uint16_t ApplistPresenter::GetArcListStartIndex(void)
+    {
+        return model->GetArcListStartIndex();
+    }
+
+    //设置弧形列表头部Item的Y坐标
+    void ApplistPresenter::SetArcListHeadItemY(int y)
+    {
+        model->GetArcListHeadItemY(y);
+    }
+
+    //获取弧形列表头部Item的Y坐标
+    int ApplistPresenter::GetArcListHeadItemY(void)
+    {
+        return model->GetArcListHeadItemY();
+    }
+
     uint8_t ApplistPresenter::GetListItemNum(void)
     {
         return model->GetAppListNum();
index 897e2ed..285147d 100644 (file)
@@ -288,7 +288,7 @@ void ApplistView::ArcScaleListStyleOnStart(void)
     
         ArcScaleList_->SetPosition(ARC_SCALE_LIST_X, ARC_SCALE_LIST_Y, ARC_SCALE_LIST_WIDTH, ARC_SCALE_LIST_HEIGHT);
         ArcScaleList_->SetItemTransformFunc(&TransformItemBaseOnPosition);
-        ArcScaleList_->SetAdapter(ArcScaleListAdapter_);
+        // ArcScaleList_->SetAdapter(ArcScaleListAdapter_);
         ArcScaleList_->SetDraggable(true);
         ArcScaleList_->SetThrowDrag(true);
         ArcScaleList_->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT);
@@ -365,8 +365,15 @@ void ApplistView::ListStyleOnSetUpView()
         startIndex = presenter_->GetListItemNum() - 1;
         headY = VERTICAL_RESOLUTION / NUM_2;
     } else {
-        startIndex = presenter_->GetStartIndex();
-        headY = presenter_->GetHeadItemY();
+        uint16_t presliceId = NativeAbility::GetInstance().GetPreSliceId();
+        if (presliceId == VIEW_MAIN) //如果是从主页进入的,那么startIndex = 0,headY = 0
+        {
+            startIndex = 0;
+            headY = 0;
+        } else {
+            startIndex = presenter_->GetStartIndex();
+            headY = presenter_->GetHeadItemY(); 
+        } 
         if (headY == 0) {
             headY = VERTICAL_RESOLUTION / NUM_2;
         }
@@ -379,7 +386,35 @@ void ApplistView::ListStyleOnSetUpView()
 
 void ApplistView::ArcScaleListStyleOnSetUpView(void)
 {
-    // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ApplistView::ArcScaleListStyleOnSetUpView [%d]", __LINE__);
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::ArcScaleListStyleOnSetUpView [%d]", __LINE__);
+    if (ArcScaleList_ == nullptr || ArcScaleListAdapter_ == nullptr) {
+        return;
+    }
+
+    uint16_t startIndex = 0;
+    int16_t headY = 0;
+    if (presenter_->GetArcListStartIndex() >= presenter_->GetListItemNum()) { 
+        startIndex = presenter_->GetListItemNum() - 1;
+        headY = VERTICAL_RESOLUTION / NUM_2;
+    } else {
+        uint16_t presliceId = NativeAbility::GetInstance().GetPreSliceId();
+        if (presliceId == VIEW_MAIN) //如果是从主页进入的,那么startIndex = 0,headY = 0
+        {
+            startIndex = 0;
+            headY = 0;
+        } else { //如果是从其他页面进入的,那么startIndex = presenter_->GetArcListStartIndex(),headY = presenter_->GetArcListHeadItemY()
+            startIndex = presenter_->GetArcListStartIndex();
+            headY = presenter_->GetArcListHeadItemY();
+        }
+        if (headY == 0) { 
+            headY = VERTICAL_RESOLUTION / NUM_2;
+        }
+    }
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[%d],startIndex = %d,headY = %d", __LINE__,startIndex,headY);
+    ArcScaleList_->SetStartIndex(startIndex);//设置起始索引。
+    ArcScaleList_->SetAdapter(ArcScaleListAdapter_);
+    ArcScaleList_->ScrollBy(headY);//滚动到指定的 headY 位置。
+    return;
 }
 
 void ApplistView::OnTearDownView()
@@ -489,6 +524,12 @@ void ApplistView::ArcScaleListStyleOnStop(void)
         // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ApplistView::ArcScaleListStyleOnStop [%d]", __LINE__);
         ArcScaleListGroup_->RemoveAll();
     }
+    int16_t arclistHeadY = ArcScaleList_->GetChildrenHead()->GetY();
+    int16_t arclistHeadIndex = ArcScaleList_->GetChildrenHead()->GetViewIndex();
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[%d],listHeadY = %d,listHeadIndex = %d", __LINE__,arclistHeadY,arclistHeadIndex);
+    presenter_->SetArcListHeadItemY(arclistHeadY);         //设置头部Y坐标
+    presenter_->SetArcListStartIndex(arclistHeadIndex);   //设置头部Index
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::ListStyleOnStop end...");
 }
 
 void ApplistView::AddAppItemToList(const AppItem &item)
index 0418fd1..92cffcc 100644 (file)
@@ -2,11 +2,12 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-03-27 15:21:17
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-09-30 11:10:19
+ * @LastEditTime: 2024-10-12 17:22:50
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneModel.h
  */
 #ifndef FINDPHONE_MODEL_H
 #define FINDPHONE_MODEL_H
+#include "cstdint"
 
 namespace OHOS
 {
@@ -16,7 +17,7 @@ namespace OHOS
         static FindPhoneModel &GetInstance();
         void SetBlueToothConnectedState(bool state);
         bool GetBlueToothConnectedState();
-        void start_or_stop_find_phone(int val);
+        void start_or_stop_find_phone(uint8_t val);
     private:
         FindPhoneModel() {}
         ~FindPhoneModel() {}
index eb54d64..aa6df22 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-03-27 15:21:30
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-09-30 11:11:00
+ * @LastEditTime: 2024-10-12 17:18:27
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneModel.cpp
  */
 
@@ -39,12 +39,17 @@ namespace OHOS
     }
 
     // 开始或停止查找手机
-    void FindPhoneModel::start_or_stop_find_phone(int val)
+    void FindPhoneModel::start_or_stop_find_phone(uint8_t val)
     {
+        WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "start_or_stop_find_phone %d", val);
         // 发送指令停止震动
         if (FindPhoneModel::GetInstance().GetBlueToothConnectedState())
         {
             senfindphoneSend(val);
         }
+        else
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "start_or_stop_find_phone not connected");
+        }
     }
 }
\ No newline at end of file
index 4635d25..d8e920d 100644 (file)
@@ -8,7 +8,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-03-27 10:47:46
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-05 10:16:43
+ * @LastEditTime: 2024-10-12 17:13:01
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp
  */
 #include "findphone/include/FindPhoneView.h"
@@ -283,11 +283,13 @@ namespace OHOS
 
         if (FindPhoneModel::GetInstance().GetBlueToothConnectedState() == true) // 判断蓝牙是否是连接状态
         {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phone is connected");
             FindPhoneViewInit_BlueToothConnected();
             FindPhoneModel::GetInstance().start_or_stop_find_phone(FINDPHONE_START);
         }
         else
         {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phone is not connected");
             FindPhoneViewInit_BlueToothDisConnected();
         }
 
index dc906ba..01c4560 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com\r
  * @Date: 2024-04-04 15:13:51\r
  * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-08-20 11:25:11\r
+ * @LastEditTime: 2024-10-12 16:05:30\r
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchPresenter.h\r
  */\r
 #ifndef MAIN_STOPWATCH_PRESENTER_H\r
@@ -66,6 +66,7 @@ namespace OHOS
         uint64_t lastRecordTime = 0; // 上次记录时间\r
         int RecordCycleNumber{0};    // 用来记录计时圈数\r
         bool X_DRAG_FLAG{false};\r
+        bool isStartMark{false};\r
     };\r
 } // namespace OHOS\r
 \r
index b950eec..97a5d9c 100644 (file)
@@ -88,7 +88,7 @@ namespace OHOS
         label->SetPosition(x, y);\r
         label->SetStyle(STYLE_TEXT_FONT, TextFont);\r
         label->SetStyle(STYLE_LINE_HEIGHT, LineHeight);\r
-        label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, TextFont);\r
+        label->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, TextFont);\r
         label->Invalidate();\r
     }\r
 \r
@@ -171,7 +171,7 @@ namespace OHOS
         UNUSED(view);\r
         MainStopWatchView *mainStopWatchView = MainStopWatchView::GetInstance();\r
         const char *clickedViewId = view.GetViewId();\r
-        if (strcmp(clickedViewId, ResetOrMarkButton_MARK_VIEWID) == 0)\r
+        if (strcmp(clickedViewId, ResetOrMarkButton_MARK_VIEWID) == 0) // 点击标记按钮\r
         {\r
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RecordCycleNumber:%d\n", RecordCycleNumber);\r
             if (RecordCycleNumber >= MAX_RECORD_LOOPS) // 到达最高记录圈数\r
@@ -184,10 +184,16 @@ namespace OHOS
             {\r
                 RecordCycleNumber += 1;\r
             }\r
-            mainStopWatchView->SetViewIsVisible(m_stopWatchlabel, false);\r
-            SetShowTimeLableStyle(m_showTimelabel, 93, 60, 65, 78);\r
-            mainStopWatchView->SetViewIsVisible(m_list, true);\r
-            mainStopWatchView->SetViewIsVisible(m_image, true);\r
+\r
+            if (isStartMark == false) // 第一次标记\r
+            {\r
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "isStartMark = %d", isStartMark);\r
+                mainStopWatchView->SetViewIsVisible(m_stopWatchlabel, false);\r
+                SetShowTimeLableStyle(m_showTimelabel, 0, 60, 65, 78);\r
+                mainStopWatchView->SetViewIsVisible(m_list, true);\r
+                mainStopWatchView->SetViewIsVisible(m_image, true);\r
+                isStartMark = true;\r
+            }\r
 \r
             uint64_t currentRecordTime = TimeStrToMilliseconds(MainStopWatchView::GetInstance()->GetShowTimelabel()->GetText()); // 获取当前时间\r
             uint64_t timeDifference = 0;                                                                                         // 时间差值\r
@@ -219,7 +225,7 @@ namespace OHOS
             lastRecordTime = currentRecordTime;\r
             return true;\r
         }\r
-        else if (strcmp(clickedViewId, ResetOrMarkButton_RESET2_VIEWID) == 0)\r
+        else if (strcmp(clickedViewId, ResetOrMarkButton_RESET2_VIEWID) == 0) // 点击重置按钮\r
         {\r
             StopWatchModel::GetInstance()->StopWatch_StopTimer(); // 停止定时器\r
             mainStopWatchView->GetShowTimelabel()->SetText("00:00.00");\r
@@ -229,15 +235,21 @@ namespace OHOS
             m_button->SetImageSrc(ResetOrMarkButtonImg_Reset1, ResetOrMarkButtonImg_Reset1);\r
             m_button->Invalidate();\r
 \r
-            mainStopWatchView->SetViewIsVisible(m_stopWatchlabel, true);\r
-            SetShowTimeLableStyle(m_showTimelabel, 68, 160, 84, 94);\r
-            mainStopWatchView->SetViewIsVisible(m_image, false);\r
-            mainStopWatchView->SetViewIsVisible(m_list, false);\r
+            if (isStartMark == true) // 重置标记\r
+            {\r
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "isStartMark = %d", isStartMark);\r
+                mainStopWatchView->SetViewIsVisible(m_stopWatchlabel, true);\r
+                SetShowTimeLableStyle(m_showTimelabel, 0, 160, 84, 94);\r
+                mainStopWatchView->SetViewIsVisible(m_image, false);\r
+                mainStopWatchView->SetViewIsVisible(m_list, false);\r
+                isStartMark = false;\r
+            }\r
 \r
             if (m_listdata != nullptr)\r
             {\r
                 for (int i = 0; i < m_listdata->Size(); i++)\r
                 {\r
+                    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "%d", i);\r
                     char *p = (char *)(m_listdata->Tail()->data_);\r
                     free(p);\r
                 }\r
@@ -250,11 +262,11 @@ namespace OHOS
             }\r
             RecordCycleNumber = 0;\r
         }\r
-        else if (strcmp(clickedViewId, CycleToLimitReturnButton_VIEWID) == 0)\r
+        else if (strcmp(clickedViewId, CycleToLimitReturnButton_VIEWID) == 0) // 点击返回按钮\r
         {\r
             mainStopWatchView->ChangeView(STOPWATCH_RECORD_CYCLE_TO_LIMIT, MAIN_STOPWATCH);\r
         }\r
-        else if (strcmp(clickedViewId, TimeToLimitReturnButton_VIEWID) == 0)\r
+        else if (strcmp(clickedViewId, TimeToLimitReturnButton_VIEWID) == 0) // 点击返回按钮\r
         {\r
             mainStopWatchView->ChangeView(STOPWATCH_RECORD_TIME_TO_LIMIT, MAIN_STOPWATCH);\r
         }\r
index fd48486..89538ec 100644 (file)
@@ -273,11 +273,11 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showTimelabel new fail!!");\r
                 return;\r
             }\r
-            showTimelabel->SetPosition(68, 160);\r
+            showTimelabel->SetPosition(0, 160,466, 94);\r
             showTimelabel->SetStyle(STYLE_TEXT_FONT, 84);\r
             showTimelabel->SetStyle(STYLE_LINE_HEIGHT, 94);\r
             showTimelabel->SetText("00:00.00");\r
-            showTimelabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);\r
+            showTimelabel->SetLineBreakMode(UILabel::LINE_BREAK_CLIP);\r
             showTimelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);\r
             showTimelabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 84);\r
             /* -------------------------------- LineImage ------------------------------- */\r
@@ -316,7 +316,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "listadapter new fail!!");\r
                 return;\r
             }\r
-            listadapter->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28);\r
+            listadapter->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 28);\r
             /* -------------------------------- listdata -------------------------------- */\r
             listdata = new List<const char *>();\r
             if (listdata == nullptr)\r
index 0bb93fb..b37b7f6 100644 (file)
@@ -17,7 +17,7 @@ namespace OHOS
 \r
     /* ----------------------------------- 定时器 ---------------------------------- */\r
     // 声明定时器变量\r
-    static osTimerId_t g_timer = NULL;\r
+    static osTimerId_t g_timer = nullptr;\r
     static int g_StopWatchTimes = {0};\r
     static constexpr int32 NUM_TEN = 10; // 主要用于格式化输出,当小时、分钟或秒小于10时,在其前面添加一个’0’以保持常规时间格式\r
     static constexpr int16 ERROR = 0;\r
@@ -25,7 +25,7 @@ namespace OHOS
     static constexpr int16 NUM_TIME_MIN = 60;\r
     static constexpr int16 NUM_TIME_HOUR = 3600;\r
     static constexpr int32 NUM_TIME_DAY = 86400;\r
-    static constexpr int32 MAX_NUM_TIME = (99 * 60 * 1000) + (59 * 1000) + 990; // 99分59秒990毫秒\r
+    static constexpr int32 MAX_STOPWATCH_TIME = (99 * 60 * 1000) + (59 * 1000) + 990; // 99分59秒990毫秒\r
     static uint64_t g_timerStartTimestamp = 0;                                  // 添加一个全局变量来存储定时器开始的时间戳\r
     /*\r
      * @brief 显示倒计时(分钟、秒、毫秒),毫秒显示为两位数\r
@@ -81,28 +81,13 @@ namespace OHOS
      */\r
     static void StopWatch_TimerCallbackProc(int data)\r
     {\r
-        g_StopWatchTimes += 10; // 每次回调增加10毫秒\r
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "g_StopWatchTimes:%d\n", g_StopWatchTimes);\r
-\r
-        if (MainStopWatchView::GetInstance() == nullptr)\r
-        {\r
-            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[StopWatch_TimerCallbackProc] GetInstance is NULL");\r
-            return;\r
-        }\r
-\r
-        if (MainStopWatchView::GetInstance()->GetShowTimelabel() == nullptr)\r
+        if (MainStopWatchView::GetInstance() == nullptr || MainStopWatchView::GetInstance()->GetShowTimelabel() == nullptr || StopWatchModel::GetInstance()->DisplayStopWatchDuration() == nullptr)\r
         {\r
-            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[StopWatch_TimerCallbackProc] GetInstance()->GetShowTimelabel is NULL");\r
             return;\r
         }\r
 \r
-        if (StopWatchModel::GetInstance()->DisplayStopWatchDuration() == nullptr)\r
-        {\r
-            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[StopWatch_TimerCallbackProc] DisplayStopWatchDuration is NULL");\r
-            return;\r
-        }\r
+        if ((g_StopWatchTimes) >= MAX_STOPWATCH_TIME) // 达到最大时间\r
 \r
-        if ((g_StopWatchTimes) >= MAX_NUM_TIME) // 5999990 = 99分59秒99的毫秒数\r
         {\r
             MainStopWatchView::GetInstance()->GetPlayOrPausecheckBox()->SetState(UICheckBox::UNSELECTED);\r
             MainStopWatchView::GetInstance()->ChangeRecordTimeToLimitView();\r
@@ -118,6 +103,7 @@ namespace OHOS
      */\r
     static void StopWatch_TimerCallback(int data)\r
     {\r
+        g_StopWatchTimes += 10; // 每次回调增加10毫秒\r
         GraphicService::GetInstance()->PostGraphicEvent(std::bind(StopWatch_TimerCallbackProc, data));\r
     }\r
 \r
@@ -128,16 +114,16 @@ namespace OHOS
     void StopWatchModel::StopWatch_StartTimer(uint32_t interval)\r
     {\r
         /* -------------------------- 1.检查定时器是否已经存在,如果存在则返回 ------------------------- */\r
-        if (g_timer != NULL)\r
+        if (g_timer != nullptr)\r
         {\r
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "StopWatchModel::StopWatch_StartTimer Timer already exists!!");\r
             return;\r
         }\r
 \r
         /* --------------------------------- 2.创建定时器 -------------------------------- */\r
-        g_timer = osTimerNew((osTimerFunc_t)StopWatch_TimerCallback, osTimerPeriodic, NULL, NULL);\r
+        g_timer = osTimerNew((osTimerFunc_t)StopWatch_TimerCallback, osTimerPeriodic, nullptr, nullptr);\r
         // 检查定时器创建是否成功\r
-        if (g_timer == NULL)\r
+        if (g_timer == nullptr)\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StopWatchModel::StopWatch_StartTimer Timer create failed!!");\r
             return;\r
@@ -149,15 +135,15 @@ namespace OHOS
         /* --------------------------------- 4.启动定时器 -------------------------------- */\r
         // g_timerStartTimestamp = GetCurrentTimestamp(); // 假设GetCurrentTimestamp()是获取当前时间戳的函数\r
         osStatus_t ret = osTimerStart(g_timer, tick);\r
-        /* -------------------- 5.检查定时器启动是否成功,如果启动失败,删除定时器并置为 NULL -------------------- */\r
+        /* -------------------- 5.检查定时器启动是否成功,如果启动失败,删除定时器并置为 nullptr -------------------- */\r
         if (ret != osOK)\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[StopWatch_StartTimer]osTimerDelete failed, ret = %lx!!", ret);\r
-            if (g_timer != NULL)\r
+            if (g_timer != nullptr)\r
             {\r
                 ret = osTimerDelete(g_timer);\r
             }\r
-            g_timer = NULL;\r
+            g_timer = nullptr;\r
             return;\r
         }\r
         return;\r
@@ -169,16 +155,16 @@ namespace OHOS
     void StopWatchModel::StopWatch_StopTimer(void)\r
     {\r
         // 检查定时器是否存在\r
-        if (g_timer != NULL)\r
+        if (g_timer != nullptr)\r
         {\r
             osTimerStop(g_timer);\r
-            // 删除定时器并置为 NULL\r
+            // 删除定时器并置为 nullptr\r
             osStatus_t ret = osTimerDelete(g_timer);\r
             if (ret != osOK)\r
             {\r
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret);\r
             }\r
-            g_timer = NULL;\r
+            g_timer = nullptr;\r
             g_StopWatchTimes = 0;\r
         }\r
     }\r
@@ -188,7 +174,7 @@ namespace OHOS
     void StopWatchModel::StopWatch_PauseTimer(void)\r
     {\r
         // 检查定时器是否存在\r
-        if (g_timer != NULL)\r
+        if (g_timer != nullptr)\r
         {\r
             // 暂停定时器,但不删除它\r
             osStatus_t ret = osTimerStop(g_timer);\r
@@ -205,7 +191,7 @@ namespace OHOS
     void StopWatchModel::StopWatch_ResumeTimer(uint32_t interval)\r
     {\r
         // 检查定时器是否存在\r
-        if (g_timer != NULL)\r
+        if (g_timer != nullptr)\r
         {\r
             int tick = osMs2Tick(interval);\r
             // 恢复定时器\r
index 9a3d984..3108827 100644 (file)
@@ -1202,6 +1202,10 @@ void MsgCenterNotifyFindWatchProc(const Topic topic, Request* req)
         NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
         NotificationManager::GetInstance()->ShowNotify(showFindWatchNotify, (uint16_t)topic, true);
     }
+    else
+    {
+        WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "NotifyPriority = %d ",NotificationManager::GetInstance()->GetNotifyPriority());
+    }
 }
 
 //取消查找手表通知
@@ -1335,6 +1339,7 @@ void MsgCenterNotifyArAlertProc(const Topic topic, Request* req)
     if (CheckPriority(topic))
     {
         MotionRecognitionViewEventListener::GetInstance().SetMotionTypeId(*motionType);
+        NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
         NotificationManager::GetInstance()->ShowNotify(showMotionRecognitionNotify, (uint16_t)topic, true);
     }