From: Caisking Date: Sat, 20 Sep 2025 12:59:46 +0000 (+0800) Subject: 增加绑定信息的kv存储 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~30 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=af7c0915be7e8ae03b281a39a386a115d1cd5f30;p=mirrors%2FFD230.git 增加绑定信息的kv存储 --- 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); }