forked from jens/Automation
bugs and translations
This commit is contained in:
parent
941bb3e1af
commit
9a50da550a
@ -11,8 +11,8 @@ android {
|
|||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '29.0.2'
|
buildToolsVersion '29.0.2'
|
||||||
useLibrary 'org.apache.http.legacy'
|
useLibrary 'org.apache.http.legacy'
|
||||||
versionCode 115
|
versionCode 116
|
||||||
versionName "1.7.1"
|
versionName "1.7.2"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
||||||
|
<!-- <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />-->
|
||||||
<uses-permission android:name="android.permission.GET_TASKS" />
|
<uses-permission android:name="android.permission.GET_TASKS" />
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<uses-permission android:name="android.permission.NFC" />
|
<uses-permission android:name="android.permission.NFC" />
|
||||||
@ -144,6 +145,7 @@
|
|||||||
<activity android:name=".ActivityDisplayLongMessage" />
|
<activity android:name=".ActivityDisplayLongMessage" />
|
||||||
<activity android:name=".ActivityManageActionSendTextMessage" />
|
<activity android:name=".ActivityManageActionSendTextMessage" />
|
||||||
<activity android:name=".ActivityManageActionPlaySound" />
|
<activity android:name=".ActivityManageActionPlaySound" />
|
||||||
|
<activity android:name=".ActivityManageTriggerProfile" />
|
||||||
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
||||||
<activity android:name=".ActivityMaintenance" />
|
<activity android:name=".ActivityMaintenance" />
|
||||||
<activity android:name=".ActivityManageTriggerPhoneCall" />
|
<activity android:name=".ActivityManageTriggerPhoneCall" />
|
||||||
@ -177,6 +179,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.nfc.action.TECH_DISCOVERED"
|
android:name="android.nfc.action.TECH_DISCOVERED"
|
||||||
@ -210,7 +213,6 @@
|
|||||||
|
|
||||||
<activity android:name=".ActivityPermissions" />
|
<activity android:name=".ActivityPermissions" />
|
||||||
|
|
||||||
|
|
||||||
<!-- https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p-->
|
<!-- 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"/>
|
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
|
||||||
|
|
||||||
|
@ -8,10 +8,11 @@ import android.os.AsyncTask;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import java.sql.Time;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class Rule implements Comparable<Rule>
|
public class Rule implements Comparable<Rule>
|
||||||
@ -19,9 +20,9 @@ public class Rule implements Comparable<Rule>
|
|||||||
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||||
public static boolean isAnyRuleActive = false;
|
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;
|
return ruleRunHistory;
|
||||||
}
|
}
|
||||||
@ -806,7 +807,31 @@ public class Rule implements Comparable<Rule>
|
|||||||
return ruleCandidates;
|
return ruleCandidates;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public static ArrayList<Rule> findRuleCandidatesByProfile(Profile profile)
|
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> findRuleCandidatesByActionProfile(Profile profile)
|
||||||
{
|
{
|
||||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||||
|
|
||||||
|
@ -139,6 +139,7 @@
|
|||||||
<activity android:name=".ActivityDisplayLongMessage" />
|
<activity android:name=".ActivityDisplayLongMessage" />
|
||||||
<activity android:name=".ActivityManageActionSendTextMessage" />
|
<activity android:name=".ActivityManageActionSendTextMessage" />
|
||||||
<activity android:name=".ActivityManageActionPlaySound" />
|
<activity android:name=".ActivityManageActionPlaySound" />
|
||||||
|
<activity android:name=".ActivityManageTriggerProfile" />
|
||||||
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
||||||
<activity android:name=".ActivityMaintenance" />
|
<activity android:name=".ActivityMaintenance" />
|
||||||
<activity android:name=".ActivityManageTriggerPhoneCall" />
|
<activity android:name=".ActivityManageTriggerPhoneCall" />
|
||||||
@ -206,7 +207,6 @@
|
|||||||
|
|
||||||
<activity android:name=".ActivityPermissions" />
|
<activity android:name=".ActivityPermissions" />
|
||||||
|
|
||||||
|
|
||||||
<!-- https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p-->
|
<!-- 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"/>
|
<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.google.android.gms.location.DetectedActivity;
|
||||||
import com.jens.automation2.receivers.ActivityDetectionReceiver;
|
import com.jens.automation2.receivers.ActivityDetectionReceiver;
|
||||||
|
|
||||||
import java.sql.Time;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class Rule implements Comparable<Rule>
|
public class Rule implements Comparable<Rule>
|
||||||
@ -23,9 +23,9 @@ public class Rule implements Comparable<Rule>
|
|||||||
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||||
public static boolean isAnyRuleActive = false;
|
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;
|
return ruleRunHistory;
|
||||||
}
|
}
|
||||||
@ -834,7 +834,31 @@ public class Rule implements Comparable<Rule>
|
|||||||
return ruleCandidates;
|
return ruleCandidates;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public static ArrayList<Rule> findRuleCandidatesByProfile(Profile profile)
|
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> findRuleCandidatesByActionProfile(Profile profile)
|
||||||
{
|
{
|
||||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||||
|
|
||||||
|
@ -154,95 +154,92 @@ public class Action
|
|||||||
{
|
{
|
||||||
StringBuilder returnString = new StringBuilder();
|
StringBuilder returnString = new StringBuilder();
|
||||||
|
|
||||||
if(this.getAction().equals(Action_Enum.setWifi))
|
switch(getAction())
|
||||||
{
|
{
|
||||||
if(this.getParameter1())
|
case setWifi:
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOn));
|
if (this.getParameter1())
|
||||||
else
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOn));
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOff));
|
else
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOff));
|
||||||
|
break;
|
||||||
|
case setBluetooth:
|
||||||
|
if (this.getParameter1())
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOn));
|
||||||
|
else
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOff));
|
||||||
|
break;
|
||||||
|
case setUsbTethering:
|
||||||
|
if (this.getParameter1())
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOn));
|
||||||
|
else
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOff));
|
||||||
|
break;
|
||||||
|
case setWifiTethering:
|
||||||
|
if (this.getParameter1())
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOn));
|
||||||
|
else
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOff));
|
||||||
|
break;
|
||||||
|
case setBluetoothTethering:
|
||||||
|
if (this.getParameter1())
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOn));
|
||||||
|
else
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOff));
|
||||||
|
break;
|
||||||
|
case setDisplayRotation:
|
||||||
|
if (this.getParameter1())
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionEnableScreenRotation));
|
||||||
|
else
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionDisableScreenRotation));
|
||||||
|
break;
|
||||||
|
case setAirplaneMode:
|
||||||
|
if (this.getParameter1())
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOn));
|
||||||
|
else
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOff));
|
||||||
|
break;
|
||||||
|
case setDataConnection:
|
||||||
|
if (this.getParameter1())
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOn));
|
||||||
|
else
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOff));
|
||||||
|
break;
|
||||||
|
case startOtherActivity:
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.startOtherActivity));
|
||||||
|
break;
|
||||||
|
case triggerUrl:
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTriggerUrl));
|
||||||
|
break;
|
||||||
|
case speakText:
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSpeakText));
|
||||||
|
break;
|
||||||
|
case playMusic:
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionPlayMusic));
|
||||||
|
break;
|
||||||
|
case sendTextMessage:
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.sendTextMessage));
|
||||||
|
break;
|
||||||
|
case turnScreenOnOrOff:
|
||||||
|
if (getParameter1())
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOn));
|
||||||
|
else
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOff));
|
||||||
|
break;
|
||||||
|
case playSound:
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.playSound));
|
||||||
|
break;
|
||||||
|
case changeSoundProfile:
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionChangeSoundProfile));
|
||||||
|
break;
|
||||||
|
case waitBeforeNextAction:
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.waitBeforeNextAction));
|
||||||
|
break;
|
||||||
|
case setScreenBrightness:
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.setScreenBrightness));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
returnString.append(action.toString());
|
||||||
}
|
}
|
||||||
else if(this.getAction().equals(Action_Enum.setBluetooth))
|
|
||||||
{
|
|
||||||
if(this.getParameter1())
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOn));
|
|
||||||
else
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOff));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.setUsbTethering))
|
|
||||||
{
|
|
||||||
if(this.getParameter1())
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOn));
|
|
||||||
else
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOff));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.setWifiTethering))
|
|
||||||
{
|
|
||||||
if(this.getParameter1())
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOn));
|
|
||||||
else
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOff));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.setBluetoothTethering))
|
|
||||||
{
|
|
||||||
if(this.getParameter1())
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOn));
|
|
||||||
else
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOff));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.setDisplayRotation))
|
|
||||||
{
|
|
||||||
if(this.getParameter1())
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionEnableScreenRotation));
|
|
||||||
else
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionDisableScreenRotation));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.setAirplaneMode))
|
|
||||||
{
|
|
||||||
if(this.getParameter1())
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOn));
|
|
||||||
else
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOff));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.setDataConnection))
|
|
||||||
{
|
|
||||||
if(this.getParameter1())
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOn));
|
|
||||||
else
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOff));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.startOtherActivity))
|
|
||||||
{
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.startOtherActivity));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.triggerUrl))
|
|
||||||
{
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTriggerUrl));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.speakText))
|
|
||||||
{
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSpeakText));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.playMusic))
|
|
||||||
{
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionPlayMusic));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.sendTextMessage))
|
|
||||||
{
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.sendTextMessage));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.turnScreenOnOrOff))
|
|
||||||
{
|
|
||||||
if(getParameter1())
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOn));
|
|
||||||
else
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOff));
|
|
||||||
}
|
|
||||||
else if(this.getAction().equals(Action_Enum.playSound))
|
|
||||||
{
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.playSound));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
returnString.append(action.toString());
|
|
||||||
|
|
||||||
if(this.getAction().equals(Action_Enum.triggerUrl))
|
if(this.getAction().equals(Action_Enum.triggerUrl))
|
||||||
{
|
{
|
||||||
@ -252,7 +249,7 @@ public class Action
|
|||||||
returnString.append(": " + components[2]);
|
returnString.append(": " + components[2]);
|
||||||
|
|
||||||
if(parameter1)
|
if(parameter1)
|
||||||
returnString.append(" using authentication.");
|
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.usingAuthentication) + ".");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
returnString.append(": " + components[0]);
|
returnString.append(": " + components[0]);
|
||||||
@ -266,14 +263,14 @@ public class Action
|
|||||||
String[] components = parameter2.split(Actions.smsSeparator);
|
String[] components = parameter2.split(Actions.smsSeparator);
|
||||||
if(components.length >= 2)
|
if(components.length >= 2)
|
||||||
{
|
{
|
||||||
returnString.append(" to number " + components[0]);
|
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.toNumber) + " " + components[0]);
|
||||||
|
|
||||||
returnString.append(". Message: " + components[1]);
|
returnString.append(". " + Miscellaneous.getAnyContext().getResources().getString(R.string.message) + ": " + components[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(this.getAction().equals(Action_Enum.setScreenBrightness))
|
else if(this.getAction().equals(Action_Enum.setScreenBrightness))
|
||||||
{
|
{
|
||||||
returnString.append(" to ");
|
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.to) + " ");
|
||||||
|
|
||||||
if(parameter1)
|
if(parameter1)
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.brightnessAuto));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.brightnessAuto));
|
||||||
|
@ -55,30 +55,30 @@ public class ActivityManageRule extends Activity
|
|||||||
public final static String intentNameActionParameter2 = "actionParameter2";
|
public final static String intentNameActionParameter2 = "actionParameter2";
|
||||||
|
|
||||||
public Context context;
|
public Context context;
|
||||||
private Button cmdTriggerAdd, cmdActionAdd, cmdSaveRule;
|
Button cmdTriggerAdd, cmdActionAdd, cmdSaveRule;
|
||||||
private ListView triggerListView, actionListView;
|
ListView triggerListView, actionListView;
|
||||||
private EditText etRuleName;
|
EditText etRuleName;
|
||||||
private CheckBox chkRuleActive, chkRuleToggle;
|
CheckBox chkRuleActive, chkRuleToggle;
|
||||||
private static ActivityManageRule instance = null;
|
static ActivityManageRule instance = null;
|
||||||
ImageView imageHelpButton;
|
ImageView imageHelpButton;
|
||||||
|
|
||||||
private static ProgressDialog progressDialog = null;
|
static ProgressDialog progressDialog = null;
|
||||||
|
|
||||||
private static Trigger_Enum triggerType;
|
static Trigger_Enum triggerType;
|
||||||
private static boolean triggerParameter;
|
static boolean triggerParameter;
|
||||||
private static PointOfInterest triggerPoi;
|
static PointOfInterest triggerPoi;
|
||||||
private static String triggerProcess;
|
static String triggerProcess;
|
||||||
private static int triggerBattery;
|
static int triggerBattery;
|
||||||
private static double triggerSpeed;
|
static double triggerSpeed;
|
||||||
private static double triggerNoise;
|
static double triggerNoise;
|
||||||
private static TimeFrame triggerTimeFrame;
|
static TimeFrame triggerTimeFrame;
|
||||||
private static String triggerWifiName;
|
static String triggerWifiName;
|
||||||
|
|
||||||
private static Rule ruleToEdit;
|
static Rule ruleToEdit;
|
||||||
private static boolean newRule;
|
static boolean newRule;
|
||||||
|
|
||||||
private static Trigger newTrigger;
|
static Trigger newTrigger;
|
||||||
private static Action newAction;
|
static Action newAction;
|
||||||
|
|
||||||
ArrayAdapter<Trigger> triggerListViewAdapter;
|
ArrayAdapter<Trigger> triggerListViewAdapter;
|
||||||
ArrayAdapter<Action> actionListViewAdapter;
|
ArrayAdapter<Action> actionListViewAdapter;
|
||||||
|
@ -51,18 +51,19 @@ public class ActivityManageTriggerProfile extends Activity
|
|||||||
if(getIntent().hasExtra(ActivityManageRule.intentNameTriggerParameter2))
|
if(getIntent().hasExtra(ActivityManageRule.intentNameTriggerParameter2))
|
||||||
{
|
{
|
||||||
editMode = true;
|
editMode = true;
|
||||||
|
|
||||||
|
boolean active = getIntent().getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true);
|
||||||
|
chkProfileActive.setChecked(active);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String values[] = getIntent().getStringExtra(ActivityManageRule.intentNameTriggerParameter2).split(Trigger.triggerParameter2Split);
|
String values[] = getIntent().getStringExtra(ActivityManageRule.intentNameTriggerParameter2).split(Trigger.triggerParameter2Split);
|
||||||
if(values.length >= 2)
|
if(values.length >= 2)
|
||||||
{
|
{
|
||||||
boolean active = getIntent().getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true);
|
|
||||||
chkProfileActive.setChecked(active);
|
|
||||||
|
|
||||||
boolean checkSettings = Boolean.parseBoolean(values[0]);
|
boolean checkSettings = Boolean.parseBoolean(values[0]);
|
||||||
chkProfileCheckSettings.setChecked(checkSettings);
|
chkProfileCheckSettings.setChecked(checkSettings);
|
||||||
|
|
||||||
String profileName = values[1];
|
String profileName = values[0];
|
||||||
|
|
||||||
List<Profile> profileList = Profile.getProfileCollection();
|
List<Profile> profileList = Profile.getProfileCollection();
|
||||||
for(int i = 0; i < profileList.size(); i++)
|
for(int i = 0; i < profileList.size(); i++)
|
||||||
|
@ -1282,11 +1282,11 @@ public class Trigger
|
|||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.leaving) + " ");
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.leaving) + " ");
|
||||||
|
|
||||||
String repeat = ", no repetition";
|
String repeat = ", " + Miscellaneous.getAnyContext().getResources().getString(R.string.noRepetition);
|
||||||
if(this.getTimeFrame().getRepetition() > 0)
|
if(this.getTimeFrame().getRepetition() > 0)
|
||||||
repeat = ", " + String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.repeatEveryXsecondsWithVariable), String.valueOf(this.getTimeFrame().getRepetition()));
|
repeat = ", " + String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.repeatEveryXsecondsWithVariable), String.valueOf(this.getTimeFrame().getRepetition()));
|
||||||
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.triggerTimeFrame) + ": " + this.getTimeFrame().getTriggerTimeStart().toString() + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.until) + " " + this.getTimeFrame().getTriggerTimeStop().toString() + " on days " + this.getTimeFrame().getDayList().toString() + repeat);
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.triggerTimeFrame) + ": " + this.getTimeFrame().getTriggerTimeStart().toString() + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.until) + " " + this.getTimeFrame().getTriggerTimeStop().toString() + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.onDays) + " " + this.getTimeFrame().getDayList().toString() + repeat);
|
||||||
break;
|
break;
|
||||||
case speed:
|
case speed:
|
||||||
if(getTriggerParameter())
|
if(getTriggerParameter())
|
||||||
@ -1331,11 +1331,11 @@ public class Trigger
|
|||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.airplaneMode));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.airplaneMode));
|
||||||
break;
|
break;
|
||||||
case roaming:
|
case roaming:
|
||||||
if(getTriggerParameter())
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.activated) + " ");
|
|
||||||
else
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.deactivated) + " ");
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.roaming));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.roaming));
|
||||||
|
if(getTriggerParameter())
|
||||||
|
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.activated));
|
||||||
|
else
|
||||||
|
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.deactivated));
|
||||||
break;
|
break;
|
||||||
case phoneCall:
|
case phoneCall:
|
||||||
String[] elements = triggerParameter2.split(triggerParameter2Split);
|
String[] elements = triggerParameter2.split(triggerParameter2Split);
|
||||||
@ -1367,24 +1367,9 @@ public class Trigger
|
|||||||
else if(elements[0].equals(Trigger.triggerPhoneCallStateStopped))
|
else if(elements[0].equals(Trigger.triggerPhoneCallStateStopped))
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.stopped));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.stopped));
|
||||||
|
|
||||||
// returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.phoneCall));
|
|
||||||
// if(phoneNumber != null && !phoneNumber.equals("any"))
|
|
||||||
// returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.with) + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.number) + " " + phoneNumber);
|
|
||||||
// else
|
|
||||||
// returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.with) + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.anyNumber));
|
|
||||||
//
|
|
||||||
// if(getTriggerParameter())
|
|
||||||
// returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.started));
|
|
||||||
// else
|
|
||||||
// returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.stopped));
|
|
||||||
break;
|
break;
|
||||||
case nfcTag:
|
case nfcTag:
|
||||||
// This type doesn't have an activate/deactivate equivalent
|
// This type doesn't have an activate/deactivate equivalent
|
||||||
// if(getTriggerParameter())
|
|
||||||
// returnString += Miscellaneous.getAnyContext().getResources().getString(R.string.activated) + " ";
|
|
||||||
// else
|
|
||||||
// returnString += Miscellaneous.getAnyContext().getResources().getString(R.string.deactivated) + " ";
|
|
||||||
|
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.closeTo) + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.nfcTag) + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.withLabel) + " " + this.getNfcTagId());
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.closeTo) + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.nfcTag) + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.withLabel) + " " + this.getNfcTagId());
|
||||||
break;
|
break;
|
||||||
case activityDetection:
|
case activityDetection:
|
||||||
@ -1456,7 +1441,7 @@ public class Trigger
|
|||||||
type = Miscellaneous.getAnyContext().getResources().getString(R.string.headphoneAny);
|
type = Miscellaneous.getAnyContext().getResources().getString(R.string.headphoneAny);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
type = "not set";
|
type = Miscellaneous.getAnyContext().getResources().getString(R.string.notSet);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(getTriggerParameter())
|
if(getTriggerParameter())
|
||||||
|
@ -25,6 +25,18 @@
|
|||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_span="2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="@android:color/darker_gray" />
|
||||||
|
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -40,6 +52,18 @@
|
|||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_span="2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="@android:color/darker_gray" />
|
||||||
|
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -356,7 +356,7 @@
|
|||||||
<string name="selectConnectionOption">Wählen Sie eine Verbindungsoption.</string>
|
<string name="selectConnectionOption">Wählen Sie eine Verbindungsoption.</string>
|
||||||
<string name="triggerHeadsetPlugged">Headset Verbindung</string>
|
<string name="triggerHeadsetPlugged">Headset Verbindung</string>
|
||||||
<string name="actionPlayMusic">Musikplayer öffnen</string>
|
<string name="actionPlayMusic">Musikplayer öffnen</string>
|
||||||
<string name="headsetConnected">Headset (type: %1$s) verbunden</string>
|
<string name="headsetConnected">Headset (Art: %1$s) verbunden</string>
|
||||||
<string name="headsetDisconnected">Headset (type: %1$s) getrennt</string>
|
<string name="headsetDisconnected">Headset (type: %1$s) getrennt</string>
|
||||||
<string name="headphoneSimple">Kopfhörer</string>
|
<string name="headphoneSimple">Kopfhörer</string>
|
||||||
<string name="headphoneMicrophone">Mikrofon</string>
|
<string name="headphoneMicrophone">Mikrofon</string>
|
||||||
@ -649,4 +649,10 @@
|
|||||||
<string name="profileTriggerCheckSettings">Wenn dieses Häkchen nicht gesetzt ist, wird nur geprüft, ob das ausgewählte Profil zuletzt aktiviert wurde. Es ist egal, ob Audio-Einstellungen von außerhalb verändert wurden.\nWenn das Häkchen aber gesetzt ist, müssen die aktuellen Audio-Einstellungen auch wirklich genau so gesetzt sein, wie im Profil definiert. ACHTUNG: Der Klingelton selbst kann derzeit noch nicht überprüft werden.</string>
|
<string name="profileTriggerCheckSettings">Wenn dieses Häkchen nicht gesetzt ist, wird nur geprüft, ob das ausgewählte Profil zuletzt aktiviert wurde. Es ist egal, ob Audio-Einstellungen von außerhalb verändert wurden.\nWenn das Häkchen aber gesetzt ist, müssen die aktuellen Audio-Einstellungen auch wirklich genau so gesetzt sein, wie im Profil definiert. ACHTUNG: Der Klingelton selbst kann derzeit noch nicht überprüft werden.</string>
|
||||||
<string name="profileCouldNotBeDeleted">Profil konnte nicht gelöscht werden.</string>
|
<string name="profileCouldNotBeDeleted">Profil konnte nicht gelöscht werden.</string>
|
||||||
<string name="ruleXIsUsingProfileY">Dieses Profil kann nicht gelöscht werden. Regel %s$1 verwendet noch Profil %s$2.</string>
|
<string name="ruleXIsUsingProfileY">Dieses Profil kann nicht gelöscht werden. Regel %s$1 verwendet noch Profil %s$2.</string>
|
||||||
|
<string name="noRepetition">keine Wiederholung</string>
|
||||||
|
<string name="usingAuthentication">mit Authentifizierung</string>
|
||||||
|
<string name="toNumber">zu Nummer</string>
|
||||||
|
<string name="message">Nachricht</string>
|
||||||
|
<string name="onDays">an Tagen</string>
|
||||||
|
<string name="notSet">nicht gesetzt</string>
|
||||||
</resources>
|
</resources>
|
@ -648,4 +648,10 @@
|
|||||||
<string name="profileTriggerCheckSettings">Si esta casilla de verificación no está desactivada, solo se marcará si el perfil seleccionado ha sido el último en activarse. No importa si alguna configuración relacionada con el audio se ha cambiado externamente.\nSin embargo, si la casilla de verificación está habilitada, la configuración de audio actual realmente debe ser como se define en el perfil. CUIDADO: La comprobación del archivo de tono de llamada no es compatible actualmente, todavía.</string>
|
<string name="profileTriggerCheckSettings">Si esta casilla de verificación no está desactivada, solo se marcará si el perfil seleccionado ha sido el último en activarse. No importa si alguna configuración relacionada con el audio se ha cambiado externamente.\nSin embargo, si la casilla de verificación está habilitada, la configuración de audio actual realmente debe ser como se define en el perfil. CUIDADO: La comprobación del archivo de tono de llamada no es compatible actualmente, todavía.</string>
|
||||||
<string name="ruleXIsUsingProfileY">No se puede eliminar este perfil. La regla %s$1 hace referencia al perfil %s$2.</string>
|
<string name="ruleXIsUsingProfileY">No se puede eliminar este perfil. La regla %s$1 hace referencia al perfil %s$2.</string>
|
||||||
<string name="profileCouldNotBeDeleted">No se pudo eliminar el perfil.</string>
|
<string name="profileCouldNotBeDeleted">No se pudo eliminar el perfil.</string>
|
||||||
|
<string name="noRepetition">sin repetición</string>
|
||||||
|
<string name="usingAuthentication">uso de la autenticación</string>
|
||||||
|
<string name="toNumber">a número</string>
|
||||||
|
<string name="message">mensaje</string>
|
||||||
|
<string name="onDays">en días</string>
|
||||||
|
<string name="notSet">no configurado</string>
|
||||||
</resources>
|
</resources>
|
@ -649,4 +649,10 @@
|
|||||||
<string name="profileNotActive">profilo %1$s non attivo</string>
|
<string name="profileNotActive">profilo %1$s non attivo</string>
|
||||||
<string name="ruleXIsUsingProfileY">Impossibile eliminare questo profilo. La regola %s$1 fa riferimento al profilo %s$2.</string>
|
<string name="ruleXIsUsingProfileY">Impossibile eliminare questo profilo. La regola %s$1 fa riferimento al profilo %s$2.</string>
|
||||||
<string name="profileCouldNotBeDeleted">Impossibile eliminare il profilo.</string>
|
<string name="profileCouldNotBeDeleted">Impossibile eliminare il profilo.</string>
|
||||||
|
<string name="noRepetition">nessuna ripetizione</string>
|
||||||
|
<string name="usingAuthentication">utilizzo dell\'autenticazione</string>
|
||||||
|
<string name="toNumber">al numero</string>
|
||||||
|
<string name="message">messaggio</string>
|
||||||
|
<string name="onDays">nei giorni</string>
|
||||||
|
<string name="notSet">non impostato</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -647,4 +647,10 @@
|
|||||||
<string name="profileTriggerCheckSettings">Als dit selectievakje niet is uitgeschakeld, wordt het alleen aangevinkt als het geselecteerde profiel het laatste is dat is geactiveerd. Het maakt niet uit of audiogerelateerde instellingen extern zijn gewijzigd.\nAls het selectievakje echter is ingeschakeld, moeten de huidige audio-instellingen echt worden gedefinieerd in het profiel. PAS OP: Het controleren van het beltoonbestand wordt momenteel nog niet ondersteund.</string>
|
<string name="profileTriggerCheckSettings">Als dit selectievakje niet is uitgeschakeld, wordt het alleen aangevinkt als het geselecteerde profiel het laatste is dat is geactiveerd. Het maakt niet uit of audiogerelateerde instellingen extern zijn gewijzigd.\nAls het selectievakje echter is ingeschakeld, moeten de huidige audio-instellingen echt worden gedefinieerd in het profiel. PAS OP: Het controleren van het beltoonbestand wordt momenteel nog niet ondersteund.</string>
|
||||||
<string name="ruleXIsUsingProfileY">Kan dit profiel niet verwijderen. Regel %s$1 verwijst naar het profiel %s$2.</string>
|
<string name="ruleXIsUsingProfileY">Kan dit profiel niet verwijderen. Regel %s$1 verwijst naar het profiel %s$2.</string>
|
||||||
<string name="profileCouldNotBeDeleted">Profiel kan niet worden verwijderd.</string>
|
<string name="profileCouldNotBeDeleted">Profiel kan niet worden verwijderd.</string>
|
||||||
|
<string name="noRepetition">geen herhaling</string>
|
||||||
|
<string name="usingAuthentication">authenticatie gebruiken</string>
|
||||||
|
<string name="toNumber">naar nummer</string>
|
||||||
|
<string name="message">Bericht</string>
|
||||||
|
<string name="onDays">op dagen</string>
|
||||||
|
<string name="notSet">niet ingesteld</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -745,4 +745,10 @@
|
|||||||
<string name="profileTriggerCheckSettings">If this checkbox is not disabled, it will only be checked if the selected profile has been the last one to be activated. It doesn\'t matter if any audio related settings have been changed externally. However if the checkbox is enabled, the current audio settings really need to be like defined in the profile. BEWARE: Checking the ringtone file is currently not supported, yet.</string>
|
<string name="profileTriggerCheckSettings">If this checkbox is not disabled, it will only be checked if the selected profile has been the last one to be activated. It doesn\'t matter if any audio related settings have been changed externally. However if the checkbox is enabled, the current audio settings really need to be like defined in the profile. BEWARE: Checking the ringtone file is currently not supported, yet.</string>
|
||||||
<string name="ruleXIsUsingProfileY">Cannot delete this profile. Rule %s$1 is referencing profile %s$2.</string>
|
<string name="ruleXIsUsingProfileY">Cannot delete this profile. Rule %s$1 is referencing profile %s$2.</string>
|
||||||
<string name="profileCouldNotBeDeleted">Profile could not be deleted.</string>
|
<string name="profileCouldNotBeDeleted">Profile could not be deleted.</string>
|
||||||
|
<string name="noRepetition">no repetition</string>
|
||||||
|
<string name="usingAuthentication">using authentication</string>
|
||||||
|
<string name="toNumber">to number</string>
|
||||||
|
<string name="message">message</string>
|
||||||
|
<string name="onDays">on days</string>
|
||||||
|
<string name="notSet">not set</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue
Block a user