From 4413bc2310930c34b8bce47c4489892bf07fa9be Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 20 Apr 2022 09:25:57 +0200 Subject: [PATCH] InsightAlertActivity: fix deprecation --- .../insight/activities/InsightAlertActivity.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightAlertActivity.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightAlertActivity.java index 9532f47c4e..4d98c8137d 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightAlertActivity.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightAlertActivity.java @@ -1,13 +1,13 @@ package info.nightscout.androidaps.plugins.pump.insight.activities; +import android.app.KeyguardManager; import android.content.ComponentName; +import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; -import android.text.Html; import android.view.View; -import android.view.WindowManager; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; @@ -69,10 +69,10 @@ public class InsightAlertActivity extends DaggerAppCompatActivity { setFinishOnTouchOutside(false); - getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON - | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD - | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED - | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); + setShowWhenLocked(true); + setTurnScreenOn(true); + KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); + keyguardManager.requestDismissKeyguard(this, null); } @Override