优化时间同步
authorxue <2144439972@qq.com>
Fri, 28 Nov 2025 02:05:47 +0000 (10:05 +0800)
committerxue <2144439972@qq.com>
Fri, 28 Nov 2025 02:05:47 +0000 (10:05 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp

index bd612f2..2e44a37 100644 (file)
@@ -1545,10 +1545,11 @@ extern "C" {
             {
                 if (init_falg == false) 
                 {
-                    #if defined(SUPPORT_CAT1_SERVICE) || defined(SUPPORT_PPP_SERVICE)
-                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandlePowerKey: restart_time_sync");
-                    restart_time_sync();
-                    #endif
+                    // #if defined(SUPPORT_CAT1_SERVICE) || defined(SUPPORT_PPP_SERVICE)
+                    // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandlePowerKey: restart_time_sync");
+                    // restart_time_sync();
+                    // #endif
+                    cat1_gettime();
                     //发送获取绑定用户ID
                     do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_GET_USER_ID, NULL, 0);
                     // 网络连接成功,调用HTTP服务获取设备Token
index 0201030..603a893 100644 (file)
@@ -278,10 +278,11 @@ namespace OHOS
         // 按下电源键
         if (keyState == InputDevice::STATE_PRESS) {
             powerKeyPressed = true; // 设置按下标志位
-            #if defined(SUPPORT_CAT1_SERVICE) || defined(SUPPORT_PPP_SERVICE)
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandlePowerKey: restart_time_sync");
-            restart_time_sync();
-            #endif
+            // #if defined(SUPPORT_CAT1_SERVICE) || defined(SUPPORT_PPP_SERVICE)
+            // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandlePowerKey: restart_time_sync");
+            // restart_time_sync();
+            // #endif
+            cat1_gettime();
             if (screenState == 1) {
                 // 息屏状态下按下:亮屏(由系统自动处理)
                 // 亮屏时触发时间同步
@@ -925,10 +926,12 @@ namespace OHOS
      */
     void ThunderBirdPresenter::HandleFuncKeyLongPress(void)
     {
-        #if defined(SUPPORT_CAT1_SERVICE) || defined(SUPPORT_PPP_SERVICE)
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandleFuncKeyLongPress: restart_time_sync");
-        restart_time_sync();
-        #endif
+        // #if defined(SUPPORT_CAT1_SERVICE) || defined(SUPPORT_PPP_SERVICE)
+        // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandleFuncKeyLongPress: restart_time_sync");
+        // restart_time_sync();
+        // #endif
+        cat1_gettime();
+     
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdPresenter::HandleFuncKeyLongPress - FUNC key long press detected");
         // 长按FUNC键2秒的处理逻辑
         // 触发对话模式切换