开机先开启蓝色屏幕再进入表盘。TODO:修改蓝色屏幕为开机logo
authorSnickerSun <snickersun@163.com>
Wed, 27 Dec 2023 16:54:32 +0000 (00:54 +0800)
committerSnickerSun <snickersun@163.com>
Wed, 27 Dec 2023 16:54:32 +0000 (00:54 +0800)
code/sdk/application/brandy/brandy_standard/thread_pri_init.c
code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c
code/sdk/application/wearable/ohos_startup/ohosfwk_startup.h
code/sdk/application/wearable/service/power_manager/src/power_display_service.c
code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp

index 31bc2ac..8fd3f57 100755 (executable)
@@ -224,15 +224,7 @@ static void thread_main(const void *unused)
         PRINT("dpal driver base init error"NEWLINE);
         panic(PANIC_ASSERT, __LINE__);
     }
-#ifdef CFG_DRIVERS_MMC
-    emmc_init();
-    g_store_init_select = STORE_CLASS_EMMC;
-    sdiom_internal_freq_handler_register(mmc_set_internal_clk);
-#endif
-#ifdef CFG_DRIVERS_NANDFLASH
-    nandflash_init();
-    g_store_init_select = STORE_CLASS_NAND;
-#endif
+
     uapi_pm_control(PM_DISPLAY_POWER_UP_AND_RUN);
     (void)osDelay(TICK_TEN_MS);
 
@@ -242,6 +234,8 @@ static void thread_main(const void *unused)
     uapi_pm_control(PM_DISPLAY_POWER_OFF);
 #endif
 
+
+
 #if DSP_EXIST == YES
     audio_init();
 #endif
@@ -250,6 +244,21 @@ static void thread_main(const void *unused)
     thread_init();
     button_app_init();
     uapi_calendar_init();
+    
+#ifdef SUPPORT_AT_OHOSFWK
+    show_logo();
+#endif
+
+#ifdef CFG_DRIVERS_MMC
+    emmc_init();
+    g_store_init_select = STORE_CLASS_EMMC;
+    sdiom_internal_freq_handler_register(mmc_set_internal_clk);
+#endif
+#ifdef CFG_DRIVERS_NANDFLASH
+    nandflash_init();
+    g_store_init_select = STORE_CLASS_NAND;
+#endif
+
 #ifdef SUPPORT_AT_OHOSFWK
     ohos_startup();
 #endif
index 474685d..2f15568 100755 (executable)
@@ -38,19 +38,25 @@ int32_t mbedtls_adapt_register(void)
     mbedtls_cipher_adapt_register_func(&harden_cipher_func);
     return 0;
 }
-void ohos_startup()
+
+void show_logo()
 {
-    mbedtls_adapt_register();
+
 #ifdef ENABLE_UIKIT
     InitGraphicService();
 #endif
 #ifdef SUPPORT_POWER_MANAGER
     const power_display_svr_api_t *display_api = power_display_svr_get_api();
     display_api->turn_on_screen();
-    display_api->set_screen_set_keepon_timeout(5000);
+    display_api->set_screen_set_keepon_timeout(10000);
 #endif
 #ifdef ENABLE_UIKIT
     ShowGraphicLogo();
 #endif
+}
+void ohos_startup()
+{
+    mbedtls_adapt_register();
+
     OHOS_SystemInit();
 }
index 0fa5ac3..cfdad67 100755 (executable)
@@ -32,7 +32,7 @@ typedef errcode_t (*message_handle)(uint32_t message_type, uint32_t message_valu
 
 static screen_context_t g_screen_context = {
     .screen_off_timeout = DISPLAY_AUTO_POWER_OFF_PERIOD_MS,
-    .keep_on_timeout = 60,// 将常亮屏超时时间修改为60秒
+    .keep_on_timeout = 0,// 将常亮屏超时时间修改为60秒
     .current_state = SCREEN_OFF,
     .brightness_mode = DISPLAY_DEFAULT_BRIGHTNESS,
     .brightness_value = 50,
index 3e1ae5f..0b7a221 100755 (executable)
 #include "common/screen.h"
 #include "components/root_view.h"
 #include "components/ui_image_view.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
+#include "pm_veto.h"
 static const uint32_t SECOND_TO_MILLISECOND = 1000;
 static rtc_handle_t g_rtcHandle = nullptr;
 static int32_t g_timeInterval = 16;
@@ -128,19 +128,25 @@ void ShowGraphicLogo()
     if (g_showLogo) {
         return;
     }
+    // uapi_pm_add_sleep_veto(PM_ID_SCREEN); //确保logo显示期间屏幕不熄灭
+   
     g_showLogo = true;
     g_logo = new OHOS::UIImageView();
     g_logo->SetPosition(0, 0, OHOS::Screen::GetInstance().GetWidth(), OHOS::Screen::GetInstance().GetHeight());
     g_logo->SetAutoEnable(false);
     g_logo->SetResizeMode(OHOS::UIImageView::CENTER);
-    g_imgInfo = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(IMAGE_OPEN_LOGO_PATH);
-    g_logo->SetSrc(g_imgInfo);
+    // g_imgInfo = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(IMAGE_OPEN_LOGO_PATH);
+    // g_logo->SetSrc(g_imgInfo);
+    g_logo->SetStyle(OHOS::STYLE_BACKGROUND_COLOR, 0xff007dff);
+    g_logo->SetStyle(OHOS::STYLE_BACKGROUND_OPA, 0xff);
     OHOS::GraphicEventHandler::GetInstance()->PostGraphicEvent(
         [] {
             OHOS::RootView::GetInstance()->Add(g_logo);
             OHOS::RootView::GetInstance()->Invalidate();
         },
         false);
+   
+   
 }
 
 void HideGraphicLogo()
@@ -148,6 +154,7 @@ void HideGraphicLogo()
     if (!g_showLogo) {
         return;
     }
+    // uapi_pm_remove_sleep_veto(PM_ID_SCREEN); //停止显示logo则正常允许屏幕熄灭
     g_showLogo = false;
     OHOS::GraphicEventHandler::GetInstance()->PostGraphicEvent(
         [] {
@@ -155,7 +162,7 @@ void HideGraphicLogo()
                 OHOS::RootView::GetInstance()->Remove(g_logo);
                 delete g_logo;
                 g_logo = nullptr;
-                OHOS::ImageCacheManager::GetInstance().UnloadSingleRes(IMAGE_OPEN_LOGO_PATH);
+                // OHOS::ImageCacheManager::GetInstance().UnloadSingleRes(IMAGE_OPEN_LOGO_PATH);
                 g_imgInfo = nullptr;
             }
         },