Fixed bug with multiple time frames with reoccurrence configured

This commit is contained in:
jens 2023-01-16 16:54:54 +01:00
parent ca81e6a7bd
commit 52edfa32df
3 changed files with 14 additions and 3 deletions

View File

@ -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"
}

View File

@ -347,7 +347,16 @@ public class Rule implements Comparable<Rule>
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))
{

View File

@ -0,0 +1,2 @@
* Fixed: Now allowing negative integers as intent data
* Fixed: Multiple time frames with reoccurence configured would trigger to early executions