From af7c0915be7e8ae03b281a39a386a115d1cd5f30 Mon Sep 17 00:00:00 2001 From: Caisking Date: Sat, 20 Sep 2025 20:59:46 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E7=BB=91=E5=AE=9A=E4=BF=A1?= =?utf8?q?=E6=81=AF=E7=9A=84kv=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../thunderbird/src/ThunderBirdModel.cpp | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 45b03757b..ca5d7614e 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 @@ -29,6 +29,7 @@ #include #include "custom_runtime.h" #include "ln_api.h" + #include "kv_store.h" namespace OHOS { enum OTA_STATUS @@ -61,6 +62,20 @@ { // 初始化时加载提醒数据 // LoadRemindersFromFile(); + // 读取绑定状态 + char temp[10] = { 0 }; + (void)UtilsGetValue("bind_status", temp, 10); + if(strcmp(temp, "1") == 0) + { + m_imeiValid = true; + m_imeiChecked = true; + } + else + { + m_imeiValid = false; + m_imeiChecked = true; + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "目前绑定状态 %s", temp); } ThunderBirdModel::~ThunderBirdModel() @@ -1154,7 +1169,14 @@ // 检查IMEI有效性 m_imeiValid = IsDeviceIdValid(); - m_imeiChecked = true; + + if(m_imeiValid){ + //有效 设置标志位为true + m_imeiChecked = true; + //存储kv + (void)UtilsSetValue("bind_status", "1"); + return; + } WEARABLE_LOGD("IMEI status checked: valid=%d", m_imeiValid); } -- 2.17.1