From: Caisking Date: Thu, 13 Nov 2025 10:11:25 +0000 (+0800) Subject: 修复视频表盘的息屏卡住的问题 X-Git-Tag: V1.0.9_20251128_194606_LN~23^2~8 X-Git-Url: http://git.snicker.com.cn/css/static/script.js?a=commitdiff_plain;h=a9fbb0afce0f9bb8624d25513c523b593cf2376c;p=mirrors%2FFD230.git 修复视频表盘的息屏卡住的问题 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp index c75a42ce2..a58f0b111 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp @@ -157,12 +157,19 @@ void notify_screen_on_event(void) { callback(SCREEN_STATUS_ON); } ChangeToHomeView(); + if (GraphicService::GetInstance()->IsNativeRunning() && !OHOS::NotificationManager::GetInstance()->HasNotifyShowing()) { + OHOS::NativeAbility::GetInstance().ResumeSlice(); // ensure that don't resume twice if switch to home + } } void notify_screen_off_event(void) { for (auto callback : g_callbacks) { callback(SCREEN_STATUS_OFF); } + if (GraphicService::GetInstance()->IsNativeRunning()) { + OHOS::NativeAbility::GetInstance().StopSliceTransition(); // make sure to end slice transition before turning screen off. + OHOS::NativeAbility::GetInstance().PauseSlice(); + } } void set_back_to_home_interval(uint32_t time_sec) { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp index c75a42ce2..a58f0b111 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp @@ -157,12 +157,19 @@ void notify_screen_on_event(void) { callback(SCREEN_STATUS_ON); } ChangeToHomeView(); + if (GraphicService::GetInstance()->IsNativeRunning() && !OHOS::NotificationManager::GetInstance()->HasNotifyShowing()) { + OHOS::NativeAbility::GetInstance().ResumeSlice(); // ensure that don't resume twice if switch to home + } } void notify_screen_off_event(void) { for (auto callback : g_callbacks) { callback(SCREEN_STATUS_OFF); } + if (GraphicService::GetInstance()->IsNativeRunning()) { + OHOS::NativeAbility::GetInstance().StopSliceTransition(); // make sure to end slice transition before turning screen off. + OHOS::NativeAbility::GetInstance().PauseSlice(); + } } void set_back_to_home_interval(uint32_t time_sec) { diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp index c75a42ce2..a58f0b111 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp @@ -157,12 +157,19 @@ void notify_screen_on_event(void) { callback(SCREEN_STATUS_ON); } ChangeToHomeView(); + if (GraphicService::GetInstance()->IsNativeRunning() && !OHOS::NotificationManager::GetInstance()->HasNotifyShowing()) { + OHOS::NativeAbility::GetInstance().ResumeSlice(); // ensure that don't resume twice if switch to home + } } void notify_screen_off_event(void) { for (auto callback : g_callbacks) { callback(SCREEN_STATUS_OFF); } + if (GraphicService::GetInstance()->IsNativeRunning()) { + OHOS::NativeAbility::GetInstance().StopSliceTransition(); // make sure to end slice transition before turning screen off. + OHOS::NativeAbility::GetInstance().PauseSlice(); + } } void set_back_to_home_interval(uint32_t time_sec) {