bugs and translations
This commit is contained in:
@ -139,6 +139,7 @@
|
||||
<activity android:name=".ActivityDisplayLongMessage" />
|
||||
<activity android:name=".ActivityManageActionSendTextMessage" />
|
||||
<activity android:name=".ActivityManageActionPlaySound" />
|
||||
<activity android:name=".ActivityManageTriggerProfile" />
|
||||
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
||||
<activity android:name=".ActivityMaintenance" />
|
||||
<activity android:name=".ActivityManageTriggerPhoneCall" />
|
||||
@ -206,7 +207,6 @@
|
||||
|
||||
<activity android:name=".ActivityPermissions" />
|
||||
|
||||
|
||||
<!-- https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p-->
|
||||
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
|
||||
|
||||
|
@ -12,10 +12,10 @@ import android.widget.Toast;
|
||||
import com.google.android.gms.location.DetectedActivity;
|
||||
import com.jens.automation2.receivers.ActivityDetectionReceiver;
|
||||
|
||||
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>
|
||||
@ -23,9 +23,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;
|
||||
}
|
||||
@ -833,8 +833,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