From 0c646b55fcb65c88ee6a869311812c85c074cd1d Mon Sep 17 00:00:00 2001 From: Jens Date: Fri, 5 Nov 2021 22:47:48 +0100 Subject: [PATCH] Fixed infinite loop --- .../java/com/jens/automation2/Rule.java | 14 ++++++++++ .../activity_manage_trigger_notification.xml | 26 +++++++++++++++++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 41 insertions(+) diff --git a/app/src/apkFlavor/java/com/jens/automation2/Rule.java b/app/src/apkFlavor/java/com/jens/automation2/Rule.java index fd26414c..ef093a68 100644 --- a/app/src/apkFlavor/java/com/jens/automation2/Rule.java +++ b/app/src/apkFlavor/java/com/jens/automation2/Rule.java @@ -833,6 +833,13 @@ public class Rule implements Comparable continue; } } + else + { + if(myApp.equals(BuildConfig.APPLICATION_ID)) + { + return false; + } + } /* If there are multiple notifications ("stacked") title or text might be null: @@ -897,6 +904,13 @@ public class Rule implements Comparable if (!app.equalsIgnoreCase(myApp)) return false; } + else + { + if(myApp.equals(BuildConfig.APPLICATION_ID)) + { + return false; + } + } if (requiredTitle.length() > 0) { diff --git a/app/src/main/res/layout/activity_manage_trigger_notification.xml b/app/src/main/res/layout/activity_manage_trigger_notification.xml index 46b1f79a..c2a259f0 100644 --- a/app/src/main/res/layout/activity_manage_trigger_notification.xml +++ b/app/src/main/res/layout/activity_manage_trigger_notification.xml @@ -45,6 +45,18 @@ + + + + @@ -78,6 +90,13 @@ + + @@ -106,6 +125,13 @@ + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 52bd071e..bff11708 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -702,4 +702,5 @@ Let nothing through Fine tuning (like allowing phone calls, picking specific numbers, etc.) can only be done from the system\'s settings. Your rules required permissions which cannot be requested from this installed flavor of Automation. + If you do not choose a specific app, but choose \"Any app\" notifications from Automation will be ignored to avoid loops. \ No newline at end of file