From: 孙春阳 Date: Tue, 2 Dec 2025 03:37:39 +0000 (+0800) Subject: updateNetworkStatus只在亮屏时更新。 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=f2b768d3e67d359983eb5d51ce3e061c982a0773;p=mirrors%2FFD230.git updateNetworkStatus只在亮屏时更新。 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index 0e58d992d..555cacc49 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -2132,6 +2132,16 @@ extern "C" { */ void ThunderBirdModel::UpdateNetworkStatus() { + + + // 检查屏幕状态:息屏时不更新网络状态,节省功耗 + int screenState = uapi_get_screen_state(); + if (screenState != 0) { + // 屏幕关闭(screenState != 0 表示息屏),不执行网络状态更新 + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UpdateNetworkStatus: Screen is off (state=%d), skip network status update", screenState); + return; + } + // 保存之前的网络状态,用于变化检测 int previousNetworkStatus = m_networkStatus; bool previousHasNetwork = m_hasNetwork;