Merge #2739 into sdk650pathc0423 from refs/changes/2739/head 2746/target/1
author袁清梦 <3449750381@qq.com>
Sun, 16 Nov 2025 09:14:51 +0000 (09:14 +0000)
committer彭磊 <1624952103@qq.com>
Sun, 16 Nov 2025 09:14:51 +0000 (09:14 +0000)
Code review from 袁清梦

* refs/changes/2739/head: (2 commits squashed)

  - 修复视频表盘的息屏卡住的问题

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

Signed-off-by: Caisking <3449750381@qq.com>
Merged-by: aliyun6865282430 <1624952103@qq.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/2739
code/sdk/application/wearable/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp

index c75a42c..a58f0b1 100644 (file)
@@ -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) {
index c75a42c..a58f0b1 100644 (file)
@@ -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) {
index c75a42c..a58f0b1 100644 (file)
@@ -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) {