From 3fc29d1e8dd93935a8799c0b92ae9e3ed47b3698 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Mon, 1 Jul 2024 14:59:05 +0800 Subject: [PATCH] =?utf8?q?=E8=A1=A8=E7=9B=98BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/set_dial/src/SetDialModel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp index b9d56647b..770037a22 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp @@ -136,11 +136,13 @@ namespace OHOS /* 注册表盘map */ void SetDialModel::RegisterDial(uint16_t ID, const char *dialname) { + if(ID==0 || strlen(dialname)==0) + return; registeredDials[ID] = std::string(dialname); // 唯一性 - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RegisterDial %s is ok!", dialname); - + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RegisterDial %d %s is ok!",ID, dialname); + LoadAllDial(); saveDialfile(); @@ -224,6 +226,8 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UninstallDial the dial %d is ok", ID); registeredDials.erase(ID); + LoadAllDial(); + return true; } -- 2.17.1