From 84cb86c13897d7403766654e070bf35661341253 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 1 Sep 2022 11:48:48 +0200 Subject: [PATCH] adding an OS version check at the reminder activity --- .../clock/activities/ReminderActivity.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/activities/ReminderActivity.kt b/app/src/main/kotlin/com/simplemobiletools/clock/activities/ReminderActivity.kt index eeb5df91..9bd39e64 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/activities/ReminderActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/activities/ReminderActivity.kt @@ -23,6 +23,7 @@ import com.simplemobiletools.clock.models.Alarm import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.MINUTE_SECONDS import com.simplemobiletools.commons.helpers.SILENT +import com.simplemobiletools.commons.helpers.isOreoMr1Plus import com.simplemobiletools.commons.helpers.isOreoPlus import kotlinx.android.synthetic.main.activity_reminder.* @@ -269,8 +270,10 @@ class ReminderActivity : SimpleActivity() { WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON ) - setShowWhenLocked(true) - setTurnScreenOn(true) - (getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager).requestDismissKeyguard(this, null) + if (isOreoMr1Plus()) { + setShowWhenLocked(true) + setTurnScreenOn(true) + (getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager).requestDismissKeyguard(this, null) + } } }