Screen forced ON while activating or deactivating Omnipod Dash

This commit is contained in:
olorinmaia 2023-10-11 17:37:36 +02:00
parent ba65c6f47e
commit d242dd3129
2 changed files with 4 additions and 0 deletions

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

View file

@ -1,6 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation
import android.os.Bundle
import android.view.WindowManager
import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase
@ -8,6 +9,7 @@ abstract class PodDeactivationWizardActivity : OmnipodWizardActivityBase() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
setContentView(R.layout.omnipod_common_pod_deactivation_wizard_activity)