显示方式Model文件SetAppListDisplayStyle函数添加错误日志打印
authorluozheng <1732036298@qq.com>
Sat, 22 Jun 2024 07:46:48 +0000 (15:46 +0800)
committerluozheng <1732036298@qq.com>
Sat, 22 Jun 2024 07:46:48 +0000 (15:46 +0800)
code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleModel.cpp
code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp

index 6da8835..58ba505 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-07 09:21:47
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-06-18 14:42:50
+ * @LastEditTime: 2024-06-22 15:10:07
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/ThemeStyleModel.cpp
  */
 
@@ -10,6 +10,7 @@
 #include "kv_store.h"
 #include "securec.h"
 #include "wearable_log.h"
+#include <ohos_errno.h>
 namespace OHOS
 {
     static const int STYLE_VALUE_LEN = 32;
@@ -49,13 +50,18 @@ namespace OHOS
     /// @param style 要设置的风格样式
     void ThemeStyleModel::SetAppListDisplayStyle(ThemeStyle style)
     {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThemeStyleModel::SetAppListDisplayStyle");
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThemeStyleModel::SetAppListDisplayStyle,style = %d", style);
 
         // 检查是否存在对应的样式选项
         if (ThemeStyleMap.find(style) != ThemeStyleMap.end())
         {
             // 根据映射设置显示样式值
-            (void)UtilsSetValue(THEMESTYLE_KEY, ThemeStyleMap.at(style).c_str());
+            int ret = UtilsSetValue(THEMESTYLE_KEY, ThemeStyleMap.at(style).c_str());
+            if (ret != EC_SUCCESS)
+            {
+                WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UtilsSetValue error,ret = %d", ret);
+                return;
+            }
         }
         else
         {
@@ -63,7 +69,7 @@ namespace OHOS
         }
     }
 
-    //获取选中的样式Id
+    // 获取选中的样式Id
     uint16_t ThemeStyleModel::GetSelectThemeStyleId(void)
     {
         return GetAppListDisplayStyle();
index 114fc4b..311cba0 100755 (executable)
@@ -183,7 +183,7 @@ void Ability::PostChangeSlice(const uint16_t targetSliceId, TransitionType type,
 
 void Ability::OnTransitionEnd()
 {
-    WEARABLE_LOGE(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::OnTransitionEnd");
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::OnTransitionEnd");
     if (!sliceTransition_.IsCurrentSnapshotEnabled()) {
         if (prevSlice_.slice != nullptr) {
             prevSlice_.slice->OnStop();