From 52edfa32dff6992f81b1b8115966d97ee125ac83 Mon Sep 17 00:00:00 2001 From: jens Date: Mon, 16 Jan 2023 16:54:54 +0100 Subject: [PATCH] Fixed bug with multiple time frames with reoccurrence configured --- app/build.gradle | 4 ++-- app/src/apkFlavor/java/com/jens/automation2/Rule.java | 11 ++++++++++- fastlane/metadata/android/en-US/changelogs/125.txt | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/125.txt diff --git a/app/build.gradle b/app/build.gradle index 231e690a..7d8a87db 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { compileSdkVersion 31 buildToolsVersion '29.0.2' useLibrary 'org.apache.http.legacy' - versionCode 124 - versionName "1.7.9" + versionCode 125 + versionName "1.7.10" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/apkFlavor/java/com/jens/automation2/Rule.java b/app/src/apkFlavor/java/com/jens/automation2/Rule.java index b9b2316e..d92a0f96 100644 --- a/app/src/apkFlavor/java/com/jens/automation2/Rule.java +++ b/app/src/apkFlavor/java/com/jens/automation2/Rule.java @@ -347,7 +347,16 @@ public class Rule implements Comparable if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame)) { if(oneTrigger.getTimeFrame().repetition > 0) - return true; + { + if(this.getLastExecution() != null) + { + Calendar now = Calendar.getInstance(); + if (this.getLastExecution().getTimeInMillis() + oneTrigger.getTimeFrame().getRepetition() * 1000 <= now.getTimeInMillis()) + return true; + } + else + return true; + } } else if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.broadcastReceived)) { diff --git a/fastlane/metadata/android/en-US/changelogs/125.txt b/fastlane/metadata/android/en-US/changelogs/125.txt new file mode 100644 index 00000000..bcfee849 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/125.txt @@ -0,0 +1,2 @@ +* Fixed: Now allowing negative integers as intent data +* Fixed: Multiple time frames with reoccurence configured would trigger to early executions \ No newline at end of file