From 47093c328f17972f590299682c938a8ac570c6d8 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 26 Mar 2026 16:48:52 +0800 Subject: [PATCH] =?utf8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E7=95=8C=E9=9D=A2?= =?utf8?q?=E7=94=B5=E9=87=8F=E6=9B=B4=E6=96=B0=E6=94=B9=E6=88=905s?= =?utf8?q?=E4=B8=80=E5=8F=AA=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../watchQRcode/include/WatchQRCodeView.h | 2 +- .../watchQRcode/src/WatchQRCodeView.cpp | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/include/WatchQRCodeView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/include/WatchQRCodeView.h index da9ad8129..4aff788bf 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/include/WatchQRCodeView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/include/WatchQRCodeView.h @@ -29,7 +29,7 @@ namespace OHOS static uint8_t refresh_time; std::string get_voltage_and_version_string(void); void update_label(void); - void start_refresh_timer(uint32_t interval = 2000); + void start_refresh_timer(uint32_t interval = 5000); void stop_refresh_timer(void); /* -------------------------------------------------------------------------- */ diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/src/WatchQRCodeView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/src/WatchQRCodeView.cpp index 485b93511..f2299c707 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/src/WatchQRCodeView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/src/WatchQRCodeView.cpp @@ -214,9 +214,9 @@ namespace OHOS /*定时器到期时的处理*/ static void QRCodeView_TimerCallbackProc(int data) { - if (uapi_get_screen_state() == 0) // 如果在亮屏状态 + // if (uapi_get_screen_state() == 0) // 如果在亮屏状态 { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "uapi_get_screen_state() == 0"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_get_screen_state() == 0"); if (WatchQRCodeView::GetInstance()) { WatchQRCodeView::GetInstance()->update_label(); @@ -226,26 +226,26 @@ namespace OHOS WatchQRCodeView::refresh_time = UPDATETIME_OUT; } } - else - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "uapi_get_screen_state() == 1"); - WatchQRCodeView::refresh_time -= 2; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "%d", WatchQRCodeView::refresh_time); - if (WatchQRCodeView::refresh_time <= 0) // 息屏状态下超时删除定时器 - { - if (WatchQRCodeView::GetInstance()) - { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&WatchQRCodeView::stop_refresh_timer, WatchQRCodeView::GetInstance())); - } - } - else - { - if (WatchQRCodeView::GetInstance()) - { - WatchQRCodeView::GetInstance()->update_label(); - } - } - } + // else + // { + // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "uapi_get_screen_state() == 1"); + // WatchQRCodeView::refresh_time -= 2; + // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "%d", WatchQRCodeView::refresh_time); + // if (WatchQRCodeView::refresh_time <= 0) // 息屏状态下超时删除定时器 + // { + // if (WatchQRCodeView::GetInstance()) + // { + // GraphicService::GetInstance()->PostGraphicEvent(std::bind(&WatchQRCodeView::stop_refresh_timer, WatchQRCodeView::GetInstance())); + // } + // } + // else + // { + // if (WatchQRCodeView::GetInstance()) + // { + // WatchQRCodeView::GetInstance()->update_label(); + // } + // } + // } return; } -- 2.17.1