Merge pull request #2904 from olorinmaia/DashScreenOnFix

Screen forced ON while activating or deactivating Omnipod Dash
This commit is contained in:
Milos Kozak 2023-10-14 19:19:04 +02:00 committed by GitHub
commit 0c4a19f8a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity
import android.os.Bundle
import android.view.WindowManager
import androidx.activity.OnBackPressedCallback
import androidx.appcompat.app.AlertDialog
import androidx.navigation.NavController
@ -12,6 +13,7 @@ abstract class OmnipodWizardActivityBase : TranslatedDaggerAppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
exitActivityAfterConfirmation()