From: Caisking Date: Sun, 21 Sep 2025 10:51:38 +0000 (+0800) Subject: 绑定先增加外网判断;没有外网是无效二维码 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~4^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=0957b014d467adf1c5830a6c2c26c8afb6cdf2b7;p=mirrors%2FFD230.git 绑定先增加外网判断;没有外网是无效二维码 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h index b1cd44855..ce774129a 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h @@ -156,6 +156,9 @@ namespace OHOS bool GetQrcodeChecked(); void SetQrcodeChecked(bool checked); + bool getbind_status(); + + bool Get_is_ln_get_device_token_success(); private: ThunderBirdModel(); 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 24da3b683..a94fec254 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 @@ -317,6 +317,10 @@ { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::StartBootOperation"); return bind_status; + } + bool ThunderBirdModel::getbind_status() + { + return bind_status; } //判断是否绑定 ThunderBirdModel::BindingStatus ThunderBirdModel::CheckBindingStatus() @@ -998,6 +1002,11 @@ m_statusTimer = nullptr; } } + // 获取token是否有效 其实是是否有外网 + bool ThunderBirdModel::Get_is_ln_get_device_token_success() + { + return get_is_ln_get_device_token_success(); + } /** * @brief 状态管理回调处理 */ @@ -1218,7 +1227,7 @@ } // 二维码是否有效更新过 - bool ThunderBirdModel::GetQrcodeChecked() const + bool ThunderBirdModel::GetQrcodeChecked() { return m_qrcodeChecked; } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp index 28fd80494..aab20df46 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp @@ -224,7 +224,7 @@ namespace OHOS // 短按FUNC键(息屏状态下) if (keyState == InputDevice::STATE_PRESS && screenState == 0) { // 检查绑定状态 - if (ThunderBirdModel::GetInstance()->CheckBindingStatus() != ThunderBirdModel::BindingStatus::BOUND) { + if (ThunderBirdModel::GetInstance()->getbind_status() != true) { if (currentSubView != ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3) { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3); } @@ -251,7 +251,7 @@ namespace OHOS { if (keyState == InputDevice::STATE_PRESS && screenState == 0) { // 检查绑定状态 - if (ThunderBirdModel::GetInstance()->CheckBindingStatus() != ThunderBirdModel::BindingStatus::BOUND) { + if (ThunderBirdModel::GetInstance()->getbind_status() != true) { if (currentSubView != ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3) { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3); } @@ -285,7 +285,7 @@ namespace OHOS if (keyState == InputDevice::STATE_PRESS && screenState == 0) { // 检查绑定状态 - if (ThunderBirdModel::GetInstance()->CheckBindingStatus() != ThunderBirdModel::BindingStatus::BOUND) { + if (ThunderBirdModel::GetInstance()->getbind_status() != true) { if (currentSubView != ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3) { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3); } @@ -620,6 +620,11 @@ namespace OHOS void ThunderBirdPresenter::UpdateQrcodeIfValid() { + if(ThunderBirdModel::GetInstance()->Get_is_ln_get_device_token_success() == false) + { + return; + } + // 检查IMEI是否有效 并且 二维码是否有效更新过 if (ThunderBirdModel::GetInstance()->IsIMEIValid() && ThunderBirdModel::GetInstance()->GetQrcodeChecked() == true) { return;