Compare commits
No commits in common. "2a067507aee62418e416f030c2b5ba5d6a3ced5b" and "0463e0aa19cc388bf1bdc2ffc7cabeaa7c6cc922" have entirely different histories.
2a067507ae
...
0463e0aa19
@ -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 116
|
versionCode 115
|
||||||
versionName "1.7.2"
|
versionName "1.7.1"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 116,
|
"versionCode": 115,
|
||||||
"versionName": "1.7.2-googlePlay",
|
"versionName": "1.7.1-googlePlay",
|
||||||
"outputFile": "app-googlePlayFlavor-release.apk"
|
"outputFile": "app-googlePlayFlavor-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -65,7 +65,6 @@
|
|||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||||
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
|
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
|
||||||
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
|
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
|
||||||
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.telephony"
|
android:name="android.hardware.telephony"
|
||||||
@ -122,7 +121,15 @@
|
|||||||
<receiver android:name=".receivers.PackageReplacedReceiver"
|
<receiver android:name=".receivers.PackageReplacedReceiver"
|
||||||
android:enabled="true">
|
android:enabled="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
<!--<action android:name="android.intent.action.PACKAGE_ADDED"/>
|
||||||
|
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
||||||
|
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
|
||||||
|
<action android:name="android.intent.action.ACTION_PACKAGE_REPLACED" />-->
|
||||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||||
|
|
||||||
|
<!--<data
|
||||||
|
android:path="com.jens.automation2"
|
||||||
|
android:scheme="package" />-->
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver android:name=".receivers.DateTimeListener" />
|
<receiver android:name=".receivers.DateTimeListener" />
|
||||||
@ -147,7 +154,6 @@
|
|||||||
<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" />
|
||||||
|
@ -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 List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
private static ArrayList<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||||
|
|
||||||
public static List<Rule> getRuleRunHistory()
|
public static ArrayList<Rule> getRuleRunHistory()
|
||||||
{
|
{
|
||||||
return ruleRunHistory;
|
return ruleRunHistory;
|
||||||
}
|
}
|
||||||
@ -834,31 +834,7 @@ public class Rule implements Comparable<Rule>
|
|||||||
return ruleCandidates;
|
return ruleCandidates;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public static ArrayList<Rule> findRuleCandidatesByTriggerProfile(Profile profile)
|
public static ArrayList<Rule> findRuleCandidatesByProfile(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>();
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
<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" />
|
||||||
@ -63,7 +62,6 @@
|
|||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||||
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
|
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
|
||||||
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
|
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
|
||||||
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.telephony"
|
android:name="android.hardware.telephony"
|
||||||
@ -120,7 +118,15 @@
|
|||||||
<receiver android:name=".receivers.PackageReplacedReceiver"
|
<receiver android:name=".receivers.PackageReplacedReceiver"
|
||||||
android:enabled="true">
|
android:enabled="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
<!--<action android:name="android.intent.action.PACKAGE_ADDED"/>
|
||||||
|
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
||||||
|
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
|
||||||
|
<action android:name="android.intent.action.ACTION_PACKAGE_REPLACED" />-->
|
||||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||||
|
|
||||||
|
<!--<data
|
||||||
|
android:path="com.jens.automation2"
|
||||||
|
android:scheme="package" />-->
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver android:name=".receivers.DateTimeListener" />
|
<receiver android:name=".receivers.DateTimeListener" />
|
||||||
@ -145,7 +151,6 @@
|
|||||||
<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" />
|
||||||
@ -179,7 +184,6 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.nfc.action.TECH_DISCOVERED"
|
android:name="android.nfc.action.TECH_DISCOVERED"
|
||||||
@ -213,6 +217,7 @@
|
|||||||
|
|
||||||
<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,11 +8,10 @@ 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>
|
||||||
@ -20,9 +19,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 List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
private static ArrayList<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||||
|
|
||||||
public static List<Rule> getRuleRunHistory()
|
public static ArrayList<Rule> getRuleRunHistory()
|
||||||
{
|
{
|
||||||
return ruleRunHistory;
|
return ruleRunHistory;
|
||||||
}
|
}
|
||||||
@ -807,31 +806,7 @@ public class Rule implements Comparable<Rule>
|
|||||||
return ruleCandidates;
|
return ruleCandidates;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public static ArrayList<Rule> findRuleCandidatesByTriggerProfile(Profile profile)
|
public static ArrayList<Rule> findRuleCandidatesByProfile(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>();
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@
|
|||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||||
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
|
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
|
||||||
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
|
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@ -114,7 +113,15 @@
|
|||||||
<receiver android:name=".receivers.PackageReplacedReceiver"
|
<receiver android:name=".receivers.PackageReplacedReceiver"
|
||||||
android:enabled="true">
|
android:enabled="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
<!--<action android:name="android.intent.action.PACKAGE_ADDED"/>
|
||||||
|
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
||||||
|
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
|
||||||
|
<action android:name="android.intent.action.ACTION_PACKAGE_REPLACED" />-->
|
||||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||||
|
|
||||||
|
<!--<data
|
||||||
|
android:path="com.jens.automation2"
|
||||||
|
android:scheme="package" />-->
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver android:name=".receivers.DateTimeListener" />
|
<receiver android:name=".receivers.DateTimeListener" />
|
||||||
@ -139,7 +146,6 @@
|
|||||||
<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" />
|
||||||
@ -207,6 +213,7 @@
|
|||||||
|
|
||||||
<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 List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
private static ArrayList<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||||
|
|
||||||
public static List<Rule> getRuleRunHistory()
|
public static ArrayList<Rule> getRuleRunHistory()
|
||||||
{
|
{
|
||||||
return ruleRunHistory;
|
return ruleRunHistory;
|
||||||
}
|
}
|
||||||
@ -834,31 +834,7 @@ public class Rule implements Comparable<Rule>
|
|||||||
return ruleCandidates;
|
return ruleCandidates;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public static ArrayList<Rule> findRuleCandidatesByTriggerProfile(Profile profile)
|
public static ArrayList<Rule> findRuleCandidatesByProfile(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,92 +154,95 @@ public class Action
|
|||||||
{
|
{
|
||||||
StringBuilder returnString = new StringBuilder();
|
StringBuilder returnString = new StringBuilder();
|
||||||
|
|
||||||
switch(getAction())
|
if(this.getAction().equals(Action_Enum.setWifi))
|
||||||
{
|
{
|
||||||
case setWifi:
|
|
||||||
if(this.getParameter1())
|
if(this.getParameter1())
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOn));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOn));
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOff));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOff));
|
||||||
break;
|
}
|
||||||
case setBluetooth:
|
else if(this.getAction().equals(Action_Enum.setBluetooth))
|
||||||
|
{
|
||||||
if(this.getParameter1())
|
if(this.getParameter1())
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOn));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOn));
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOff));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOff));
|
||||||
break;
|
}
|
||||||
case setUsbTethering:
|
else if(this.getAction().equals(Action_Enum.setUsbTethering))
|
||||||
|
{
|
||||||
if(this.getParameter1())
|
if(this.getParameter1())
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOn));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOn));
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOff));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOff));
|
||||||
break;
|
}
|
||||||
case setWifiTethering:
|
else if(this.getAction().equals(Action_Enum.setWifiTethering))
|
||||||
|
{
|
||||||
if(this.getParameter1())
|
if(this.getParameter1())
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOn));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOn));
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOff));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOff));
|
||||||
break;
|
}
|
||||||
case setBluetoothTethering:
|
else if(this.getAction().equals(Action_Enum.setBluetoothTethering))
|
||||||
|
{
|
||||||
if(this.getParameter1())
|
if(this.getParameter1())
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOn));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOn));
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOff));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOff));
|
||||||
break;
|
}
|
||||||
case setDisplayRotation:
|
else if(this.getAction().equals(Action_Enum.setDisplayRotation))
|
||||||
|
{
|
||||||
if(this.getParameter1())
|
if(this.getParameter1())
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionEnableScreenRotation));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionEnableScreenRotation));
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionDisableScreenRotation));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionDisableScreenRotation));
|
||||||
break;
|
}
|
||||||
case setAirplaneMode:
|
else if(this.getAction().equals(Action_Enum.setAirplaneMode))
|
||||||
|
{
|
||||||
if(this.getParameter1())
|
if(this.getParameter1())
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOn));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOn));
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOff));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOff));
|
||||||
break;
|
}
|
||||||
case setDataConnection:
|
else if(this.getAction().equals(Action_Enum.setDataConnection))
|
||||||
|
{
|
||||||
if(this.getParameter1())
|
if(this.getParameter1())
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOn));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOn));
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOff));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOff));
|
||||||
break;
|
}
|
||||||
case startOtherActivity:
|
else if(this.getAction().equals(Action_Enum.startOtherActivity))
|
||||||
|
{
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.startOtherActivity));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.startOtherActivity));
|
||||||
break;
|
}
|
||||||
case triggerUrl:
|
else if(this.getAction().equals(Action_Enum.triggerUrl))
|
||||||
|
{
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTriggerUrl));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTriggerUrl));
|
||||||
break;
|
}
|
||||||
case speakText:
|
else if(this.getAction().equals(Action_Enum.speakText))
|
||||||
|
{
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSpeakText));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSpeakText));
|
||||||
break;
|
}
|
||||||
case playMusic:
|
else if(this.getAction().equals(Action_Enum.playMusic))
|
||||||
|
{
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionPlayMusic));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionPlayMusic));
|
||||||
break;
|
}
|
||||||
case sendTextMessage:
|
else if(this.getAction().equals(Action_Enum.sendTextMessage))
|
||||||
|
{
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.sendTextMessage));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.sendTextMessage));
|
||||||
break;
|
}
|
||||||
case turnScreenOnOrOff:
|
else if(this.getAction().equals(Action_Enum.turnScreenOnOrOff))
|
||||||
|
{
|
||||||
if(getParameter1())
|
if(getParameter1())
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOn));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOn));
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOff));
|
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.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))
|
||||||
{
|
{
|
||||||
@ -249,7 +252,7 @@ public class Action
|
|||||||
returnString.append(": " + components[2]);
|
returnString.append(": " + components[2]);
|
||||||
|
|
||||||
if(parameter1)
|
if(parameter1)
|
||||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.usingAuthentication) + ".");
|
returnString.append(" using authentication.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
returnString.append(": " + components[0]);
|
returnString.append(": " + components[0]);
|
||||||
@ -263,14 +266,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(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.toNumber) + " " + components[0]);
|
returnString.append(" to number " + components[0]);
|
||||||
|
|
||||||
returnString.append(". " + Miscellaneous.getAnyContext().getResources().getString(R.string.message) + ": " + components[1]);
|
returnString.append(". Message: " + components[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(this.getAction().equals(Action_Enum.setScreenBrightness))
|
else if(this.getAction().equals(Action_Enum.setScreenBrightness))
|
||||||
{
|
{
|
||||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.to) + " ");
|
returnString.append(" to ");
|
||||||
|
|
||||||
if(parameter1)
|
if(parameter1)
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.brightnessAuto));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.brightnessAuto));
|
||||||
|
@ -184,16 +184,8 @@ public class ActivityMainProfiles extends ActivityGeneric
|
|||||||
startActivityForResult(manageSpecificProfileIntent, 2000);
|
startActivityForResult(manageSpecificProfileIntent, 2000);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Rule user = profile.isInUseByRules();
|
if(profile.delete(myAutomationService))
|
||||||
if(user == null)
|
|
||||||
{
|
|
||||||
if (profile.delete(ActivityMainProfiles.this))
|
|
||||||
updateListView();
|
updateListView();
|
||||||
else
|
|
||||||
Toast.makeText(ActivityMainProfiles.this, getResources().getString(R.string.profileCouldNotBeDeleted), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Toast.makeText(ActivityMainProfiles.this, String.format(getResources().getString(R.string.ruleXIsUsingProfileY), user.getName(), profile.getName()), Toast.LENGTH_LONG).show();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AlertDialog getActionStartActivityDialog1Application()
|
private AlertDialog getActionStartActivityDialog1()
|
||||||
{
|
{
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectApplication));
|
alertDialogBuilder.setTitle(getResources().getString(R.string.selectApplication));
|
||||||
@ -241,78 +241,33 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
public void onClick(DialogInterface dialog, int which)
|
public void onClick(DialogInterface dialog, int which)
|
||||||
{
|
{
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
getActionStartActivityDialog2(applicationArray[which]);
|
getActionStartActivityDialog2(applicationArray[which]).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
|
|
||||||
return alertDialog;
|
return alertDialog;
|
||||||
}
|
}
|
||||||
private void getActionStartActivityDialog2(String applicationName)
|
private AlertDialog getActionStartActivityDialog2(String applicationName)
|
||||||
{
|
{
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectPackageOfApplication));
|
alertDialogBuilder.setTitle(getResources().getString(R.string.selectPackageOfApplication));
|
||||||
final String[] packageArray = ActivityManageActionStartActivity.getPackageListString(this, applicationName);
|
final String[] packageArray = ActivityManageActionStartActivity.getPackageListString(this, applicationName);
|
||||||
if(packageArray.length > 1)
|
|
||||||
{
|
|
||||||
alertDialogBuilder.setItems(packageArray, new DialogInterface.OnClickListener()
|
alertDialogBuilder.setItems(packageArray, new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which)
|
public void onClick(DialogInterface dialog, int which)
|
||||||
{
|
{
|
||||||
getActionStartActivityDialog4ActivityPickMethod(packageArray[which]).show();
|
getActionStartActivityDialog3(packageArray[which]).show();
|
||||||
}
|
|
||||||
});
|
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
|
||||||
alertDialog.show();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
getActionStartActivityDialog4ActivityPickMethod(packageArray[0]).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private AlertDialog getActionStartActivityDialog4ActivityPickMethod(final String packageName)
|
|
||||||
{
|
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
|
||||||
alertDialogBuilder.setMessage(getResources().getString(R.string.launcherOrManualExplanation));
|
|
||||||
alertDialogBuilder.setPositiveButton(getResources().getString(R.string.takeLauncherActivity), new DialogInterface.OnClickListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which)
|
|
||||||
{
|
|
||||||
// Pick the launcher automatically
|
|
||||||
Intent launchIntent = getPackageManager().getLaunchIntentForPackage(packageName);
|
|
||||||
if (launchIntent != null)
|
|
||||||
{
|
|
||||||
ActivityInfo ai = ActivityManageActionStartActivity.getActivityInfoForPackageNameAndActivityName(packageName, launchIntent.getComponent().getClassName());
|
|
||||||
etPackageName.setText(ai.packageName);
|
|
||||||
etActivityOrActionPath.setText(ai.name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
getActionStartActivityDialog5Activity(packageName).show();
|
|
||||||
Miscellaneous.messageBox(getResources().getString(R.string.hint), getResources().getString(R.string.launcherNotFound) + Miscellaneous.lineSeparator + getResources().getString(R.string.chooseActivityHint), ActivityManageActionStartActivity.this).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
alertDialogBuilder.setNegativeButton(getResources().getString(R.string.pickActivityManually), new DialogInterface.OnClickListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which)
|
|
||||||
{
|
|
||||||
getActionStartActivityDialog5Activity(packageName).show();
|
|
||||||
Miscellaneous.messageBox(getResources().getString(R.string.hint), getResources().getString(R.string.chooseActivityHint), ActivityManageActionStartActivity.this).show();
|
Miscellaneous.messageBox(getResources().getString(R.string.hint), getResources().getString(R.string.chooseActivityHint), ActivityManageActionStartActivity.this).show();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
final String activityArray[] = ActivityManageActionStartActivity.getActivityListForPackageName(packageName);
|
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
|
|
||||||
return alertDialog;
|
return alertDialog;
|
||||||
}
|
}
|
||||||
|
private AlertDialog getActionStartActivityDialog3(final String packageName)
|
||||||
private AlertDialog getActionStartActivityDialog5Activity(final String packageName)
|
|
||||||
{
|
{
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectActivityToBeStarted));
|
alertDialogBuilder.setTitle(getResources().getString(R.string.selectActivityToBeStarted));
|
||||||
@ -328,6 +283,7 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
|
|
||||||
return alertDialog;
|
return alertDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -642,6 +598,7 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
|
|
||||||
return alertDialog;
|
return alertDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -658,7 +615,9 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
protected void onPostExecute(Void result)
|
protected void onPostExecute(Void result)
|
||||||
{
|
{
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
getActionStartActivityDialog1Application().show();
|
getActionStartActivityDialog1().show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,6 +3,7 @@ package com.jens.automation2;
|
|||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
@ -13,7 +14,6 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.text.util.Linkify;
|
import android.text.util.Linkify;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
@ -50,35 +50,34 @@ public class ActivityManageRule extends Activity
|
|||||||
{
|
{
|
||||||
final static String activityDetectionClassPath = "com.jens.automation2.receivers.ActivityDetectionReceiver";
|
final static String activityDetectionClassPath = "com.jens.automation2.receivers.ActivityDetectionReceiver";
|
||||||
public final static String intentNameTriggerParameter1 = "triggerParameter1";
|
public final static String intentNameTriggerParameter1 = "triggerParameter1";
|
||||||
public final static String intentNameTriggerParameter2 = "triggerParameter2";
|
|
||||||
public final static String intentNameActionParameter1 = "actionParameter1";
|
public final static String intentNameActionParameter1 = "actionParameter1";
|
||||||
public final static String intentNameActionParameter2 = "actionParameter2";
|
public final static String intentNameActionParameter2 = "actionParameter2";
|
||||||
|
|
||||||
public Context context;
|
public Context context;
|
||||||
Button cmdTriggerAdd, cmdActionAdd, cmdSaveRule;
|
private Button cmdTriggerAdd, cmdActionAdd, cmdSaveRule;
|
||||||
ListView triggerListView, actionListView;
|
private ListView triggerListView, actionListView;
|
||||||
EditText etRuleName;
|
private EditText etRuleName;
|
||||||
CheckBox chkRuleActive, chkRuleToggle;
|
private CheckBox chkRuleActive, chkRuleToggle;
|
||||||
static ActivityManageRule instance = null;
|
private static ActivityManageRule instance = null;
|
||||||
ImageView imageHelpButton;
|
ImageView imageHelpButton;
|
||||||
|
|
||||||
static ProgressDialog progressDialog = null;
|
private static ProgressDialog progressDialog = null;
|
||||||
|
|
||||||
static Trigger_Enum triggerType;
|
private static Trigger_Enum triggerType;
|
||||||
static boolean triggerParameter;
|
private static boolean triggerParameter;
|
||||||
static PointOfInterest triggerPoi;
|
private static PointOfInterest triggerPoi;
|
||||||
static String triggerProcess;
|
private static String triggerProcess;
|
||||||
static int triggerBattery;
|
private static int triggerBattery;
|
||||||
static double triggerSpeed;
|
private static double triggerSpeed;
|
||||||
static double triggerNoise;
|
private static double triggerNoise;
|
||||||
static TimeFrame triggerTimeFrame;
|
private static TimeFrame triggerTimeFrame;
|
||||||
static String triggerWifiName;
|
private static String triggerWifiName;
|
||||||
|
|
||||||
static Rule ruleToEdit;
|
private static Rule ruleToEdit;
|
||||||
static boolean newRule;
|
private static boolean newRule;
|
||||||
|
|
||||||
static Trigger newTrigger;
|
private static Trigger newTrigger;
|
||||||
static Action newAction;
|
private static Action newAction;
|
||||||
|
|
||||||
ArrayAdapter<Trigger> triggerListViewAdapter;
|
ArrayAdapter<Trigger> triggerListViewAdapter;
|
||||||
ArrayAdapter<Action> actionListViewAdapter;
|
ArrayAdapter<Action> actionListViewAdapter;
|
||||||
@ -107,8 +106,6 @@ public class ActivityManageRule extends Activity
|
|||||||
final static int requestCodeActionPlaySoundEdit = 502;
|
final static int requestCodeActionPlaySoundEdit = 502;
|
||||||
final static int requestCodeTriggerPhoneCallAdd = 601;
|
final static int requestCodeTriggerPhoneCallAdd = 601;
|
||||||
final static int requestCodeTriggerPhoneCallEdit = 602;
|
final static int requestCodeTriggerPhoneCallEdit = 602;
|
||||||
final static int requestCodeTriggerProfileAdd = 603;
|
|
||||||
final static int requestCodeTriggerProfileEdit = 604;
|
|
||||||
final static int requestCodeTriggerWifiAdd = 723;
|
final static int requestCodeTriggerWifiAdd = 723;
|
||||||
final static int requestCodeTriggerWifiEdit = 724;
|
final static int requestCodeTriggerWifiEdit = 724;
|
||||||
final static int requestCodeActionSendTextMessageAdd = 5001;
|
final static int requestCodeActionSendTextMessageAdd = 5001;
|
||||||
@ -274,17 +271,11 @@ public class ActivityManageRule extends Activity
|
|||||||
phoneCallEditor.putExtra("edit", true);
|
phoneCallEditor.putExtra("edit", true);
|
||||||
startActivityForResult(phoneCallEditor, requestCodeTriggerPhoneCallEdit);
|
startActivityForResult(phoneCallEditor, requestCodeTriggerPhoneCallEdit);
|
||||||
break;
|
break;
|
||||||
case profileActive:
|
|
||||||
Intent profileActiveEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerProfile.class);
|
|
||||||
profileActiveEditor.putExtra(ActivityManageRule.intentNameTriggerParameter1, selectedTrigger.getTriggerParameter());
|
|
||||||
profileActiveEditor.putExtra(ActivityManageRule.intentNameTriggerParameter2, selectedTrigger.getTriggerParameter2());
|
|
||||||
startActivityForResult(profileActiveEditor, requestCodeTriggerProfileEdit);
|
|
||||||
break;
|
|
||||||
case wifiConnection:
|
case wifiConnection:
|
||||||
Intent wifiEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerWifi.class);
|
Intent wifiEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerWifi.class);
|
||||||
wifiEditor.putExtra("edit", true);
|
wifiEditor.putExtra("edit", true);
|
||||||
wifiEditor.putExtra(ActivityManageTriggerWifi.intentNameWifiState, selectedTrigger.getTriggerParameter());
|
wifiEditor.putExtra("wifiState", selectedTrigger.getTriggerParameter());
|
||||||
wifiEditor.putExtra(ActivityManageTriggerWifi.intentNameWifiName, selectedTrigger.getTriggerParameter2());
|
wifiEditor.putExtra("wifiName", selectedTrigger.getTriggerParameter2());
|
||||||
startActivityForResult(wifiEditor, requestCodeTriggerWifiEdit);
|
startActivityForResult(wifiEditor, requestCodeTriggerWifiEdit);
|
||||||
break;
|
break;
|
||||||
case deviceOrientation:
|
case deviceOrientation:
|
||||||
@ -505,8 +496,6 @@ public class ActivityManageRule extends Activity
|
|||||||
items.add(new Item(typesLong[i].toString(), R.drawable.notification));
|
items.add(new Item(typesLong[i].toString(), R.drawable.notification));
|
||||||
else if(types[i].toString().equals(Trigger_Enum.deviceOrientation.toString()))
|
else if(types[i].toString().equals(Trigger_Enum.deviceOrientation.toString()))
|
||||||
items.add(new Item(typesLong[i].toString(), R.drawable.smartphone));
|
items.add(new Item(typesLong[i].toString(), R.drawable.smartphone));
|
||||||
else if(types[i].toString().equals(Trigger_Enum.profileActive.toString()))
|
|
||||||
items.add(new Item(typesLong[i].toString(), R.drawable.sound));
|
|
||||||
else
|
else
|
||||||
items.add(new Item(typesLong[i].toString(), R.drawable.placeholder));
|
items.add(new Item(typesLong[i].toString(), R.drawable.placeholder));
|
||||||
}
|
}
|
||||||
@ -579,6 +568,7 @@ public class ActivityManageRule extends Activity
|
|||||||
Intent wifiTriggerEditor = new Intent(myContext, ActivityManageTriggerWifi.class);
|
Intent wifiTriggerEditor = new Intent(myContext, ActivityManageTriggerWifi.class);
|
||||||
startActivityForResult(wifiTriggerEditor, requestCodeTriggerWifiAdd);
|
startActivityForResult(wifiTriggerEditor, requestCodeTriggerWifiAdd);
|
||||||
return;
|
return;
|
||||||
|
// booleanChoices = new String[]{getResources().getString(R.string.started), getResources().getString(R.string.stopped)};
|
||||||
}
|
}
|
||||||
else if(triggerType == Trigger_Enum.deviceOrientation)
|
else if(triggerType == Trigger_Enum.deviceOrientation)
|
||||||
{
|
{
|
||||||
@ -586,7 +576,10 @@ public class ActivityManageRule extends Activity
|
|||||||
Intent devicePositionTriggerEditor = new Intent(myContext, ActivityManageTriggerDeviceOrientation.class);
|
Intent devicePositionTriggerEditor = new Intent(myContext, ActivityManageTriggerDeviceOrientation.class);
|
||||||
startActivityForResult(devicePositionTriggerEditor, requestCodeTriggerDeviceOrientationAdd);
|
startActivityForResult(devicePositionTriggerEditor, requestCodeTriggerDeviceOrientationAdd);
|
||||||
return;
|
return;
|
||||||
|
// booleanChoices = new String[]{getResources().getString(R.string.started), getResources().getString(R.string.stopped)};
|
||||||
}
|
}
|
||||||
|
// else if(triggerType == Trigger_Enum.wifiConnection)
|
||||||
|
// booleanChoices = new String[]{getResources().getString(R.string.connected), getResources().getString(R.string.disconnected)};
|
||||||
else if(triggerType == Trigger_Enum.process_started_stopped)
|
else if(triggerType == Trigger_Enum.process_started_stopped)
|
||||||
booleanChoices = new String[]{getResources().getString(R.string.started), getResources().getString(R.string.stopped)};
|
booleanChoices = new String[]{getResources().getString(R.string.started), getResources().getString(R.string.stopped)};
|
||||||
else if(triggerType == Trigger_Enum.notification)
|
else if(triggerType == Trigger_Enum.notification)
|
||||||
@ -606,21 +599,7 @@ public class ActivityManageRule extends Activity
|
|||||||
Intent phoneTriggerEditor = new Intent(myContext, ActivityManageTriggerPhoneCall.class);
|
Intent phoneTriggerEditor = new Intent(myContext, ActivityManageTriggerPhoneCall.class);
|
||||||
startActivityForResult(phoneTriggerEditor, requestCodeTriggerPhoneCallAdd);
|
startActivityForResult(phoneTriggerEditor, requestCodeTriggerPhoneCallAdd);
|
||||||
return;
|
return;
|
||||||
}
|
// booleanChoices = new String[]{getResources().getString(R.string.started), getResources().getString(R.string.stopped)};
|
||||||
else if(triggerType == Trigger_Enum.profileActive)
|
|
||||||
{
|
|
||||||
if(Profile.getProfileCollection().size() > 0)
|
|
||||||
{
|
|
||||||
newTrigger.setTriggerType(Trigger_Enum.profileActive);
|
|
||||||
Intent profileTriggerEditor = new Intent(myContext, ActivityManageTriggerProfile.class);
|
|
||||||
startActivityForResult(profileTriggerEditor, requestCodeTriggerProfileAdd);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Toast.makeText(context, getResources().getString(R.string.noProfilesCreateOneFirst), Toast.LENGTH_LONG).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(triggerType == Trigger_Enum.activityDetection)
|
else if(triggerType == Trigger_Enum.activityDetection)
|
||||||
{
|
{
|
||||||
@ -643,7 +622,7 @@ public class ActivityManageRule extends Activity
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException | InvocationTargetException e)
|
catch (IllegalAccessException | InvocationTargetException e)
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("w", "ActivityDetection", "Either play services are not available or the ActivityDetection classes are not. " + Log.getStackTraceString(e), 4);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1051,6 +1030,7 @@ public class ActivityManageRule extends Activity
|
|||||||
@Override
|
@Override
|
||||||
protected String[] doInBackground(ActivityManageRule... params)
|
protected String[] doInBackground(ActivityManageRule... params)
|
||||||
{
|
{
|
||||||
|
// Looper.prepare();
|
||||||
final String[] applicationArray = ActivityManageActionStartActivity.getApplicationNameListString(params[0]);
|
final String[] applicationArray = ActivityManageActionStartActivity.getApplicationNameListString(params[0]);
|
||||||
return applicationArray;
|
return applicationArray;
|
||||||
}
|
}
|
||||||
@ -1186,8 +1166,8 @@ public class ActivityManageRule extends Activity
|
|||||||
{
|
{
|
||||||
if(resultCode == RESULT_OK)
|
if(resultCode == RESULT_OK)
|
||||||
{
|
{
|
||||||
newTrigger.setTriggerParameter(data.getBooleanExtra(ActivityManageTriggerWifi.intentNameWifiState, false));
|
newTrigger.setTriggerParameter(data.getBooleanExtra("wifiState", false));
|
||||||
newTrigger.setTriggerParameter2(data.getStringExtra(ActivityManageTriggerWifi.intentNameWifiName));
|
newTrigger.setTriggerParameter2(data.getStringExtra("wifiName"));
|
||||||
newTrigger.setParentRule(ruleToEdit);
|
newTrigger.setParentRule(ruleToEdit);
|
||||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||||
this.refreshTriggerList();
|
this.refreshTriggerList();
|
||||||
@ -1199,8 +1179,8 @@ public class ActivityManageRule extends Activity
|
|||||||
{
|
{
|
||||||
Trigger editedTrigger = new Trigger();
|
Trigger editedTrigger = new Trigger();
|
||||||
editedTrigger.setTriggerType(Trigger_Enum.wifiConnection);
|
editedTrigger.setTriggerType(Trigger_Enum.wifiConnection);
|
||||||
editedTrigger.setTriggerParameter(data.getBooleanExtra(ActivityManageTriggerWifi.intentNameWifiState, false));
|
editedTrigger.setTriggerParameter(data.getBooleanExtra("wifiState", false));
|
||||||
editedTrigger.setTriggerParameter2(data.getStringExtra(ActivityManageTriggerWifi.intentNameWifiName));
|
editedTrigger.setTriggerParameter2(data.getStringExtra("wifiName"));
|
||||||
editedTrigger.setParentRule(ruleToEdit);
|
editedTrigger.setParentRule(ruleToEdit);
|
||||||
ruleToEdit.getTriggerSet().set(editIndex, editedTrigger);
|
ruleToEdit.getTriggerSet().set(editIndex, editedTrigger);
|
||||||
this.refreshTriggerList();
|
this.refreshTriggerList();
|
||||||
@ -1248,13 +1228,13 @@ public class ActivityManageRule extends Activity
|
|||||||
{
|
{
|
||||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||||
|
|
||||||
newTrigger.setTriggerParameter(data.getBooleanExtra(ActivityManageTriggerNotification.intentNameNotificationDirection, false));
|
newTrigger.setTriggerParameter(data.getBooleanExtra("direction", false));
|
||||||
newTrigger.setTriggerParameter2(
|
newTrigger.setTriggerParameter2(
|
||||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationApp) + Trigger.triggerParameter2Split +
|
data.getStringExtra("app") + Trigger.triggerParameter2Split +
|
||||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationTitleDir) + Trigger.triggerParameter2Split +
|
data.getStringExtra("titleDir") + Trigger.triggerParameter2Split +
|
||||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationTitle) + Trigger.triggerParameter2Split +
|
data.getStringExtra("title") + Trigger.triggerParameter2Split +
|
||||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationTextDir) + Trigger.triggerParameter2Split +
|
data.getStringExtra("textDir") + Trigger.triggerParameter2Split +
|
||||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationText)
|
data.getStringExtra("text")
|
||||||
);
|
);
|
||||||
newTrigger.setParentRule(ruleToEdit);
|
newTrigger.setParentRule(ruleToEdit);
|
||||||
this.refreshTriggerList();
|
this.refreshTriggerList();
|
||||||
@ -1448,30 +1428,6 @@ public class ActivityManageRule extends Activity
|
|||||||
this.refreshTriggerList();
|
this.refreshTriggerList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(requestCode == requestCodeTriggerProfileAdd)
|
|
||||||
{
|
|
||||||
if(resultCode == RESULT_OK)
|
|
||||||
{
|
|
||||||
newTrigger.setTriggerParameter(data.getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true));
|
|
||||||
newTrigger.setTriggerParameter2(data.getStringExtra(ActivityManageRule.intentNameTriggerParameter2));
|
|
||||||
newTrigger.setParentRule(ruleToEdit);
|
|
||||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
|
||||||
this.refreshTriggerList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(requestCode == requestCodeTriggerProfileEdit)
|
|
||||||
{
|
|
||||||
if(resultCode == RESULT_OK)
|
|
||||||
{
|
|
||||||
Trigger editedTrigger = new Trigger();
|
|
||||||
editedTrigger.setTriggerType(Trigger_Enum.profileActive);
|
|
||||||
editedTrigger.setTriggerParameter(data.getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true));
|
|
||||||
editedTrigger.setTriggerParameter2(data.getStringExtra(ActivityManageRule.intentNameTriggerParameter2));
|
|
||||||
editedTrigger.setParentRule(ruleToEdit);
|
|
||||||
ruleToEdit.getTriggerSet().set(editIndex, editedTrigger);
|
|
||||||
this.refreshTriggerList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AlertDialog getActionTypeDialog()
|
protected AlertDialog getActionTypeDialog()
|
||||||
|
@ -43,7 +43,7 @@ public class ActivityManageTriggerDeviceOrientation extends Activity
|
|||||||
{
|
{
|
||||||
desiredAzimuth = Float.parseFloat(etDesiredAzimuth.getText().toString());
|
desiredAzimuth = Float.parseFloat(etDesiredAzimuth.getText().toString());
|
||||||
desiredAzimuthTolerance = Float.parseFloat(etDesiredAzimuthTolerance.getText().toString());
|
desiredAzimuthTolerance = Float.parseFloat(etDesiredAzimuthTolerance.getText().toString());
|
||||||
if (desiredAzimuthTolerance == 180 || (desiredAzimuth - desiredAzimuthTolerance <= azimuth && azimuth <= desiredAzimuth + desiredAzimuthTolerance))
|
if (Math.abs(azimuth) <= Math.abs(desiredAzimuth - desiredAzimuthTolerance) || Math.abs(azimuth) <= desiredAzimuth + desiredAzimuthTolerance)
|
||||||
{
|
{
|
||||||
tvAppliesAzimuth.setText(getResources().getString(R.string.yes));
|
tvAppliesAzimuth.setText(getResources().getString(R.string.yes));
|
||||||
tvAppliesAzimuth.setTextColor(Color.GREEN);
|
tvAppliesAzimuth.setTextColor(Color.GREEN);
|
||||||
@ -63,7 +63,7 @@ public class ActivityManageTriggerDeviceOrientation extends Activity
|
|||||||
{
|
{
|
||||||
desiredPitch = Float.parseFloat(etDesiredPitch.getText().toString());
|
desiredPitch = Float.parseFloat(etDesiredPitch.getText().toString());
|
||||||
desiredPitchTolerance = Float.parseFloat(etDesiredPitchTolerance.getText().toString());
|
desiredPitchTolerance = Float.parseFloat(etDesiredPitchTolerance.getText().toString());
|
||||||
if (desiredPitchTolerance == 180 || (desiredPitch - desiredPitchTolerance <= pitch && pitch <= desiredPitch + desiredPitchTolerance))
|
if (Math.abs(pitch) <= Math.abs(desiredPitch - desiredPitchTolerance) || Math.abs(pitch) <= desiredPitch + desiredPitchTolerance)
|
||||||
{
|
{
|
||||||
tvAppliesPitch.setText(getResources().getString(R.string.yes));
|
tvAppliesPitch.setText(getResources().getString(R.string.yes));
|
||||||
tvAppliesPitch.setTextColor(Color.GREEN);
|
tvAppliesPitch.setTextColor(Color.GREEN);
|
||||||
@ -83,7 +83,7 @@ public class ActivityManageTriggerDeviceOrientation extends Activity
|
|||||||
{
|
{
|
||||||
desiredRoll = Float.parseFloat(etDesiredRoll.getText().toString());
|
desiredRoll = Float.parseFloat(etDesiredRoll.getText().toString());
|
||||||
desiredRollTolerance = Float.parseFloat(etDesiredRollTolerance.getText().toString());
|
desiredRollTolerance = Float.parseFloat(etDesiredRollTolerance.getText().toString());
|
||||||
if (desiredRollTolerance == 180 || (desiredRoll - desiredRollTolerance <= roll && roll <= desiredRoll + desiredRollTolerance))
|
if (Math.abs(roll) <= Math.abs(desiredRoll - desiredRollTolerance) || Math.abs(roll) <= desiredRoll + desiredRollTolerance)
|
||||||
{
|
{
|
||||||
tvAppliesRoll.setText(getResources().getString(R.string.yes));
|
tvAppliesRoll.setText(getResources().getString(R.string.yes));
|
||||||
tvAppliesRoll.setTextColor(Color.GREEN);
|
tvAppliesRoll.setTextColor(Color.GREEN);
|
||||||
@ -159,16 +159,14 @@ public class ActivityManageTriggerDeviceOrientation extends Activity
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v)
|
public void onClick(View v)
|
||||||
{
|
{
|
||||||
// Round the values. Too long decimals will destroy the layout
|
|
||||||
|
|
||||||
if(!StringUtils.isEmpty(currentAzimuth.getText()))
|
if(!StringUtils.isEmpty(currentAzimuth.getText()))
|
||||||
etDesiredAzimuth.setText(String.valueOf(Math.round(Float.parseFloat(currentAzimuth.getText().toString()))));
|
etDesiredAzimuth.setText(currentAzimuth.getText());
|
||||||
|
|
||||||
if(!StringUtils.isEmpty(currentPitch.getText()))
|
if(!StringUtils.isEmpty(currentPitch.getText()))
|
||||||
etDesiredPitch.setText(String.valueOf(Math.round(Float.parseFloat(currentPitch.getText().toString()))));
|
etDesiredPitch.setText(currentPitch.getText());
|
||||||
|
|
||||||
if(!StringUtils.isEmpty(currentRoll.getText()))
|
if(!StringUtils.isEmpty(currentRoll.getText()))
|
||||||
etDesiredRoll.setText(String.valueOf(Math.round(Float.parseFloat(currentRoll.getText().toString()))));
|
etDesiredRoll.setText(currentRoll.getText());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -31,13 +31,6 @@ import static com.jens.automation2.Trigger.triggerParameter2Split;
|
|||||||
|
|
||||||
public class ActivityManageTriggerNotification extends Activity
|
public class ActivityManageTriggerNotification extends Activity
|
||||||
{
|
{
|
||||||
public static final String intentNameNotificationApp = "app";
|
|
||||||
public static final String intentNameNotificationTitleDir = "titleDir";
|
|
||||||
public static final String intentNameNotificationTitle = "title";
|
|
||||||
public static final String intentNameNotificationTextDir = "textDir";
|
|
||||||
public static final String intentNameNotificationText = "text";
|
|
||||||
public static final String intentNameNotificationDirection = "direction";
|
|
||||||
|
|
||||||
public static Trigger editedNotificationTrigger;
|
public static Trigger editedNotificationTrigger;
|
||||||
boolean edit = false;
|
boolean edit = false;
|
||||||
ProgressDialog progressDialog = null;
|
ProgressDialog progressDialog = null;
|
||||||
@ -330,12 +323,12 @@ public class ActivityManageTriggerNotification extends Activity
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Intent data = new Intent();
|
Intent data = new Intent();
|
||||||
data.putExtra(intentNameNotificationDirection, chkNotificationDirection.isChecked());
|
data.putExtra("direction", chkNotificationDirection.isChecked());
|
||||||
data.putExtra(intentNameNotificationApp, app);
|
data.putExtra("app", app);
|
||||||
data.putExtra(intentNameNotificationTitleDir, titleDir);
|
data.putExtra("titleDir", titleDir);
|
||||||
data.putExtra(intentNameNotificationTitle, title);
|
data.putExtra("title", title);
|
||||||
data.putExtra(intentNameNotificationTextDir, textDir);
|
data.putExtra("textDir", textDir);
|
||||||
data.putExtra(intentNameNotificationText, text);
|
data.putExtra("text", text);
|
||||||
ActivityManageTriggerNotification.this.setResult(RESULT_OK, data);
|
ActivityManageTriggerNotification.this.setResult(RESULT_OK, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,117 +0,0 @@
|
|||||||
package com.jens.automation2;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ActivityManageTriggerProfile extends Activity
|
|
||||||
{
|
|
||||||
public static final String profileFieldName = "profileName";
|
|
||||||
|
|
||||||
boolean editMode = false;
|
|
||||||
|
|
||||||
Button bSaveTriggerProfile;
|
|
||||||
Spinner spinnerProfiles;
|
|
||||||
CheckBox chkProfileActive, chkProfileCheckSettings;
|
|
||||||
|
|
||||||
ArrayAdapter<Profile> profileSpinnerAdapter;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_manage_trigger_profile);
|
|
||||||
|
|
||||||
bSaveTriggerProfile = (Button)findViewById(R.id.bSaveTriggerProfile);
|
|
||||||
spinnerProfiles = (Spinner)findViewById(R.id.spinnerProfiles);
|
|
||||||
chkProfileActive = (CheckBox)findViewById(R.id.chkProfileActive);
|
|
||||||
chkProfileCheckSettings = (CheckBox)findViewById(R.id.chkProfileCheckSettings);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
profileSpinnerAdapter = new ArrayAdapter<Profile>(this, R.layout.text_view_for_poi_listview_mediumtextsize, Profile.getProfileCollection());
|
|
||||||
loadProfileItems();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Miscellaneous.logEvent("w", "ActivityManageTriggerProfile", Log.getStackTraceString(e), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(getIntent().hasExtra(ActivityManageRule.intentNameTriggerParameter2))
|
|
||||||
{
|
|
||||||
editMode = true;
|
|
||||||
|
|
||||||
boolean active = getIntent().getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true);
|
|
||||||
chkProfileActive.setChecked(active);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String values[] = getIntent().getStringExtra(ActivityManageRule.intentNameTriggerParameter2).split(Trigger.triggerParameter2Split);
|
|
||||||
if(values.length >= 2)
|
|
||||||
{
|
|
||||||
boolean checkSettings = Boolean.parseBoolean(values[0]);
|
|
||||||
chkProfileCheckSettings.setChecked(checkSettings);
|
|
||||||
|
|
||||||
String profileName = values[0];
|
|
||||||
|
|
||||||
List<Profile> profileList = Profile.getProfileCollection();
|
|
||||||
for(int i = 0; i < profileList.size(); i++)
|
|
||||||
{
|
|
||||||
if(profileList.get(i).getName().equals(profileName))
|
|
||||||
{
|
|
||||||
spinnerProfiles.setSelection(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
Toast.makeText(ActivityManageTriggerProfile.this, getResources().getString(R.string.triggerWrong), Toast.LENGTH_SHORT).show();
|
|
||||||
Miscellaneous.logEvent("e", "ActivityManageTriggerProfile", "There\'s something wrong with parameters. Content: " + getIntent().getStringExtra(ActivityManageRule.intentNameActionParameter2) + ", " + Log.getStackTraceString(e), 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bSaveTriggerProfile.setOnClickListener(new View.OnClickListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onClick(View v)
|
|
||||||
{
|
|
||||||
Intent returnData = new Intent();
|
|
||||||
returnData.putExtra(ActivityManageRule.intentNameTriggerParameter1, chkProfileActive.isChecked());
|
|
||||||
returnData.putExtra(ActivityManageRule.intentNameTriggerParameter2,
|
|
||||||
spinnerProfiles.getSelectedItem().toString() + Trigger.triggerParameter2Split +
|
|
||||||
chkProfileCheckSettings.isChecked());
|
|
||||||
|
|
||||||
setResult(RESULT_OK, returnData);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadProfileItems()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(spinnerProfiles.getAdapter() == null)
|
|
||||||
spinnerProfiles.setAdapter(profileSpinnerAdapter);
|
|
||||||
|
|
||||||
profileSpinnerAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
catch(NullPointerException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -35,9 +35,6 @@ import java.util.List;
|
|||||||
|
|
||||||
public class ActivityManageTriggerWifi extends Activity
|
public class ActivityManageTriggerWifi extends Activity
|
||||||
{
|
{
|
||||||
public final static String intentNameWifiState = "wifiState";
|
|
||||||
public final static String intentNameWifiName = "wifiName";
|
|
||||||
|
|
||||||
RadioButton rbTriggerWifiConnected, rbTriggerWifiDisconnected;
|
RadioButton rbTriggerWifiConnected, rbTriggerWifiDisconnected;
|
||||||
EditText etTriggerWifiName;
|
EditText etTriggerWifiName;
|
||||||
Spinner spinnerWifiList;
|
Spinner spinnerWifiList;
|
||||||
|
@ -3,6 +3,7 @@ package com.jens.automation2;
|
|||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Notification;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.app.admin.DevicePolicyManager;
|
import android.app.admin.DevicePolicyManager;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@ -15,13 +16,14 @@ import android.content.res.Resources;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.PowerManager;
|
|
||||||
import android.provider.Settings;
|
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
import com.jens.automation2.receivers.NotificationListener;
|
import com.jens.automation2.receivers.NotificationListener;
|
||||||
|
|
||||||
@ -46,7 +48,6 @@ public class ActivityPermissions extends Activity
|
|||||||
private static final int requestCodeForPermissionsBackgroundLocation = 12045;
|
private static final int requestCodeForPermissionsBackgroundLocation = 12045;
|
||||||
private static final int requestCodeForPermissionsNotifications = 12046;
|
private static final int requestCodeForPermissionsNotifications = 12046;
|
||||||
private static final int requestCodeForPermissionsDeviceAdmin = 12047;
|
private static final int requestCodeForPermissionsDeviceAdmin = 12047;
|
||||||
private static final int requestCodeForPermissionsBatteryOptimization = 12048;
|
|
||||||
protected String[] specificPermissionsToRequest = null;
|
protected String[] specificPermissionsToRequest = null;
|
||||||
|
|
||||||
public static String intentExtraName = "permissionsToBeRequested";
|
public static String intentExtraName = "permissionsToBeRequested";
|
||||||
@ -287,12 +288,6 @@ public class ActivityPermissions extends Activity
|
|||||||
{
|
{
|
||||||
return haveDeviceAdmin();
|
return haveDeviceAdmin();
|
||||||
}
|
}
|
||||||
else if (s.equals(Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS))
|
|
||||||
{
|
|
||||||
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
|
||||||
String packageName = context.getApplicationContext().getPackageName();
|
|
||||||
return pm.isIgnoringBatteryOptimizations(packageName);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int res = context.checkCallingOrSelfPermission(s);
|
int res = context.checkCallingOrSelfPermission(s);
|
||||||
@ -346,12 +341,11 @@ public class ActivityPermissions extends Activity
|
|||||||
for (Profile profile : Profile.getProfileCollection())
|
for (Profile profile : Profile.getProfileCollection())
|
||||||
{
|
{
|
||||||
if (profile.changeIncomingCallsRingtone)
|
if (profile.changeIncomingCallsRingtone)
|
||||||
|
{
|
||||||
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(!havePermission(Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, workingContext))
|
|
||||||
addToArrayListUnique(Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, requiredPermissions);
|
|
||||||
|
|
||||||
if (!onlyGeneral)
|
if (!onlyGeneral)
|
||||||
{
|
{
|
||||||
@ -857,9 +851,6 @@ public class ActivityPermissions extends Activity
|
|||||||
for(String ruleName : getRulesUsing(Action.Action_Enum.turnScreenOnOrOff))
|
for(String ruleName : getRulesUsing(Action.Action_Enum.turnScreenOnOrOff))
|
||||||
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||||
break;
|
break;
|
||||||
case Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS:
|
|
||||||
usingElements.add(getResources().getString(R.string.recommendedForBetterReliability));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return usingElements;
|
return usingElements;
|
||||||
@ -886,7 +877,6 @@ public class ActivityPermissions extends Activity
|
|||||||
requestPermissions(cachedPermissionsToRequest, true);
|
requestPermissions(cachedPermissionsToRequest, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requestCode == requestCodeForPermissionsDeviceAdmin)
|
if (requestCode == requestCodeForPermissionsDeviceAdmin)
|
||||||
{
|
{
|
||||||
NotificationManager mNotificationManager = (NotificationManager) ActivityPermissions.this.getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager mNotificationManager = (NotificationManager) ActivityPermissions.this.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
@ -907,10 +897,6 @@ public class ActivityPermissions extends Activity
|
|||||||
if (requestCode == requestCodeForPermissionsNotifications)
|
if (requestCode == requestCodeForPermissionsNotifications)
|
||||||
if(havePermission(Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE, ActivityPermissions.this))
|
if(havePermission(Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE, ActivityPermissions.this))
|
||||||
requestPermissions(cachedPermissionsToRequest, true);
|
requestPermissions(cachedPermissionsToRequest, true);
|
||||||
|
|
||||||
if (requestCode == requestCodeForPermissionsBatteryOptimization)
|
|
||||||
if(havePermission(Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, ActivityPermissions.this))
|
|
||||||
requestPermissions(cachedPermissionsToRequest, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -980,20 +966,10 @@ public class ActivityPermissions extends Activity
|
|||||||
{
|
{
|
||||||
requiredPermissions.remove(s);
|
requiredPermissions.remove(s);
|
||||||
cachedPermissionsToRequest = requiredPermissions;
|
cachedPermissionsToRequest = requiredPermissions;
|
||||||
Intent intent = new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS);
|
Intent intent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
|
||||||
startActivityForResult(intent, requestCodeForPermissionsNotifications);
|
startActivityForResult(intent, requestCodeForPermissionsNotifications);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(s.equals(Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS))
|
|
||||||
{
|
|
||||||
requiredPermissions.remove(s);
|
|
||||||
cachedPermissionsToRequest = requiredPermissions;
|
|
||||||
String packageName = getApplicationContext().getPackageName();
|
|
||||||
Intent intent = new Intent(android.provider.Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
|
||||||
intent.setData(Uri.parse("package:" + packageName));
|
|
||||||
startActivityForResult(intent, requestCodeForPermissionsBatteryOptimization);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (s.equalsIgnoreCase(Manifest.permission.ACCESS_BACKGROUND_LOCATION) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
else if (s.equalsIgnoreCase(Manifest.permission.ACCESS_BACKGROUND_LOCATION) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||||
{
|
{
|
||||||
AlertDialog dialog = Miscellaneous.messageBox(getResources().getString(R.string.readLocation), getResources().getString(R.string.pleaseGiveBgLocation), ActivityPermissions.this);
|
AlertDialog dialog = Miscellaneous.messageBox(getResources().getString(R.string.readLocation), getResources().getString(R.string.pleaseGiveBgLocation), ActivityPermissions.this);
|
||||||
|
@ -216,14 +216,6 @@ public class Miscellaneous extends Service
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int boolToInt(boolean input)
|
|
||||||
{
|
|
||||||
if(input)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBinder onBind(Intent arg0)
|
public IBinder onBind(Intent arg0)
|
||||||
{
|
{
|
||||||
@ -1073,23 +1065,6 @@ public class Miscellaneous extends Service
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String explode(String glue, String[] inputArray)
|
|
||||||
{
|
|
||||||
if(inputArray != null)
|
|
||||||
{
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
for (String s : inputArray)
|
|
||||||
builder.append(s + glue);
|
|
||||||
|
|
||||||
if (builder.length() > 0)
|
|
||||||
builder.delete(builder.length() - glue.length(), builder.length());
|
|
||||||
|
|
||||||
return builder.toString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isGooglePlayInstalled(Context context)
|
public static boolean isGooglePlayInstalled(Context context)
|
||||||
{
|
{
|
||||||
// return false;
|
// return false;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.jens.automation2;
|
package com.jens.automation2;
|
||||||
|
|
||||||
import android.app.NotificationManager;
|
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
@ -15,12 +14,10 @@ import com.jens.automation2.Action.Action_Enum;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class Profile implements Comparable<Profile>
|
public class Profile implements Comparable<Profile>
|
||||||
{
|
{
|
||||||
protected static List<Profile> profileCollection = new ArrayList<Profile>();
|
protected static ArrayList<Profile> profileCollection = new ArrayList<Profile>();
|
||||||
protected static List<Profile> profileActivationHistory = new ArrayList<>();
|
|
||||||
|
|
||||||
protected String name;
|
protected String name;
|
||||||
protected String oldName;
|
protected String oldName;
|
||||||
@ -270,7 +267,7 @@ public class Profile implements Comparable<Profile>
|
|||||||
return hapticFeedback;
|
return hapticFeedback;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Profile> getProfileCollection()
|
public static ArrayList<Profile> getProfileCollection()
|
||||||
{
|
{
|
||||||
return profileCollection;
|
return profileCollection;
|
||||||
}
|
}
|
||||||
@ -292,11 +289,17 @@ public class Profile implements Comparable<Profile>
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean delete(AutomationService myAutomationService)
|
||||||
|
{
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean applyRingTone(File ringtoneFile, int ringtoneType, Context context)
|
private boolean applyRingTone(File ringtoneFile, int ringtoneType, Context context)
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "Profile", "Request to set ringtone to " + ringtoneFile.getAbsolutePath(), 3);
|
Miscellaneous.logEvent("i", "Profile", "Request to set ringtone to " + ringtoneFile.getAbsolutePath(), 3);
|
||||||
|
|
||||||
if(!ringtoneFile.exists() || !ringtoneFile.canRead())
|
if(!ringtoneFile.exists() | !ringtoneFile.canRead())
|
||||||
{
|
{
|
||||||
String message = "Ringtone file does not exist or cannot read it: " + ringtoneFile.getAbsolutePath();
|
String message = "Ringtone file does not exist or cannot read it: " + ringtoneFile.getAbsolutePath();
|
||||||
Miscellaneous.logEvent("i", "Profile", message, 3);
|
Miscellaneous.logEvent("i", "Profile", message, 3);
|
||||||
@ -387,23 +390,11 @@ public class Profile implements Comparable<Profile>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if rules reference this profile
|
// Check if rules reference this profile
|
||||||
ArrayList<Rule> rulesThatReferenceMe = Rule.findRuleCandidatesByActionProfile(this);
|
ArrayList<Rule> rulesThatReferenceMe = Rule.findRuleCandidatesByProfile(this);
|
||||||
if(rulesThatReferenceMe.size() > 0)
|
if(rulesThatReferenceMe.size() > 0)
|
||||||
{
|
{
|
||||||
for(Rule oneRule : rulesThatReferenceMe)
|
for(Rule oneRule : rulesThatReferenceMe)
|
||||||
{
|
{
|
||||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
|
||||||
{
|
|
||||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.profileActive)
|
|
||||||
{
|
|
||||||
String[] parts = oneTrigger.getTriggerParameter2().split(Trigger.triggerParameter2Split);
|
|
||||||
parts[0] = this.name;
|
|
||||||
|
|
||||||
oneTrigger.setTriggerParameter2(Miscellaneous.explode(Trigger.triggerParameter2Split, parts));
|
|
||||||
// We don't need to save the file. This will happen anyway in PointOfInterest.writePoisToFile() below.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(Action oneAction : oneRule.getActionSet())
|
for(Action oneAction : oneRule.getActionSet())
|
||||||
{
|
{
|
||||||
if(oneAction.getAction() == Action_Enum.changeSoundProfile)
|
if(oneAction.getAction() == Action_Enum.changeSoundProfile)
|
||||||
@ -432,49 +423,18 @@ public class Profile implements Comparable<Profile>
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rule isInUseByRules()
|
public boolean delete()
|
||||||
{
|
{
|
||||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.profileActive))
|
for(int i = 0; i< Profile.getProfileCollection().size(); i++)
|
||||||
{
|
{
|
||||||
for (Rule rule : Rule.findRuleCandidatesByTriggerProfile(this))
|
if(Profile.getProfileCollection().get(i).getName().equals(this.getName()))
|
||||||
{
|
{
|
||||||
return rule;
|
Profile.getProfileCollection().remove(0);
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(Rule.isAnyRuleUsing(Action_Enum.changeSoundProfile))
|
|
||||||
{
|
|
||||||
for (Rule rule : Rule.findRuleCandidatesByActionProfile(this))
|
|
||||||
{
|
|
||||||
return rule;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
// write to file
|
||||||
}
|
|
||||||
|
|
||||||
public boolean delete(Context context)
|
|
||||||
{
|
|
||||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.profileActive))
|
|
||||||
{
|
|
||||||
for (Rule rule : Rule.findRuleCandidatesByTriggerProfile(this))
|
|
||||||
{
|
|
||||||
Toast.makeText(context, String.format(context.getResources().getString(R.string.ruleXIsUsingProfileY), rule.getName(), this.getName()), Toast.LENGTH_LONG).show();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(Rule.isAnyRuleUsing(Action_Enum.changeSoundProfile))
|
|
||||||
{
|
|
||||||
for (Rule rule : Rule.findRuleCandidatesByActionProfile(this))
|
|
||||||
{
|
|
||||||
Toast.makeText(context, String.format(context.getResources().getString(R.string.ruleXIsUsingProfileY), rule.getName(), this.getName()), Toast.LENGTH_LONG).show();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
profileCollection.remove(this);
|
|
||||||
return XmlFileInterface.writeFile();
|
return XmlFileInterface.writeFile();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -503,8 +463,6 @@ public class Profile implements Comparable<Profile>
|
|||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "Profile " + this.getName(), String.format(context.getResources().getString(R.string.profileActivate), this.getName()), 3);
|
Miscellaneous.logEvent("i", "Profile " + this.getName(), String.format(context.getResources().getString(R.string.profileActivate), this.getName()), 3);
|
||||||
|
|
||||||
profileActivationHistory.add(this);
|
|
||||||
|
|
||||||
AutomationService.getInstance().checkLockSoundChangesTimeElapsed();
|
AutomationService.getInstance().checkLockSoundChangesTimeElapsed();
|
||||||
|
|
||||||
if(AutomationService.getInstance().getLockSoundChangesEnd() == null)
|
if(AutomationService.getInstance().getLockSoundChangesEnd() == null)
|
||||||
@ -576,20 +534,6 @@ public class Profile implements Comparable<Profile>
|
|||||||
{
|
{
|
||||||
Miscellaneous.logEvent("e", "Profile " + this.getName(), context.getResources().getString(R.string.errorActivatingProfile) + " " + Log.getStackTraceString(e), 1);
|
Miscellaneous.logEvent("e", "Profile " + this.getName(), context.getResources().getString(R.string.errorActivatingProfile) + " " + Log.getStackTraceString(e), 1);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
Miscellaneous.logEvent("i", "POI", "Checking for applicable rule after profile " + this.getName() + " has been activated.", 2);
|
|
||||||
List<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger.Trigger_Enum.profileActive);
|
|
||||||
for(int i=0; i<ruleCandidates.size(); i++)
|
|
||||||
{
|
|
||||||
if(ruleCandidates.get(i).haveEnoughPermissions() && ruleCandidates.get(i).getsGreenLight(AutomationService.getInstance()))
|
|
||||||
{
|
|
||||||
Miscellaneous.logEvent("i", "POI", "Rule " + ruleCandidates.get(i).getName() + " applies after " + this.getName() + " has been activated.", 2);
|
|
||||||
ruleCandidates.get(i).activate(AutomationService.getInstance(), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Miscellaneous.logEvent("i", "POI", "Done checking for applicable rule after profile " + this.getName() + " has been activated.", 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -597,104 +541,6 @@ public class Profile implements Comparable<Profile>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean areMySettingsCurrentlyActive(Context context)
|
|
||||||
{
|
|
||||||
Miscellaneous.logEvent("i", "Profile " + this.getName(), "Checking if profile's settings are currently active.", 3);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
AudioManager am = (AudioManager) Miscellaneous.getAnyContext().getSystemService(Context.AUDIO_SERVICE);
|
|
||||||
NotificationManager mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
|
||||||
|
|
||||||
if(changeSoundMode)
|
|
||||||
{
|
|
||||||
if(am.getRingerMode() != soundMode)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(changeDndMode && Build.VERSION.SDK_INT >= 23)
|
|
||||||
{
|
|
||||||
if(mNotificationManager.getCurrentInterruptionFilter() != dndMode)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(changeVolumeMusicVideoGameMedia)
|
|
||||||
{
|
|
||||||
if(am.getStreamVolume(AudioManager.STREAM_MUSIC) != volumeMusic)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(changeVolumeNotifications)
|
|
||||||
{
|
|
||||||
if(am.getStreamVolume(AudioManager.STREAM_NOTIFICATION) != volumeNotifications)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(changeVolumeAlarms)
|
|
||||||
{
|
|
||||||
if(am.getStreamVolume(AudioManager.STREAM_ALARM) != volumeAlarms)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if(changeIncomingCallsRingtone)
|
|
||||||
// {
|
|
||||||
// if (incomingCallsRingtone != null)
|
|
||||||
// {
|
|
||||||
// applyRingTone(incomingCallsRingtone, RingtoneManager.TYPE_RINGTONE, context);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if(changeVibrateWhenRinging)
|
|
||||||
{
|
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
{
|
|
||||||
int currentSetting = android.provider.Settings.System.getInt(context.getContentResolver(), "vibrate_when_ringing");
|
|
||||||
if(currentSetting != Miscellaneous.boolToInt(vibrateWhenRinging))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int currentSetting = am.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER);
|
|
||||||
if(currentSetting != Miscellaneous.boolToInt(vibrateWhenRinging))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if(changeNotificationRingtone)
|
|
||||||
// if(notificationRingtone != null)
|
|
||||||
// applyRingTone(notificationRingtone, RingtoneManager.TYPE_NOTIFICATION, context);
|
|
||||||
|
|
||||||
if(changeScreenLockUnlockSound)
|
|
||||||
{
|
|
||||||
int currentSetting = android.provider.Settings.System.getInt(context.getContentResolver(), "lockscreen_sounds_enabled");
|
|
||||||
if(currentSetting != Miscellaneous.boolToInt(screenLockUnlockSound))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(changeAudibleSelection)
|
|
||||||
{
|
|
||||||
int currentSetting = android.provider.Settings.System.getInt(context.getContentResolver(), android.provider.Settings.System.SOUND_EFFECTS_ENABLED);
|
|
||||||
if(currentSetting != Miscellaneous.boolToInt(audibleSelection))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(changeHapticFeedback)
|
|
||||||
{
|
|
||||||
int currentSetting = android.provider.Settings.System.getInt(context.getContentResolver(), android.provider.Settings.System.HAPTIC_FEEDBACK_ENABLED);
|
|
||||||
if(currentSetting != Miscellaneous.boolToInt(hapticFeedback))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
Miscellaneous.logEvent("e", "Profile " + this.getName(), "Error while checking if profile settings are currently active. " + Log.getStackTraceString(e), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Miscellaneous.logEvent("i", "Profile " + this.getName(), "This profile's settings are currently active.", 4);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -117,10 +117,6 @@ public class Trigger
|
|||||||
if(!getParentRule().checkActivityDetection(this))
|
if(!getParentRule().checkActivityDetection(this))
|
||||||
result = false;
|
result = false;
|
||||||
break;
|
break;
|
||||||
case profileActive:
|
|
||||||
if(!checkProfileActive())
|
|
||||||
result = false;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -277,43 +273,6 @@ public class Trigger
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean checkProfileActive()
|
|
||||||
{
|
|
||||||
String demandedProfileName = getTriggerParameter2().split(Trigger.triggerParameter2Split)[0];
|
|
||||||
boolean checkSettings = Boolean.parseBoolean(getTriggerParameter2().split(Trigger.triggerParameter2Split)[1]);
|
|
||||||
|
|
||||||
if(checkSettings)
|
|
||||||
{
|
|
||||||
Profile profile = Profile.getByName(demandedProfileName);
|
|
||||||
return profile.areMySettingsCurrentlyActive(Miscellaneous.getAnyContext());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Profile lastProfile = null;
|
|
||||||
|
|
||||||
if (Profile.profileActivationHistory.size() > 0)
|
|
||||||
{
|
|
||||||
lastProfile = Profile.profileActivationHistory.get(Profile.profileActivationHistory.size() - 1);
|
|
||||||
|
|
||||||
if (getTriggerParameter())
|
|
||||||
return demandedProfileName.equals(lastProfile.getName());
|
|
||||||
else
|
|
||||||
return !demandedProfileName.equals(lastProfile.getName());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return !getTriggerParameter();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Miscellaneous.logEvent("w", "Trigger", "Error checking profile trigger.", 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean checkDeviceOrientation()
|
boolean checkDeviceOrientation()
|
||||||
{
|
{
|
||||||
String deviceOrientationPieces[] = getTriggerParameter2().split(Trigger.triggerParameter2Split);
|
String deviceOrientationPieces[] = getTriggerParameter2().split(Trigger.triggerParameter2Split);
|
||||||
@ -329,7 +288,13 @@ public class Trigger
|
|||||||
|
|
||||||
if(desiredAzimuthTolerance < 180)
|
if(desiredAzimuthTolerance < 180)
|
||||||
{
|
{
|
||||||
if (!(desiredAzimuth - desiredAzimuthTolerance <= currentAzimuth && currentAzimuth <= desiredAzimuth + desiredAzimuthTolerance))
|
if (
|
||||||
|
!(
|
||||||
|
Math.abs(currentAzimuth) <= Math.abs(desiredAzimuth - desiredAzimuthTolerance)
|
||||||
|
||
|
||||||
|
Math.abs(currentAzimuth) <= desiredAzimuth + desiredAzimuthTolerance
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "DeviceOrientation", "Azimuth outside of tolerance area.", 5);
|
Miscellaneous.logEvent("i", "DeviceOrientation", "Azimuth outside of tolerance area.", 5);
|
||||||
if (getTriggerParameter())
|
if (getTriggerParameter())
|
||||||
@ -341,7 +306,15 @@ public class Trigger
|
|||||||
|
|
||||||
if(desiredPitchTolerance < 180)
|
if(desiredPitchTolerance < 180)
|
||||||
{
|
{
|
||||||
if (!(desiredPitch - desiredPitchTolerance <= currentPitch && currentPitch <= desiredPitch + desiredPitchTolerance))
|
if (
|
||||||
|
!(
|
||||||
|
(
|
||||||
|
Math.abs(currentPitch) <= Math.abs(desiredPitch - desiredPitchTolerance)
|
||||||
|
||
|
||||||
|
Math.abs(currentPitch) <= desiredPitch + desiredPitchTolerance
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "DeviceOrientation", "Pitch outside of tolerance area.", 5);
|
Miscellaneous.logEvent("i", "DeviceOrientation", "Pitch outside of tolerance area.", 5);
|
||||||
if (getTriggerParameter())
|
if (getTriggerParameter())
|
||||||
@ -353,7 +326,15 @@ public class Trigger
|
|||||||
|
|
||||||
if(desiredRollTolerance < 180)
|
if(desiredRollTolerance < 180)
|
||||||
{
|
{
|
||||||
if (!(desiredRoll - desiredRollTolerance <= currentRoll && currentRoll <= desiredRoll + desiredRollTolerance))
|
if (
|
||||||
|
!(
|
||||||
|
(
|
||||||
|
Math.abs(currentRoll) <= Math.abs(desiredRoll - desiredRollTolerance)
|
||||||
|
||
|
||||||
|
Math.abs(currentRoll) <= desiredRoll + desiredRollTolerance
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "DeviceOrientation", "Roll outside of tolerance area.", 5);
|
Miscellaneous.logEvent("i", "DeviceOrientation", "Roll outside of tolerance area.", 5);
|
||||||
if (getTriggerParameter())
|
if (getTriggerParameter())
|
||||||
@ -1005,7 +986,7 @@ public class Trigger
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public enum Trigger_Enum {
|
public enum Trigger_Enum {
|
||||||
pointOfInterest, timeFrame, charging, batteryLevel, usb_host_connection, speed, noiseLevel, wifiConnection, process_started_stopped, airplaneMode, roaming, nfcTag, activityDetection, bluetoothConnection, headsetPlugged, notification, deviceOrientation, profileActive, phoneCall; //phoneCall always needs to be at the very end because of Google's shitty so called privacy
|
pointOfInterest, timeFrame, charging, batteryLevel, usb_host_connection, speed, noiseLevel, wifiConnection, process_started_stopped, airplaneMode, roaming, nfcTag, activityDetection, bluetoothConnection, headsetPlugged, notification, deviceOrientation, phoneCall; //phoneCall always needs to be at the very end because of Google's shitty so called privacy
|
||||||
|
|
||||||
public String getFullName(Context context)
|
public String getFullName(Context context)
|
||||||
{
|
{
|
||||||
@ -1047,8 +1028,6 @@ public class Trigger
|
|||||||
return context.getResources().getString(R.string.notification);
|
return context.getResources().getString(R.string.notification);
|
||||||
case deviceOrientation:
|
case deviceOrientation:
|
||||||
return context.getResources().getString(R.string.deviceOrientation);
|
return context.getResources().getString(R.string.deviceOrientation);
|
||||||
case profileActive:
|
|
||||||
return context.getResources().getString(R.string.profile);
|
|
||||||
default:
|
default:
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
@ -1282,11 +1261,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 = ", " + Miscellaneous.getAnyContext().getResources().getString(R.string.noRepetition);
|
String repeat = ", no repetition";
|
||||||
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() + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.onDays) + " " + 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() + " on days " + this.getTimeFrame().getDayList().toString() + repeat);
|
||||||
break;
|
break;
|
||||||
case speed:
|
case speed:
|
||||||
if(getTriggerParameter())
|
if(getTriggerParameter())
|
||||||
@ -1331,11 +1310,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:
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.roaming));
|
|
||||||
if(getTriggerParameter())
|
if(getTriggerParameter())
|
||||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.activated));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.activated) + " ");
|
||||||
else
|
else
|
||||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.deactivated));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.deactivated) + " ");
|
||||||
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.roaming));
|
||||||
break;
|
break;
|
||||||
case phoneCall:
|
case phoneCall:
|
||||||
String[] elements = triggerParameter2.split(triggerParameter2Split);
|
String[] elements = triggerParameter2.split(triggerParameter2Split);
|
||||||
@ -1367,9 +1346,24 @@ 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:
|
||||||
@ -1379,7 +1373,21 @@ public class Trigger
|
|||||||
if (ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), "com.google.android.gms.permission.ACTIVITY_RECOGNITION"))
|
if (ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), "com.google.android.gms.permission.ACTIVITY_RECOGNITION"))
|
||||||
{
|
{
|
||||||
// This type doesn't have an activate/deactivate equivalent, at least not yet.
|
// This type doesn't have an activate/deactivate equivalent, at least not yet.
|
||||||
|
// try
|
||||||
|
// {
|
||||||
returnString.append(Miscellaneous.runMethodReflective(ActivityManageRule.activityDetectionClassPath, "getDescription", new Object[]{getActivityDetectionType()}));
|
returnString.append(Miscellaneous.runMethodReflective(ActivityManageRule.activityDetectionClassPath, "getDescription", new Object[]{getActivityDetectionType()}));
|
||||||
|
// for(Method method : activityDetection.getMethods())
|
||||||
|
// {
|
||||||
|
// if(method.getName().equalsIgnoreCase("getDescription"))
|
||||||
|
// returnString.append(method.invoke());
|
||||||
|
//// returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.detectedActivity) + " " + activityDetection.getDescription(getActivityDetectionType()));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch (ClassNotFoundException | IllegalAccessException | InvocationTargetException e)
|
||||||
|
// {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.featureNotInFdroidVersion));
|
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.featureNotInFdroidVersion));
|
||||||
@ -1441,7 +1449,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 = Miscellaneous.getAnyContext().getResources().getString(R.string.notSet);
|
type = "not set";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(getTriggerParameter())
|
if(getTriggerParameter())
|
||||||
@ -1492,12 +1500,6 @@ public class Trigger
|
|||||||
case deviceOrientation:
|
case deviceOrientation:
|
||||||
returnString.append(Miscellaneous.getAnyContext().getString(R.string.deviceIsInCertainOrientation));
|
returnString.append(Miscellaneous.getAnyContext().getString(R.string.deviceIsInCertainOrientation));
|
||||||
break;
|
break;
|
||||||
case profileActive:
|
|
||||||
if(triggerParameter)
|
|
||||||
returnString.append(String.format(Miscellaneous.getAnyContext().getString(R.string.profileActive), getTriggerParameter2().split(Trigger.triggerParameter2Split)[0]));
|
|
||||||
else
|
|
||||||
returnString.append(String.format(Miscellaneous.getAnyContext().getString(R.string.profileNotActive), getTriggerParameter2().split(Trigger.triggerParameter2Split)[0]));
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
returnString.append("error");
|
returnString.append("error");
|
||||||
break;
|
break;
|
||||||
|
@ -14,6 +14,14 @@ public class PackageReplacedReceiver extends BroadcastReceiver
|
|||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent)
|
public void onReceive(Context context, Intent intent)
|
||||||
{
|
{
|
||||||
|
// Toast.makeText(context, "package replaced", Toast.LENGTH_LONG).show();
|
||||||
|
// int intentUid = intent.getExtras().getInt("android.intent.extra.UID"); // userid of the application that has just been updated
|
||||||
|
// int myUid = android.os.Process.myUid(); // userid of this application
|
||||||
|
//
|
||||||
|
// boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false);
|
||||||
|
|
||||||
|
// if(intentUid == myUid)
|
||||||
|
// {
|
||||||
Settings.readFromPersistentStorage(context);
|
Settings.readFromPersistentStorage(context);
|
||||||
|
|
||||||
Miscellaneous.logEvent("i", context.getResources().getString(R.string.applicationHasBeenUpdated), context.getResources().getString(R.string.applicationHasBeenUpdated), 2);
|
Miscellaneous.logEvent("i", context.getResources().getString(R.string.applicationHasBeenUpdated), context.getResources().getString(R.string.applicationHasBeenUpdated), 2);
|
||||||
@ -26,6 +34,9 @@ public class PackageReplacedReceiver extends BroadcastReceiver
|
|||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "Service", context.getResources().getString(R.string.logNotStartingServiceAfterAppUpdate), 2);
|
Miscellaneous.logEvent("i", "Service", context.getResources().getString(R.string.logNotStartingServiceAfterAppUpdate), 2);
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// Miscellaneous.logEvent("i", "Service", "Some other app has been updated.", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean hasServiceBeenRunning()
|
private static boolean hasServiceBeenRunning()
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB |
@ -22,14 +22,7 @@
|
|||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" >
|
||||||
android:gravity="center_vertical" >
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_marginRight="@dimen/default_margin"
|
|
||||||
android:src="@drawable/arrow_azimuth"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/orientationAzimuth"
|
android:text="@string/orientationAzimuth"
|
||||||
@ -46,14 +39,7 @@
|
|||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" >
|
||||||
android:gravity="center_vertical" >
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_marginRight="@dimen/default_margin"
|
|
||||||
android:src="@drawable/arrow_pitch"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/orientationPitch"
|
android:text="@string/orientationPitch"
|
||||||
@ -70,14 +56,7 @@
|
|||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" >
|
||||||
android:gravity="center_vertical" >
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_marginRight="@dimen/default_margin"
|
|
||||||
android:src="@drawable/arrow_roll"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/orientationRoll"
|
android:text="@string/orientationRoll"
|
||||||
|
@ -1,100 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_margin="@dimen/default_margin"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TableLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:shrinkColumns="1"
|
|
||||||
android:stretchColumns="1" >
|
|
||||||
|
|
||||||
<TableRow>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:text="@string/profile"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/spinnerProfiles"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</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>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:text="@string/needsToBeActive"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/chkProfileActive"
|
|
||||||
android:checked="true"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</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>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:text="@string/checkSettings"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/chkProfileCheckSettings"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_span="2"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/profileTriggerCheckSettings" />
|
|
||||||
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
</TableLayout>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/bSaveTriggerProfile"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
|
||||||
android:text="@string/save" />
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
|
@ -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 (Art: %1$s) verbunden</string>
|
<string name="headsetConnected">Headset (type: %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>
|
||||||
@ -630,7 +630,7 @@
|
|||||||
<string name="deviceOrientationTimeAcceptIntervalTitle">Signal Häufigkeit</string>
|
<string name="deviceOrientationTimeAcceptIntervalTitle">Signal Häufigkeit</string>
|
||||||
<string name="deviceOrientationTimeAcceptIntervalSummary">Neue Signale nur alle x Millisekunden akzeptieren</string>
|
<string name="deviceOrientationTimeAcceptIntervalSummary">Neue Signale nur alle x Millisekunden akzeptieren</string>
|
||||||
<string name="deviceOrientationSettings">Geräteausrichtungseinstellungen</string>
|
<string name="deviceOrientationSettings">Geräteausrichtungseinstellungen</string>
|
||||||
<string name="explanationDeviceOrientationDirection">Wenn das Häkchen gesetzt ist, bedeutet das, daß das Gerät in der angegebenen Ausrichtung sein muß. Wenn es nicht gesetzt ist, führt jede andere Ausrichtung zu einem positiven Ergebnis.</string>
|
<string name="explanationDeviceOrientationDirection">Wenn das Häkchen gesetzt ist, bedeutet das, daß das Geräte in der angegebenen Ausrichtung sein muß. Wenn es nicht gesetzt ist, führt jede andere Ausrichtung zu einem positiven Ergebnis.</string>
|
||||||
<string name="deviceOrientationExplanation">Wenn Sie Ihr Gerät bewegen, werden die Zahlen unten aktualisiert. Was Sie hier sehen können, ist die momentane Ausrichtung Ihres Geräts, gemessen in Grad. Wenn das Gerät in der gewünschten Ausrichtung ist, klicken Sie den \"übernehmen\" Knopf, um die Werte in die \"gewünscht\" Felder zu übertragen.\nWeil es sehr unwahrscheinlich ist, daß Sie diese exakte Ausrichtung jemals wieder erreichen, müssen Sie Toleranzen eingeben. Dies ist der Winkel in Grad, der in jede Richtung noch akzeptiert wird. 15° entsprechen somit einem Gesamtwinkel von 30°, 15 in jede Richtung.\nWenn Ihnen nur eine bestimmte Achse wichtig ist, können Sie eine Toleranz von 180° für die anderen beiden Richtungen angeben.</string>
|
<string name="deviceOrientationExplanation">Wenn Sie Ihr Gerät bewegen, werden die Zahlen unten aktualisiert. Was Sie hier sehen können, ist die momentane Ausrichtung Ihres Geräts, gemessen in Grad. Wenn das Gerät in der gewünschten Ausrichtung ist, klicken Sie den \"übernehmen\" Knopf, um die Werte in die \"gewünscht\" Felder zu übertragen.\nWeil es sehr unwahrscheinlich ist, daß Sie diese exakte Ausrichtung jemals wieder erreichen, müssen Sie Toleranzen eingeben. Dies ist der Winkel in Grad, der in jede Richtung noch akzeptiert wird. 15° entsprechen somit einem Gesamtwinkel von 30°, 15 in jede Richtung.\nWenn Ihnen nur eine bestimmte Achse wichtig ist, können Sie eine Toleranz von 180° für die anderen beiden Richtungen angeben.</string>
|
||||||
<string name="actionSetBluetoothTethering">Bluetooth Tethering</string>
|
<string name="actionSetBluetoothTethering">Bluetooth Tethering</string>
|
||||||
<string name="actionTurnBluetoothTetheringOn">Bluetooth Tethering einschalten</string>
|
<string name="actionTurnBluetoothTetheringOn">Bluetooth Tethering einschalten</string>
|
||||||
@ -640,23 +640,4 @@
|
|||||||
<string name="triggerWrong">Mit diesem Auslöser stimmt etwas nicht. Er konnte nicht korrekt geladen werden.</string>
|
<string name="triggerWrong">Mit diesem Auslöser stimmt etwas nicht. Er konnte nicht korrekt geladen werden.</string>
|
||||||
<string name="android.permission.BIND_DEVICE_ADMIN">Geräte Administrator</string>
|
<string name="android.permission.BIND_DEVICE_ADMIN">Geräte Administrator</string>
|
||||||
<string name="deviceAdminNote">Geräte Administrator Rechte werden für mindestens 1 Regel benötigt, die Sie angelegt haben.</string>
|
<string name="deviceAdminNote">Geräte Administrator Rechte werden für mindestens 1 Regel benötigt, die Sie angelegt haben.</string>
|
||||||
<string name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS">Von der Akku-Optimierung ausschließen</string>
|
|
||||||
<string name="recommendedForBetterReliability">Empfohlen für bessere Zuverlässigkeit</string>
|
|
||||||
<string name="needsToBeActive">Muß aktiv sein</string>
|
|
||||||
<string name="checkSettings">Einstellungen überprüfen</string>
|
|
||||||
<string name="profileActive">Profil %1$s ist aktiv</string>
|
|
||||||
<string name="profileNotActive">Profil %1$s ist nicht aktiv</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="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>
|
|
||||||
<string name="takeLauncherActivity">Automatisch auswählen</string>
|
|
||||||
<string name="pickActivityManually">Manuell auswählen</string>
|
|
||||||
<string name="launcherOrManualExplanation">Einfacher Modus: Automation kann versuchen, die Start-Activity des Zielprogramms automatisch zu finden.\nAlternativ können Sie die gewünschte Activity auch manuell auswählen.\nWelche Variante möchten Sie?</string>
|
|
||||||
<string name="launcherNotFound">Eine Start-Activity dieser Anwendung konnte nicht gefunden werden. Sie müssen manuell eine auswählen.</string>
|
|
||||||
</resources>
|
</resources>
|
@ -639,23 +639,4 @@
|
|||||||
<string name="wifiApi30">Porque Google arruinó otra parte de Android, a partir de API 30 solo se puede mostrar los wifi actualmente visibles, ya no todos que su positivo tiene conectados.</string>
|
<string name="wifiApi30">Porque Google arruinó otra parte de Android, a partir de API 30 solo se puede mostrar los wifi actualmente visibles, ya no todos que su positivo tiene conectados.</string>
|
||||||
<string name="smsDialogNotice">Si no ha utilizado una acción de envío de sms en este programa antes, Android puede mostrar un diálogo de confirmación adicional, pidiéndole que permita el envío de mensajes. Debe seleccionar la casilla de verificación \"permitir siempre\" y confirmar si desea que esta acción funcione en segundo plano. Se recomienda ejecutar esta regla manualmente una vez para provocar este diálogo de confirmación.</string>
|
<string name="smsDialogNotice">Si no ha utilizado una acción de envío de sms en este programa antes, Android puede mostrar un diálogo de confirmación adicional, pidiéndole que permita el envío de mensajes. Debe seleccionar la casilla de verificación \"permitir siempre\" y confirmar si desea que esta acción funcione en segundo plano. Se recomienda ejecutar esta regla manualmente una vez para provocar este diálogo de confirmación.</string>
|
||||||
<string name="deviceOrientationExplanation">Cuando mueva su dispositivo, los siguientes números se actualizarán. Lo que puede ver allí, es la orientación actual de su dispositivo medida en grados. Si está en la orientación deseada, haga clic en el botón Aplicar para copiar los valores actuales en los campos deseados. Debido a que alcanzar esta orientación exacta nunca más es muy poco probable, también deba ingresar a una tolerancia. Esta es la cantidad de grados a los que la orientación puede desviarse en cualquier dirección. 15° resultará en un ángulo total de 30°, 15° en todas las direcciones. Si solo le importa un eje específico, especifique una tolerancia de 180° para los otros dos.</string>
|
<string name="deviceOrientationExplanation">Cuando mueva su dispositivo, los siguientes números se actualizarán. Lo que puede ver allí, es la orientación actual de su dispositivo medida en grados. Si está en la orientación deseada, haga clic en el botón Aplicar para copiar los valores actuales en los campos deseados. Debido a que alcanzar esta orientación exacta nunca más es muy poco probable, también deba ingresar a una tolerancia. Esta es la cantidad de grados a los que la orientación puede desviarse en cualquier dirección. 15° resultará en un ángulo total de 30°, 15° en todas las direcciones. Si solo le importa un eje específico, especifique una tolerancia de 180° para los otros dos.</string>
|
||||||
<string name="profileNotActive">el perfil %1$s no está activo</string>
|
|
||||||
<string name="profileActive">el perfil %1$s está activo</string>
|
|
||||||
<string name="checkSettings">Comprobar la configuración</string>
|
|
||||||
<string name="needsToBeActive">Necesita estar activo</string>
|
|
||||||
<string name="recommendedForBetterReliability">Recomendado para una mejor fiabilidad</string>
|
|
||||||
<string name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS">Excluir de la optimización de la baterí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="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>
|
|
||||||
<string name="takeLauncherActivity">Buscar automaticamente</string>
|
|
||||||
<string name="pickActivityManually">Eligir manualmente</string>
|
|
||||||
<string name="launcherOrManualExplanation">Modo facil: Automation puede probar identifcar el launcher activity del programa automaticamente.\nAlternativamente puede eligir una de las activities del programa manualmente.\nCual variante queria?</string>
|
|
||||||
<string name="launcherNotFound">No se puede encontrar una launcher activity. Tiene que elegir una manualmente.</string>
|
|
||||||
</resources>
|
</resources>
|
@ -640,23 +640,4 @@
|
|||||||
<string name="deviceOrientationSettings">Impostazioni di orientamento del dispositivo</string>
|
<string name="deviceOrientationSettings">Impostazioni di orientamento del dispositivo</string>
|
||||||
<string name="android.permission.BIND_DEVICE_ADMIN">Amministrazione dispositivo</string>
|
<string name="android.permission.BIND_DEVICE_ADMIN">Amministrazione dispositivo</string>
|
||||||
<string name="deviceAdminNote">I permessi di amministratore del dispositivo sono necessari per almeno 1 delle regole che hai creato.</string>
|
<string name="deviceAdminNote">I permessi di amministratore del dispositivo sono necessari per almeno 1 delle regole che hai creato.</string>
|
||||||
<string name="profileTriggerCheckSettings">Se questa casella di controllo non è disabilitata, verrà selezionata solo se il profilo selezionato è stato l\'ultimo ad essere attivato. Non importa se le impostazioni relative all\'audio sono state modificate esternamente.\nTuttavia, se la casella di controllo è abilitata, le impostazioni audio correnti devono essere definite nel profilo. ATTENZIONE: il controllo del file della suoneria non è ancora supportato.</string>
|
|
||||||
<string name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS">Escludere dall\'ottimizzazione della batteria</string>
|
|
||||||
<string name="recommendedForBetterReliability">Consigliato per una migliore affidabilità</string>
|
|
||||||
<string name="needsToBeActive">Deve essere attivo</string>
|
|
||||||
<string name="checkSettings">Controlla le impostazioni</string>
|
|
||||||
<string name="profileActive">profilo %1$s è 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="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>
|
|
||||||
<string name="takeLauncherActivity">Trova automaticamente</string>
|
|
||||||
<string name="pickActivityManually">Scegli manualmente</string>
|
|
||||||
<string name="launcherOrManualExplanation">Modalità semplice: l\'automazione può provare a identificare l\'attività di avvio del programma desiderato.\nIn alternativa puoi anche scegliere manualmente una delle attività dell\'applicazione.\nCosa vorresti?</string>
|
|
||||||
<string name="launcherNotFound">Impossibile identificare un\'attività di avvio di questa app. Dovrai sceglierne uno manualmente.</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -638,23 +638,4 @@
|
|||||||
<string name="btTetheringNotice">Deze functie werkt naar verluidt tot Android 8.0. Vanaf een hogere versie werkt het niet meer, maar door een gebrek aan fysieke apparaten kan ik niet zeggen welke dat is. Op Android 11 werkt het absoluut niet meer. Als je een versie tussendoor hebt, laat het me dan weten of het werkt of niet.</string>
|
<string name="btTetheringNotice">Deze functie werkt naar verluidt tot Android 8.0. Vanaf een hogere versie werkt het niet meer, maar door een gebrek aan fysieke apparaten kan ik niet zeggen welke dat is. Op Android 11 werkt het absoluut niet meer. Als je een versie tussendoor hebt, laat het me dan weten of het werkt of niet.</string>
|
||||||
<string name="deviceOrientationExplanation">Wanneer u uw apparaat verplaatst, worden de onderstaande nummers bijgewerkt. Wat je daar kunt zien, is de huidige oriëntatie van je apparaat gemeten in graden. Als het zich in de gewenste richting bevindt, klikt u op de knop Toepassen om de huidige waarden naar de gewenste velden te kopiëren.\nOmdat het zeer onwaarschijnlijk is dat u deze exacte oriëntatie ooit nog bereikt, moet u ook een tolerantie invoeren. Dit is het aantal graden waarin de oriëntatie in beide richtingen kan afwijken. 15° resulteert in een totale hoek van 30°, 15° in elke richting.\nAls u slechts om één specifieke as geeft, geef dan een tolerantie van 180° op voor de twee andere.</string>
|
<string name="deviceOrientationExplanation">Wanneer u uw apparaat verplaatst, worden de onderstaande nummers bijgewerkt. Wat je daar kunt zien, is de huidige oriëntatie van je apparaat gemeten in graden. Als het zich in de gewenste richting bevindt, klikt u op de knop Toepassen om de huidige waarden naar de gewenste velden te kopiëren.\nOmdat het zeer onwaarschijnlijk is dat u deze exacte oriëntatie ooit nog bereikt, moet u ook een tolerantie invoeren. Dit is het aantal graden waarin de oriëntatie in beide richtingen kan afwijken. 15° resulteert in een totale hoek van 30°, 15° in elke richting.\nAls u slechts om één specifieke as geeft, geef dan een tolerantie van 180° op voor de twee andere.</string>
|
||||||
<string name="toleranceOf180OnlyAllowedIn2Fields">Een tolerantie van 180 is alleen toegestaan voor 2 tolerantievelden, niet alle 3. Anders zou de trigger ALTIJD van toepassing zijn.</string>
|
<string name="toleranceOf180OnlyAllowedIn2Fields">Een tolerantie van 180 is alleen toegestaan voor 2 tolerantievelden, niet alle 3. Anders zou de trigger ALTIJD van toepassing zijn.</string>
|
||||||
<string name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS">Uitsluiten van batterijoptimalisatie</string>
|
|
||||||
<string name="recommendedForBetterReliability">Aanbevolen voor een betere betrouwbaarheid</string>
|
|
||||||
<string name="needsToBeActive">Moet actief zijn</string>
|
|
||||||
<string name="checkSettings">Instellingen controleren</string>
|
|
||||||
<string name="profileActive">profile %1$s is actief</string>
|
|
||||||
<string name="profileNotActive">profile %1$s is niet actief</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="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>
|
|
||||||
<string name="takeLauncherActivity">Automatisch zoeken</string>
|
|
||||||
<string name="pickActivityManually">Handmatig kiezen</string>
|
|
||||||
<string name="launcherNotFound">Een launcher-activiteit van deze app kon niet worden geïdentificeerd. U moet er handmatig een kiezen.</string>
|
|
||||||
<string name="launcherOrManualExplanation">Eenvoudige modus: Automatisering kan proberen de opstartactiviteit van het gewenste programma te identificeren.\nU kunt ook handmatig een van de activiteiten van de toepassing kiezen.\nWat wil je?</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -736,23 +736,4 @@
|
|||||||
<string name="explanationDeviceOrientationDirection">If the checkbox is checked that means the device has to be in the orientation you specify. If it\'s not checked, any orientation that does NOT match your criteria will do.</string>
|
<string name="explanationDeviceOrientationDirection">If the checkbox is checked that means the device has to be in the orientation you specify. If it\'s not checked, any orientation that does NOT match your criteria will do.</string>
|
||||||
<string name="permissionsRequiredNotAvailable">Your rules required permissions which cannot be requested from this installed flavor of Automation.</string>
|
<string name="permissionsRequiredNotAvailable">Your rules required permissions which cannot be requested from this installed flavor of Automation.</string>
|
||||||
<string name="smsDialogNotice">If you have not used a send-sms action in this program before, Android may show an additional confirmation dialog, asking you to allow sending messages. You need to select the \"always allow\" checkbox and confirm if you want this action to work in the background. It\'s advised to run this rule manually once to provoke this confirmation dialog.</string>
|
<string name="smsDialogNotice">If you have not used a send-sms action in this program before, Android may show an additional confirmation dialog, asking you to allow sending messages. You need to select the \"always allow\" checkbox and confirm if you want this action to work in the background. It\'s advised to run this rule manually once to provoke this confirmation dialog.</string>
|
||||||
<string name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS">Exclude from battery optimization</string>
|
|
||||||
<string name="recommendedForBetterReliability">Recommended for better reliability</string>
|
|
||||||
<string name="needsToBeActive">Needs to be active</string>
|
|
||||||
<string name="checkSettings">Check settings</string>
|
|
||||||
<string name="profileActive">profile %1$s is active</string>
|
|
||||||
<string name="profileNotActive">profile %1$s is not active</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="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>
|
|
||||||
<string name="takeLauncherActivity">Find automatically</string>
|
|
||||||
<string name="pickActivityManually">Choose manually</string>
|
|
||||||
<string name="launcherOrManualExplanation">Easy mode: Automation can try to identify the launcher activity of the desired program automatically. Alternatively you can also pick one of the application\'s activities manually. What would you like?</string>
|
|
||||||
<string name="launcherNotFound">A launcher activity of this app could not be identified. You will have to pick one manually.</string>
|
|
||||||
</resources>
|
</resources>
|
@ -1,4 +0,0 @@
|
|||||||
* Neue Berechtigung: Ausschluss von der Batterieoptimierung
|
|
||||||
* Neuer Auslöser: Profile können als Auslöser verwendet werden
|
|
||||||
* Behoben: Fehler im Geräteausrichtungs-Auslöser
|
|
||||||
* Aktion "App starten" etwas vereinfacht
|
|
@ -1,4 +0,0 @@
|
|||||||
* New permission requested: Exclusion from battery optimization
|
|
||||||
* New trigger: Profiles can be used as trigger
|
|
||||||
* Fixed: Bug in orientation trigger
|
|
||||||
* "Start app" action simplified a bit
|
|
@ -1 +0,0 @@
|
|||||||
* New action: Create notification
|
|
@ -1,4 +0,0 @@
|
|||||||
* Nuevo permiso solicitado: Exclusión de la optimización de la batería
|
|
||||||
* Nuevo disparador: los perfiles se pueden utilizar como disparador
|
|
||||||
* Corregido: Error en el disparador de orientación
|
|
||||||
* La acción "Iniciar aplicación" se simplificó un poco
|
|
@ -1,4 +0,0 @@
|
|||||||
* Nuova autorizzazione richiesta: esclusione dall'ottimizzazione della batteria
|
|
||||||
* Nuovo trigger: i profili possono essere utilizzati come trigger
|
|
||||||
* Risolto: Bug nel trigger di orientamento
|
|
||||||
* Azione "Start app" semplificata un po '
|
|
@ -1,4 +0,0 @@
|
|||||||
* Nieuwe toestemming gevraagd: Uitsluiting van batterij optimalisatie
|
|
||||||
* Nieuwe trigger: Profielen kunnen worden gebruikt als trigger
|
|
||||||
* Opgelost: Bug in oriëntatie trigger
|
|
||||||
* "Start app" actie een beetje vereenvoudigd
|
|
Loading…
Reference in New Issue
Block a user