From a8735b80463b95f765f88effc9bd2950bf1f0f99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Sun, 16 Nov 2025 09:14:51 +0000 Subject: [PATCH] Merge #2739 into sdk650pathc0423 from refs/changes/2739/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 袁清梦 * refs/changes/2739/head: (2 commits squashed) - 修复视频表盘的息屏卡住的问题 - Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 Signed-off-by: Caisking <3449750381@qq.com> Merged-by: aliyun6865282430 <1624952103@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/2739 --- .../nativeui/screennotify/src/ui_screennotify.cpp | 7 +++++++ .../nativeui/screennotify/src/ui_screennotify.cpp | 7 +++++++ .../nativeui/screennotify/src/ui_screennotify.cpp | 7 +++++++ 3 files changed, 21 insertions(+) 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) { -- 2.17.1