adding an OS version check at the reminder activity

This commit is contained in:
tibbi 2022-09-01 11:48:48 +02:00
parent 4682e1da21
commit 84cb86c138
1 changed files with 6 additions and 3 deletions

View File

@ -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
)
if (isOreoMr1Plus()) {
setShowWhenLocked(true)
setTurnScreenOn(true)
(getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager).requestDismissKeyguard(this, null)
}
}
}