bugs and translations
This commit is contained in:
		@@ -8,10 +8,11 @@ import android.os.AsyncTask;
 | 
			
		||||
import android.os.Looper;
 | 
			
		||||
import android.util.Log;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
import java.sql.Time;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Calendar;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
public class Rule implements Comparable<Rule>
 | 
			
		||||
@@ -19,9 +20,9 @@ public class Rule implements Comparable<Rule>
 | 
			
		||||
	private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
 | 
			
		||||
	public static boolean isAnyRuleActive = false;
 | 
			
		||||
	
 | 
			
		||||
	private static ArrayList<Rule> ruleRunHistory = new ArrayList<Rule>();
 | 
			
		||||
	private static List<Rule> ruleRunHistory = new ArrayList<Rule>();
 | 
			
		||||
	
 | 
			
		||||
	public static ArrayList<Rule> getRuleRunHistory()
 | 
			
		||||
	public static List<Rule> getRuleRunHistory()
 | 
			
		||||
	{
 | 
			
		||||
		return ruleRunHistory;
 | 
			
		||||
	}
 | 
			
		||||
@@ -805,8 +806,32 @@ public class Rule implements Comparable<Rule>
 | 
			
		||||
		
 | 
			
		||||
		return ruleCandidates;
 | 
			
		||||
	}*/
 | 
			
		||||
 | 
			
		||||
	public static ArrayList<Rule> findRuleCandidatesByTriggerProfile(Profile profile)
 | 
			
		||||
	{
 | 
			
		||||
		ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
 | 
			
		||||
 | 
			
		||||
		for(Rule oneRule : ruleCollection)
 | 
			
		||||
		{
 | 
			
		||||
			innerloop:
 | 
			
		||||
			for(Trigger oneTrigger : oneRule.getTriggerSet())
 | 
			
		||||
			{
 | 
			
		||||
				if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.profileActive)
 | 
			
		||||
				{
 | 
			
		||||
					String profileName = oneTrigger.getTriggerParameter2().split(triggerParameter2Split)[0];
 | 
			
		||||
					if(profileName.equals(profile.getName()))
 | 
			
		||||
					{
 | 
			
		||||
						ruleCandidates.add(oneRule);
 | 
			
		||||
						break innerloop; //if the profile is found we don't need to search the other triggers in the same rule
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return ruleCandidates;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public static ArrayList<Rule> findRuleCandidatesByProfile(Profile profile)
 | 
			
		||||
	public static ArrayList<Rule> findRuleCandidatesByActionProfile(Profile profile)
 | 
			
		||||
	{
 | 
			
		||||
		ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user