修复闹钟弹窗不亮屏bug
authorluozheng <1732036298@qq.com>
Thu, 28 Nov 2024 02:30:17 +0000 (10:30 +0800)
committerluozheng <1732036298@qq.com>
Thu, 28 Nov 2024 02:30:17 +0000 (10:30 +0800)
code/sdk/application/wearable/service/msg_center/src/notify/alarm_notification.cpp

index 0abbaf0..b24132c 100755 (executable)
@@ -19,6 +19,7 @@
 #include "ConfigModel.h"
 #include <custom_runtime.h>
 #include "../../../../../../drivers/peripheral/vibrator/service/vibrator_service.h"
+#include <custom_utils.h>
 namespace OHOS
 {
     static constexpr const char *RING_AGAIN = "响铃将在十分钟后再次响起";
@@ -503,6 +504,7 @@ namespace OHOS
             g_alarmView->Add(g_StopBtn);
             /* -------------------------------------------------------------------------- */
             StartAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING, NOTIFY_ONE_SECOND);
+            ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);
         }
         NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeAlarmView);
         return g_alarmView;
@@ -542,6 +544,7 @@ namespace OHOS
             RootView::GetInstance()->Remove(g_alarmView);
             delete g_alarmView;
             g_alarmView = nullptr;
+            ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON);
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "FreeAlarmView over!!");
         }
     }