修改kv的拼接问题
authorCaisking <Casiking@zhihuishixun.com>
Thu, 22 May 2025 01:54:47 +0000 (09:54 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Thu, 22 May 2025 01:54:47 +0000 (09:54 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/screensetting/src/ScreenModels.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/Systemupgrade.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/Systemupgrade.cpp
code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp
code/sdk/open_source/openharmony/utils/native/lite/kv_store/src/kvstore_impl_posix/kv_store.c

index e93dc6a..82d5849 100644 (file)
@@ -38,7 +38,7 @@ void ScreenModels::InitKvStorage(void)
 {
 #if !defined(_WIN32)
 #ifndef XTS_SUPPORT
-    int ret = UtilsSetEnv("/user");
+    int ret = UtilsSetEnv("/user/system");
     WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "UtilsSetEnv /user ret = %d", ret);
 #endif
 #else
index 634c7a4..5ad8346 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SYSTEM_UPGRADE_VIEW_H
 #define SYSTEM_UPGRADE_VIEW_H
 
-#ifndef XTS_SUPPORT
+#if !defined(XTS_SUPPORT) && !defined(SUPPORT_CAT1_SERVICE)
 #include "View.h"
 
 #include "components/ui_image_view.h"
@@ -10,7 +10,9 @@
 #include "components/ui_label.h"
 #include "components/ui_label_ext.h"
 #include "components/ui_label_button_ext.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_ctl.h"
+#endif
 #include "upg_common_porting.h"
 
 #if USE_THISIOT
index bc5531e..4cde9a5 100644 (file)
@@ -1,4 +1,4 @@
-#ifndef XTS_SUPPORT
+#if defined(XTS_SUPPORT) && defined(SUPPORT_CAT1_SERVICE)
 
 #include "system/include/Systemupgrade.h"
 #include "system/include/SystemPresenter.h"
 #include <fstream>
 #include "cJSON.h"
 #include "ConfigModel.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "lwip/err.h"
+#include "lwip/apps/http_client.h"
+#endif
 #include "power_display_service.h"
 #include "cmsis_os2.h"
 #include "los_memory.h"
 #include "thread_init.h"
- #include "lwip/apps/http_client.h"
  #include "tcxo.h"
  #include "cat1_server.h"
  #include "linux/delay.h"
index 3a76e14..5720b83 100644 (file)
@@ -38,7 +38,7 @@ void ScreenModels::InitKvStorage(void)
 {
 #if !defined(_WIN32)
 #ifndef XTS_SUPPORT
-    int ret = UtilsSetEnv("/user");
+    int ret = UtilsSetEnv("/user/system");
     WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "UtilsSetEnv /user ret = %d", ret);
 #endif
 #else
index 6b20a15..fd8bd10 100644 (file)
 #include "ohos_types.h"
 #include "utils_config.h"
 
-#ifdef XTS_SUPPORT
 #define KVSTORE_PATH       "kvstore"
-#else
-#define KVSTORE_PATH       "user/system/kvstore"
-#endif
 #define MAX_KEY_PATH       256
 #define MAX_GET_VALUE_LEN  0x7FFFFFFF
 static pthread_mutex_t g_kvGlobalMutex = PTHREAD_MUTEX_INITIALIZER;