From d242dd31296545f81996420f0b8bb6fa43fb4a2e Mon Sep 17 00:00:00 2001 From: olorinmaia Date: Wed, 11 Oct 2023 17:37:36 +0200 Subject: [PATCH] Screen forced ON while activating or deactivating Omnipod Dash --- .../ui/wizard/common/activity/OmnipodWizardActivityBase.kt | 2 ++ .../ui/wizard/deactivation/PodDeactivationWizardActivity.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt index 4bcd349a12..2628c2d0d3 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt @@ -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() diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt index e08c40f895..de2487aa59 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt @@ -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)