From 3e9590d7d2746480e4bb784a1a0317c9679326b3 Mon Sep 17 00:00:00 2001 From: jens Date: Sat, 18 Dec 2021 13:29:47 +0100 Subject: [PATCH] Rework --- app/src/main/java/com/jens/automation2/Actions.java | 1 + app/src/main/java/com/jens/automation2/Miscellaneous.java | 2 ++ app/src/main/res/xml/policies.xml | 6 ++++++ 3 files changed, 9 insertions(+) create mode 100644 app/src/main/res/xml/policies.xml diff --git a/app/src/main/java/com/jens/automation2/Actions.java b/app/src/main/java/com/jens/automation2/Actions.java index 77dad4e..a58ccce 100644 --- a/app/src/main/java/com/jens/automation2/Actions.java +++ b/app/src/main/java/com/jens/automation2/Actions.java @@ -1133,6 +1133,7 @@ public class Actions { Miscellaneous.logEvent("i", "Actions", "Turning screen off.", 3); + /*params.flags |= LayoutParams.FLAG_KEEP_SCREEN_ON; params.screenBrightness = 0; getWindow().setAttributes(params);*/ diff --git a/app/src/main/java/com/jens/automation2/Miscellaneous.java b/app/src/main/java/com/jens/automation2/Miscellaneous.java index ffe418b..1a8a18f 100644 --- a/app/src/main/java/com/jens/automation2/Miscellaneous.java +++ b/app/src/main/java/com/jens/automation2/Miscellaneous.java @@ -550,8 +550,10 @@ public class Miscellaneous extends Service int mode = context.getResources().getConfiguration().uiMode; switch(mode) { + case 33: case Configuration.UI_MODE_NIGHT_YES: return true; + case 17: case Configuration.UI_MODE_NIGHT_NO: case Configuration.UI_MODE_NIGHT_UNDEFINED: default: diff --git a/app/src/main/res/xml/policies.xml b/app/src/main/res/xml/policies.xml new file mode 100644 index 0000000..dc43469 --- /dev/null +++ b/app/src/main/res/xml/policies.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file