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) {
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) {
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) {