From 14371e977068e58de070d1e9f11ce9b81496f08e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Thu, 26 Mar 2026 11:26:43 +0000 Subject: [PATCH] Merge #3312 into fd272 from refs/changes/3312/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 二维码界面电量更新改成5s一只刷新 * refs/changes/3312/head: (1 commits squashed) - 二维码界面电量更新改成5s一只刷新 Signed-off-by: 罗正 <1732036298@qq.com> Merged-by: Caisking <3449750381@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/3312 --- .../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