forked from jens/Automation
Compare commits
175 Commits
Author | SHA1 | Date | |
---|---|---|---|
475c1719d7 | |||
baa39c7a77 | |||
e11cc09da2 | |||
eff04037a1 | |||
b73a45f4cd | |||
fad6050c7a | |||
8a00529991 | |||
1d7cf00b94 | |||
d74e2eae68 | |||
4f7c36c4f7 | |||
b0df3efa27 | |||
f99418fda3 | |||
e05a42f5d6 | |||
83a27dcfdb | |||
bdc89a855b | |||
7ce203a679 | |||
57bc666453 | |||
c966981eae | |||
7a05b9a95b | |||
7fdbf74906 | |||
d17e8b70fe | |||
f97bfbb732 | |||
937c6ffe1d | |||
1ecc61452f | |||
19fd2d098b | |||
d07c1a05e4 | |||
f9f9b30116 | |||
d154a3d64f | |||
eeb4f4a39e | |||
53e62068a5 | |||
922807d903 | |||
a7d294c115 | |||
2d2fd901a1 | |||
536a5e22f9 | |||
99faa2f7ef | |||
f3fac2f4e8 | |||
b3b713e454 | |||
b0d509aafe | |||
efb4919a1e | |||
7bc858fee3 | |||
647d5bd511 | |||
f1f3be56cb | |||
5856c93fc8 | |||
8201b1d4e4 | |||
ce9480d188 | |||
a69bbb1e05 | |||
16817e6f53 | |||
26ed906521 | |||
d1ca9ab56b | |||
9c76340f24 | |||
aca5572f40 | |||
944e165dd0 | |||
7f2fc4b5de | |||
cd163afc47 | |||
6179f0e9ae | |||
581cdafb87 | |||
9162bcb451 | |||
5272b56032 | |||
2361c758c9 | |||
f738e02b72 | |||
f5a3636222 | |||
bb1b3b0149 | |||
b35208b7aa | |||
b3ad72cc50 | |||
92e58149a7 | |||
c1809bd23c | |||
88a3ab8241 | |||
00f296d2d1 | |||
e84842361c | |||
efaf0ed270 | |||
7167f0c03d | |||
a9673e65b9 | |||
592abe5b0d | |||
dd7c3cb1d6 | |||
38665ccd92 | |||
c60347b990 | |||
1e7ccf5200 | |||
9b84b8dad7 | |||
a19c84ea51 | |||
3a14a56fd0 | |||
2dfc538343 | |||
67a58077cc | |||
df68f7ca5c | |||
ad18313284 | |||
29a93e0e43 | |||
a5d54c18d8 | |||
62f5ad0005 | |||
4eb7133d9d | |||
343cbba8f8 | |||
51caae0794 | |||
e39a2411ba | |||
98b49036a7 | |||
a7c4cc0965 | |||
5d67452486 | |||
7e12a0f3e5 | |||
5786c1bfd4 | |||
cf500c740e | |||
41efa7c11b | |||
7046cccabe | |||
bdbed3dbef | |||
3f36c4c6b3 | |||
52a10fe626 | |||
9fce7d987e | |||
d5ce04f80b | |||
62c97832a9 | |||
391edc59bf | |||
0d3a13e753 | |||
152b0c3c49 | |||
7ed04c7ae2 | |||
c688a4c460 | |||
5a09962cc9 | |||
0368b2a8c8 | |||
965bf55811 | |||
217f459833 | |||
13fd4c2aae | |||
195a60cfe0 | |||
76563eb89b | |||
4c9e61618b | |||
e719114166 | |||
7733d57435 | |||
481e4d1896 | |||
0bd64e4a53 | |||
5af59e1754 | |||
c569ab798c | |||
4e46878009 | |||
619f348a28 | |||
72ccdd99f9 | |||
c9d7399068 | |||
9bf353ea3a | |||
af90b566c8 | |||
0e51c577d5 | |||
275091f9d7 | |||
bc31c9a4c8 | |||
b02220609b | |||
da244d1bbe | |||
d402986dc3 | |||
85eee6c4da | |||
34883519e4 | |||
92e405d396 | |||
1a8ce579a7 | |||
5899dd86f5 | |||
9387e8bdb2 | |||
5ed024774e | |||
e76f9f69db | |||
0f1a12d28f | |||
abaa961d3a | |||
5f0eab5b30 | |||
92cb71ff2d | |||
71adc83b39 | |||
88f4d65b19 | |||
0c5b4d3874 | |||
d64ea8454e | |||
94f6418076 | |||
83ee19b4fa | |||
5ed6097ed6 | |||
7e9d03104c | |||
2e3e829abb | |||
06080bb456 | |||
a5fd23949d | |||
59c7a2d313 | |||
ec61a3ffa5 | |||
a0c4cb7b6f | |||
22899347a1 | |||
4b84a0c2f5 | |||
724192e80b | |||
e6a7e2c5b5 | |||
e010e3392f | |||
f0853b3a30 | |||
98185a79df | |||
246a02371a | |||
9b8ae2271b | |||
b2cd3cf17c | |||
cf4ec286ae | |||
12f44aca8b | |||
87edd595ba |
2
.gitignore
vendored
2
.gitignore
vendored
@ -145,7 +145,7 @@ fabric.properties
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/androidstudio
|
||||
|
||||
|
||||
output-metadata.json
|
||||
/app/app-release.apk
|
||||
Automation_settings.xml
|
||||
/app/googlePlayFlavor/
|
||||
|
@ -8,11 +8,11 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "com.jens.automation2"
|
||||
minSdkVersion 16
|
||||
compileSdkVersion 29
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion '29.0.2'
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
versionCode 117
|
||||
versionName "1.7.3"
|
||||
versionCode 122
|
||||
versionName "1.7.7"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@ -28,11 +28,6 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
flavorDimensions "version"
|
||||
|
||||
productFlavors
|
||||
@ -57,9 +52,15 @@ android {
|
||||
targetSdkVersion 28
|
||||
}
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
checkReleaseBuilds false
|
||||
}
|
||||
namespace 'com.jens.automation2'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.jetbrains:annotations:15.0'
|
||||
googlePlayFlavorImplementation 'com.google.firebase:firebase-appindexing:20.0.0'
|
||||
googlePlayFlavorImplementation 'com.google.android.gms:play-services-location:18.0.0'
|
||||
|
||||
@ -71,9 +72,9 @@ dependencies {
|
||||
|
||||
//implementation "androidx.security:security-crypto:1.0.0"
|
||||
//implementation "androidx.security:security-identity-credential:1.0.0-alpha02"
|
||||
implementation 'androidx.appcompat:appcompat:1.3.0'
|
||||
implementation 'com.google.android.material:material:1.3.0'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.2'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
testImplementation 'junit:junit:4'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.jens.automation2",
|
||||
"variantName": "googlePlayFlavorRelease",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 117,
|
||||
"versionName": "1.7.3-googlePlay",
|
||||
"outputFile": "app-googlePlayFlavor-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.jens.automation2">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<supports-screens
|
||||
android:anyDensity="true"
|
||||
@ -66,6 +65,7 @@
|
||||
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
|
||||
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.telephony"
|
||||
@ -73,6 +73,12 @@
|
||||
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
|
||||
<uses-permission android:name="android.permission.SEND_SMS"/>
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action
|
||||
android:name="android.intent.action.TTS_SERVICE" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
@ -147,14 +153,24 @@
|
||||
<activity android:name=".ActivityDisplayLongMessage" />
|
||||
<activity android:name=".ActivityManageActionSendTextMessage" />
|
||||
<activity android:name=".ActivityManageActionPlaySound" />
|
||||
<activity android:name=".ActivityManageActionCloseNotification" />
|
||||
<activity android:name=".ActivityManageTriggerProfile" />
|
||||
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
||||
<activity android:name=".ActivityMaintenance" />
|
||||
<activity android:name=".ActivityControlCenter" />
|
||||
<activity android:name=".ActivityManageTriggerPhoneCall" />
|
||||
<activity android:name=".ActivityManageTriggerBroadcast" />
|
||||
<activity android:name=".ActivityManageActionBrightnessSetting" />
|
||||
<activity android:name=".ActivityManageActionCreateNotification" />
|
||||
<activity android:name=".ActivityManageTriggerDeviceOrientation" />
|
||||
<activity android:name=".ActivityHelp" />
|
||||
<activity android:name=".ActivityManageActionVibrate" />
|
||||
<activity android:name=".ActivityManageActionControlMedia" />
|
||||
<activity android:name=".ActivityManageActionSendBroadcast" />
|
||||
<activity android:name=".ActivityManageActionRunExecutable" />
|
||||
<activity android:name=".ActivityManageActionWifi" />
|
||||
<activity android:name=".ActivityManageTriggerTethering" />
|
||||
<activity android:name=".ActivityManageActionWakeLock" />
|
||||
<activity android:name=".ActivityManageTriggerSubSystemState" />
|
||||
<activity
|
||||
android:name=".ActivityMainTabLayout"
|
||||
android:launchMode="singleTask">
|
||||
|
@ -5,12 +5,14 @@ import static com.jens.automation2.Trigger.triggerParameter2Split;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.gms.location.DetectedActivity;
|
||||
import com.jens.automation2.receivers.ActivityDetectionReceiver;
|
||||
import com.jens.automation2.receivers.BroadcastListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@ -20,24 +22,23 @@ import java.util.List;
|
||||
|
||||
public class Rule implements Comparable<Rule>
|
||||
{
|
||||
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||
public static boolean isAnyRuleActive = false;
|
||||
|
||||
private static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||
protected static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||
|
||||
protected static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||
|
||||
public static List<Rule> getRuleRunHistory()
|
||||
{
|
||||
return ruleRunHistory;
|
||||
}
|
||||
|
||||
private ArrayList<Trigger> triggerSet;
|
||||
private ArrayList<Action> actionSet;
|
||||
private String name;
|
||||
private boolean ruleActive = true; // rules can be deactivated, so they won't fire if you don't want them temporarily
|
||||
private boolean ruleToggle = false; // rule will run again and do the opposite of its actions if applicable
|
||||
private Calendar lastExecution;
|
||||
|
||||
private static Date lastActivatedRuleActivationTime;
|
||||
protected ArrayList<Trigger> triggerSet;
|
||||
protected ArrayList<Action> actionSet;
|
||||
protected String name;
|
||||
protected boolean ruleActive = true; // rules can be deactivated, so they won't fire if you don't want them temporarily
|
||||
protected boolean ruleToggle = false; // rule will run again and do the opposite of its actions if applicable
|
||||
protected Calendar lastExecution;
|
||||
|
||||
protected static Date lastActivatedRuleActivationTime;
|
||||
|
||||
public Calendar getLastExecution()
|
||||
{
|
||||
@ -185,6 +186,7 @@ public class Rule implements Comparable<Rule>
|
||||
if(this.checkBeforeSaving(context, true))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Rule", "Changing rule: " + this.toString(), 3);
|
||||
|
||||
boolean returnValue = XmlFileInterface.writeFile();
|
||||
|
||||
if(returnValue)
|
||||
@ -233,20 +235,24 @@ public class Rule implements Comparable<Rule>
|
||||
}
|
||||
|
||||
if(!changeExistingRule)
|
||||
for(Rule rule : Rule.ruleCollection)
|
||||
if(rule.getName().equals(this.getName()))
|
||||
{
|
||||
for (Rule rule : Rule.ruleCollection)
|
||||
{
|
||||
if (rule.getName().equals(this.getName()))
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.anotherRuleByThatName), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.getTriggerSet().size()==0)
|
||||
}
|
||||
}
|
||||
|
||||
if(this.getTriggerSet().size() == 0)
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.pleaseSpecifiyTrigger), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.getActionSet().size()==0)
|
||||
if(this.getActionSet().size() == 0)
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.pleaseSpecifiyAction), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
@ -312,19 +318,12 @@ public class Rule implements Comparable<Rule>
|
||||
switch(action.getAction())
|
||||
{
|
||||
case setAirplaneMode:
|
||||
return true;
|
||||
case setBluetooth:
|
||||
return true;
|
||||
case setDataConnection:
|
||||
return true;
|
||||
case setDisplayRotation:
|
||||
return true;
|
||||
case setUsbTethering:
|
||||
return true;
|
||||
case setWifi:
|
||||
return true;
|
||||
case setWifiTethering:
|
||||
return true;
|
||||
case setBluetoothTethering:
|
||||
return true;
|
||||
default:
|
||||
@ -341,6 +340,19 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
|
||||
return true;
|
||||
|
||||
/*
|
||||
Workaround for repetition in TimeFrame triggers
|
||||
*/
|
||||
if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame))
|
||||
{
|
||||
if(oneTrigger.getTimeFrame().repetition > 0)
|
||||
return true;
|
||||
}
|
||||
else if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.broadcastReceived))
|
||||
{
|
||||
return oneTrigger.getTriggerParameter() == BroadcastListener.getInstance().hasBroadcastOccurredSince(oneTrigger.getTriggerParameter2(), getLastExecution());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -351,7 +363,10 @@ public class Rule implements Comparable<Rule>
|
||||
if(applies(context))
|
||||
{
|
||||
if(hasNotAppliedSinceLastExecution())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "getsGreenLight()", "Rule " + getName() + " applies and has flipped since its last execution.", 4);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("i", "getsGreenLight()", "Rule " + getName() + " has not flipped since its last execution.", 4);
|
||||
}
|
||||
@ -376,11 +391,12 @@ public class Rule implements Comparable<Rule>
|
||||
if (!oneTrigger.applies(null, context))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Miscellaneous.logEvent("i", String.format(context.getResources().getString(R.string.ruleCheckOf), this.getName()), String.format("Rule %1$s generally applies currently. Checking if it's really due, yet will be done separately.", this.getName()), 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", String.format(context.getResources().getString(R.string.ruleCheckOf), this.getName()), String.format(context.getResources().getString(R.string.ruleIsDeactivatedCantApply), this.getName()), 3);
|
||||
Miscellaneous.logEvent("i", String.format(context.getResources().getString(R.string.ruleCheckOf), this.getName()), String.format(context.getResources().getString(R.string.ruleIsDeactivatedCantApply), this.getName()), 4);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -433,7 +449,7 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
Thread.setDefaultUncaughtExceptionHandler(Miscellaneous.uncaughtExceptionHandler);
|
||||
|
||||
// without this line debugger will - for some reason - skip all breakpoints in this class
|
||||
// without this line the debugger will - for some reason - skip all breakpoints in this class
|
||||
if(android.os.Debug.isDebuggerConnected())
|
||||
android.os.Debug.waitForDebugger();
|
||||
|
||||
@ -441,7 +457,7 @@ public class Rule implements Comparable<Rule>
|
||||
Looper.prepare();
|
||||
|
||||
setLastExecution(Calendar.getInstance());
|
||||
wasActivated = activateInternally((AutomationService)params[0], (Boolean)params[1]);
|
||||
wasActivated = activateInternally((AutomationService)params[0]);
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -476,66 +492,57 @@ public class Rule implements Comparable<Rule>
|
||||
* Will activate the rule. Should be called by a separate execution thread
|
||||
* @param automationService
|
||||
*/
|
||||
protected boolean activateInternally(AutomationService automationService, boolean force)
|
||||
protected boolean activateInternally(AutomationService automationService)
|
||||
{
|
||||
boolean isActuallyToggable = isActuallyToggable();
|
||||
boolean isActuallyToggleable = isActuallyToggable();
|
||||
|
||||
boolean notLastActive = getLastActivatedRule() == null || !getLastActivatedRule().equals(Rule.this);
|
||||
boolean doToggle = ruleToggle && isActuallyToggable;
|
||||
boolean doToggle = ruleToggle && isActuallyToggleable;
|
||||
|
||||
//if(notLastActive || force || doToggle)
|
||||
// if(force || doToggle)
|
||||
// {
|
||||
String message;
|
||||
if(!doToggle)
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivate), Rule.this.getName());
|
||||
else
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivateToggle), Rule.this.getName());
|
||||
Miscellaneous.logEvent("i", "Rule", message, 2);
|
||||
// automationService.speak(message);
|
||||
// Toast.makeText(automationService, message, Toast.LENGTH_LONG).show();
|
||||
if(Settings.startNewThreadForRuleActivation)
|
||||
publishProgress(message);
|
||||
String message;
|
||||
if(!doToggle)
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivate), Rule.this.getName());
|
||||
else
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivateToggle), Rule.this.getName());
|
||||
|
||||
for(int i = 0; i< Rule.this.getActionSet().size(); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
Rule.this.getActionSet().get(i).run(automationService, doToggle);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "RuleExecution", "Error running action of rule " + Rule.this.getName() + ": " + Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
Miscellaneous.logEvent("i", "Rule", message, 2);
|
||||
|
||||
// Keep log of last x rule activations (Settings)
|
||||
if(Settings.startNewThreadForRuleActivation)
|
||||
publishProgress(message);
|
||||
|
||||
for(int i = 0; i< Rule.this.getActionSet().size(); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
Rule.ruleRunHistory.add(0, Rule.this); // add at beginning for better visualization
|
||||
Rule.lastActivatedRuleActivationTime = new Date();
|
||||
|
||||
while(ruleRunHistory.size() > Settings.rulesThatHaveBeenRanHistorySize)
|
||||
ruleRunHistory.remove(ruleRunHistory.size()-1);
|
||||
String history = "";
|
||||
for(Rule rule : ruleRunHistory)
|
||||
history += rule.getName() + ", ";
|
||||
if(history.length() > 0)
|
||||
history = history.substring(0, history.length()-2);
|
||||
Miscellaneous.logEvent("i", "Rule history", "Most recent first: " + history, 4);
|
||||
Rule.this.getActionSet().get(i).run(automationService, doToggle);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "Rule history error", Log.getStackTraceString(e), 3);
|
||||
Miscellaneous.logEvent("e", "RuleExecution", "Error running action of rule " + Rule.this.getName() + ": " + Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "Rule", String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.ruleActivationComplete), Rule.this.getName()), 2);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Miscellaneous.logEvent("i", "Rule", "Request to activate rule " + Rule.this.getName() + ", but it is the last one that was activated. Won't do it again.", 3);
|
||||
// return false;
|
||||
// }
|
||||
// Keep log of last x rule activations (Settings)
|
||||
try
|
||||
{
|
||||
Rule.ruleRunHistory.add(0, Rule.this); // add at beginning for better visualization
|
||||
Rule.lastActivatedRuleActivationTime = new Date();
|
||||
|
||||
while(ruleRunHistory.size() > Settings.rulesThatHaveBeenRanHistorySize)
|
||||
ruleRunHistory.remove(ruleRunHistory.size()-1);
|
||||
String history = "";
|
||||
for(Rule rule : ruleRunHistory)
|
||||
history += rule.getName() + ", ";
|
||||
if(history.length() > 0)
|
||||
history = history.substring(0, history.length()-2);
|
||||
Miscellaneous.logEvent("i", "Rule history", "Most recent first: " + history, 4);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "Rule history error", Log.getStackTraceString(e), 3);
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "Rule", String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.ruleActivationComplete), Rule.this.getName()), 2);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -544,7 +551,10 @@ public class Rule implements Comparable<Rule>
|
||||
public void activate(AutomationService automationService, boolean force)
|
||||
{
|
||||
ActivateRuleTask task = new ActivateRuleTask();
|
||||
task.execute(automationService, force);
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
||||
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, automationService, force);
|
||||
else
|
||||
task.execute(automationService, force);
|
||||
}
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidates(Trigger.Trigger_Enum triggerType)
|
||||
@ -553,13 +563,33 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
innerLoop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == triggerType)
|
||||
if(oneTrigger.getTriggerType().equals(triggerType))
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; // we don't need to check the other triggers in the same rule
|
||||
break innerLoop; // we don't need to check the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidates(Action.Action_Enum actionType)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Action oneAction : oneRule.getActionSet())
|
||||
{
|
||||
if(oneAction.getAction().equals(actionType))
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; // we don't need to check the other actions in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -608,186 +638,6 @@ public class Rule implements Comparable<Rule>
|
||||
return ruleCandidates;
|
||||
}
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByTimeFrame(TimeFrame searchTimeFrame, boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(int i=0; i<ruleCollection.size(); i++)
|
||||
{
|
||||
innerloop:
|
||||
for(int j=0; j<ruleCollection.get(i).getTriggerSet().size(); j++)
|
||||
{
|
||||
if(ruleCollection.get(i).getTriggerSet().get(j).getTriggerType() == Trigger.Trigger_Enum.timeFrame)
|
||||
{
|
||||
if(ruleCollection.get(i).getTriggerSet().get(j).getTimeFrame().equals(searchTimeFrame) && ruleCollection.get(i).getTriggerSet().get(j).getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(ruleCollection.get(i));
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByTime(Time searchTime)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "Searching for rules with TimeFrame with time " + searchTime.toString() + ". RuleCollection-Size: " + String.valueOf(ruleCollection.size()), 3);;
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.timeFrame)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "Searching interval: " + oneTrigger.getTimeFrame().getTriggerTimeStart().toString() + " to " + oneTrigger.getTimeFrame().getTriggerTimeStop().toString(), 5);
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "interval start: " + String.valueOf(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime()), 5);
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "search time: " + String.valueOf(searchTime.getTime()), 5);
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "interval stop: " + String.valueOf(oneTrigger.getTimeFrame().getTriggerTimeStop().getTime()), 5);
|
||||
|
||||
if(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime() > oneTrigger.getTimeFrame().getTriggerTimeStop().getTime())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Timeframe search", "Rule (" + oneRule.getName() + ") stretches over midnight.", 5);
|
||||
if(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime() <= searchTime.getTime() || searchTime.getTime() <= oneTrigger.getTimeFrame().getTriggerTimeStop().getTime()+20000) //add 20 seconds because of delay
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
else if(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime() <= searchTime.getTime() && searchTime.getTime() <= oneTrigger.getTimeFrame().getTriggerTimeStop().getTime()+20000) //add 20 seconds because of delay
|
||||
{
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "Rule found (" + oneRule.getName() + ") with TimeFrame with time " + searchTime.toString(), 3);
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "RuleSearch", String.valueOf(ruleCandidates.size()) + " Rule(s) found with TimeFrame with time " + searchTime.toString(), 3);
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByCharging(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.charging)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByUsbHost(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.usb_host_connection)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByAirplaneMode(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.airplaneMode)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByRoaming(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.roaming)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByPhoneCall(String direction)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.phoneCall)
|
||||
{
|
||||
String[] elements = oneTrigger.getTriggerParameter2().split(triggerParameter2Split);
|
||||
if(elements[1].equals(Trigger.triggerPhoneCallDirectionAny) || elements[1].equals(direction))
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidatesByPoi(PointOfInterest searchPoi)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
@ -810,29 +660,6 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
return ruleCandidates;
|
||||
}
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByHeadphoneJack(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.headsetPlugged)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidatesByTriggerProfile(Profile profile)
|
||||
{
|
||||
@ -931,4 +758,15 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
return ActivityPermissions.havePermissionsForRule(this, Miscellaneous.getAnyContext());
|
||||
}
|
||||
}
|
||||
|
||||
public static Rule getByName(String ruleName)
|
||||
{
|
||||
for(Rule r : Rule.getRuleCollection())
|
||||
{
|
||||
if(r.getName().equals(ruleName))
|
||||
return r;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.jens.automation2">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<supports-screens
|
||||
android:anyDensity="true"
|
||||
@ -64,6 +63,7 @@
|
||||
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
|
||||
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.telephony"
|
||||
@ -71,6 +71,12 @@
|
||||
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
|
||||
<uses-permission android:name="android.permission.SEND_SMS"/>
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action
|
||||
android:name="android.intent.action.TTS_SERVICE" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
@ -145,14 +151,24 @@
|
||||
<activity android:name=".ActivityDisplayLongMessage" />
|
||||
<activity android:name=".ActivityManageActionSendTextMessage" />
|
||||
<activity android:name=".ActivityManageActionPlaySound" />
|
||||
<activity android:name=".ActivityManageActionCloseNotification" />
|
||||
<activity android:name=".ActivityManageTriggerProfile" />
|
||||
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
||||
<activity android:name=".ActivityMaintenance" />
|
||||
<activity android:name=".ActivityControlCenter" />
|
||||
<activity android:name=".ActivityManageTriggerPhoneCall" />
|
||||
<activity android:name=".ActivityManageTriggerBroadcast" />
|
||||
<activity android:name=".ActivityManageActionBrightnessSetting" />
|
||||
<activity android:name=".ActivityManageActionCreateNotification" />
|
||||
<activity android:name=".ActivityManageTriggerDeviceOrientation" />
|
||||
<activity android:name=".ActivityHelp" />
|
||||
<activity android:name=".ActivityManageActionVibrate" />
|
||||
<activity android:name=".ActivityManageActionControlMedia" />
|
||||
<activity android:name=".ActivityManageActionSendBroadcast" />
|
||||
<activity android:name=".ActivityManageActionRunExecutable" />
|
||||
<activity android:name=".ActivityManageActionWifi" />
|
||||
<activity android:name=".ActivityManageTriggerTethering" />
|
||||
<activity android:name=".ActivityManageActionWakeLock" />
|
||||
<activity android:name=".ActivityManageTriggerSubSystemState" />
|
||||
<activity
|
||||
android:name=".ActivityMainTabLayout"
|
||||
android:launchMode="singleTask">
|
||||
|
@ -5,10 +5,12 @@ import static com.jens.automation2.Trigger.triggerParameter2Split;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.jens.automation2.receivers.BroadcastListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
@ -17,24 +19,23 @@ import java.util.List;
|
||||
|
||||
public class Rule implements Comparable<Rule>
|
||||
{
|
||||
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||
public static boolean isAnyRuleActive = false;
|
||||
|
||||
private static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||
protected static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||
|
||||
protected static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||
|
||||
public static List<Rule> getRuleRunHistory()
|
||||
{
|
||||
return ruleRunHistory;
|
||||
}
|
||||
|
||||
private ArrayList<Trigger> triggerSet;
|
||||
private ArrayList<Action> actionSet;
|
||||
private String name;
|
||||
private boolean ruleActive = true; // rules can be deactivated, so they won't fire if you don't want them temporarily
|
||||
private boolean ruleToggle = false; // rule will run again and do the opposite of its actions if applicable
|
||||
private Calendar lastExecution;
|
||||
|
||||
private static Date lastActivatedRuleActivationTime;
|
||||
protected ArrayList<Trigger> triggerSet;
|
||||
protected ArrayList<Action> actionSet;
|
||||
protected String name;
|
||||
protected boolean ruleActive = true; // rules can be deactivated, so they won't fire if you don't want them temporarily
|
||||
protected boolean ruleToggle = false; // rule will run again and do the opposite of its actions if applicable
|
||||
protected Calendar lastExecution;
|
||||
|
||||
protected static Date lastActivatedRuleActivationTime;
|
||||
|
||||
public Calendar getLastExecution()
|
||||
{
|
||||
@ -45,7 +46,7 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
this.lastExecution = lastExecution;
|
||||
}
|
||||
|
||||
|
||||
public boolean isRuleToggle()
|
||||
{
|
||||
return ruleToggle;
|
||||
@ -182,6 +183,7 @@ public class Rule implements Comparable<Rule>
|
||||
if(this.checkBeforeSaving(context, true))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Rule", "Changing rule: " + this.toString(), 3);
|
||||
|
||||
boolean returnValue = XmlFileInterface.writeFile();
|
||||
|
||||
if(returnValue)
|
||||
@ -230,20 +232,24 @@ public class Rule implements Comparable<Rule>
|
||||
}
|
||||
|
||||
if(!changeExistingRule)
|
||||
for(Rule rule : Rule.ruleCollection)
|
||||
if(rule.getName().equals(this.getName()))
|
||||
{
|
||||
for (Rule rule : Rule.ruleCollection)
|
||||
{
|
||||
if (rule.getName().equals(this.getName()))
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.anotherRuleByThatName), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.getTriggerSet().size()==0)
|
||||
}
|
||||
}
|
||||
|
||||
if(this.getTriggerSet().size() == 0)
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.pleaseSpecifiyTrigger), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.getActionSet().size()==0)
|
||||
if(this.getActionSet().size() == 0)
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.pleaseSpecifiyAction), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
@ -309,19 +315,12 @@ public class Rule implements Comparable<Rule>
|
||||
switch(action.getAction())
|
||||
{
|
||||
case setAirplaneMode:
|
||||
return true;
|
||||
case setBluetooth:
|
||||
return true;
|
||||
case setDataConnection:
|
||||
return true;
|
||||
case setDisplayRotation:
|
||||
return true;
|
||||
case setUsbTethering:
|
||||
return true;
|
||||
case setWifi:
|
||||
return true;
|
||||
case setWifiTethering:
|
||||
return true;
|
||||
case setBluetoothTethering:
|
||||
return true;
|
||||
default:
|
||||
@ -338,6 +337,19 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
|
||||
return true;
|
||||
|
||||
/*
|
||||
Workaround for repetition in TimeFrame triggers
|
||||
*/
|
||||
if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame))
|
||||
{
|
||||
if(oneTrigger.getTimeFrame().repetition > 0)
|
||||
return true;
|
||||
}
|
||||
else if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.broadcastReceived))
|
||||
{
|
||||
return oneTrigger.getTriggerParameter() == BroadcastListener.getInstance().hasBroadcastOccurredSince(oneTrigger.getTriggerParameter2(), getLastExecution());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -348,7 +360,10 @@ public class Rule implements Comparable<Rule>
|
||||
if(applies(context))
|
||||
{
|
||||
if(hasNotAppliedSinceLastExecution())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "getsGreenLight()", "Rule " + getName() + " applies and has flipped since its last execution.", 4);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("i", "getsGreenLight()", "Rule " + getName() + " has not flipped since its last execution.", 4);
|
||||
}
|
||||
@ -373,11 +388,12 @@ public class Rule implements Comparable<Rule>
|
||||
if (!oneTrigger.applies(null, context))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Miscellaneous.logEvent("i", String.format(context.getResources().getString(R.string.ruleCheckOf), this.getName()), String.format("Rule %1$s generally applies currently. Checking if it's really due, yet will be done separately.", this.getName()), 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", String.format(context.getResources().getString(R.string.ruleCheckOf), this.getName()), String.format(context.getResources().getString(R.string.ruleIsDeactivatedCantApply), this.getName()), 3);
|
||||
Miscellaneous.logEvent("i", String.format(context.getResources().getString(R.string.ruleCheckOf), this.getName()), String.format(context.getResources().getString(R.string.ruleIsDeactivatedCantApply), this.getName()), 4);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -406,7 +422,7 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
Thread.setDefaultUncaughtExceptionHandler(Miscellaneous.uncaughtExceptionHandler);
|
||||
|
||||
// without this line debugger will - for some reason - skip all breakpoints in this class
|
||||
// without this line the debugger will - for some reason - skip all breakpoints in this class
|
||||
if(android.os.Debug.isDebuggerConnected())
|
||||
android.os.Debug.waitForDebugger();
|
||||
|
||||
@ -414,7 +430,7 @@ public class Rule implements Comparable<Rule>
|
||||
Looper.prepare();
|
||||
|
||||
setLastExecution(Calendar.getInstance());
|
||||
wasActivated = activateInternally((AutomationService)params[0], (Boolean)params[1]);
|
||||
wasActivated = activateInternally((AutomationService)params[0]);
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -449,66 +465,57 @@ public class Rule implements Comparable<Rule>
|
||||
* Will activate the rule. Should be called by a separate execution thread
|
||||
* @param automationService
|
||||
*/
|
||||
protected boolean activateInternally(AutomationService automationService, boolean force)
|
||||
protected boolean activateInternally(AutomationService automationService)
|
||||
{
|
||||
boolean isActuallyToggable = isActuallyToggable();
|
||||
boolean isActuallyToggleable = isActuallyToggable();
|
||||
|
||||
boolean notLastActive = getLastActivatedRule() == null || !getLastActivatedRule().equals(Rule.this);
|
||||
boolean doToggle = ruleToggle && isActuallyToggable;
|
||||
boolean doToggle = ruleToggle && isActuallyToggleable;
|
||||
|
||||
//if(notLastActive || force || doToggle)
|
||||
// if(force || doToggle)
|
||||
// {
|
||||
String message;
|
||||
if(!doToggle)
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivate), Rule.this.getName());
|
||||
else
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivateToggle), Rule.this.getName());
|
||||
Miscellaneous.logEvent("i", "Rule", message, 2);
|
||||
// automationService.speak(message);
|
||||
// Toast.makeText(automationService, message, Toast.LENGTH_LONG).show();
|
||||
if(Settings.startNewThreadForRuleActivation)
|
||||
publishProgress(message);
|
||||
String message;
|
||||
if(!doToggle)
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivate), Rule.this.getName());
|
||||
else
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivateToggle), Rule.this.getName());
|
||||
|
||||
for(int i = 0; i< Rule.this.getActionSet().size(); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
Rule.this.getActionSet().get(i).run(automationService, doToggle);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "RuleExecution", "Error running action of rule " + Rule.this.getName() + ": " + Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
Miscellaneous.logEvent("i", "Rule", message, 2);
|
||||
|
||||
// Keep log of last x rule activations (Settings)
|
||||
if(Settings.startNewThreadForRuleActivation)
|
||||
publishProgress(message);
|
||||
|
||||
for(int i = 0; i< Rule.this.getActionSet().size(); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
Rule.ruleRunHistory.add(0, Rule.this); // add at beginning for better visualization
|
||||
Rule.lastActivatedRuleActivationTime = new Date();
|
||||
|
||||
while(ruleRunHistory.size() > Settings.rulesThatHaveBeenRanHistorySize)
|
||||
ruleRunHistory.remove(ruleRunHistory.size()-1);
|
||||
String history = "";
|
||||
for(Rule rule : ruleRunHistory)
|
||||
history += rule.getName() + ", ";
|
||||
if(history.length() > 0)
|
||||
history = history.substring(0, history.length()-2);
|
||||
Miscellaneous.logEvent("i", "Rule history", "Most recent first: " + history, 4);
|
||||
Rule.this.getActionSet().get(i).run(automationService, doToggle);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "Rule history error", Log.getStackTraceString(e), 3);
|
||||
Miscellaneous.logEvent("e", "RuleExecution", "Error running action of rule " + Rule.this.getName() + ": " + Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "Rule", String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.ruleActivationComplete), Rule.this.getName()), 2);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Miscellaneous.logEvent("i", "Rule", "Request to activate rule " + Rule.this.getName() + ", but it is the last one that was activated. Won't do it again.", 3);
|
||||
// return false;
|
||||
// }
|
||||
// Keep log of last x rule activations (Settings)
|
||||
try
|
||||
{
|
||||
Rule.ruleRunHistory.add(0, Rule.this); // add at beginning for better visualization
|
||||
Rule.lastActivatedRuleActivationTime = new Date();
|
||||
|
||||
while(ruleRunHistory.size() > Settings.rulesThatHaveBeenRanHistorySize)
|
||||
ruleRunHistory.remove(ruleRunHistory.size()-1);
|
||||
String history = "";
|
||||
for(Rule rule : ruleRunHistory)
|
||||
history += rule.getName() + ", ";
|
||||
if(history.length() > 0)
|
||||
history = history.substring(0, history.length()-2);
|
||||
Miscellaneous.logEvent("i", "Rule history", "Most recent first: " + history, 4);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "Rule history error", Log.getStackTraceString(e), 3);
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "Rule", String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.ruleActivationComplete), Rule.this.getName()), 2);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -517,7 +524,10 @@ public class Rule implements Comparable<Rule>
|
||||
public void activate(AutomationService automationService, boolean force)
|
||||
{
|
||||
ActivateRuleTask task = new ActivateRuleTask();
|
||||
task.execute(automationService, force);
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
||||
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, automationService, force);
|
||||
else
|
||||
task.execute(automationService, force);
|
||||
}
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidates(Trigger.Trigger_Enum triggerType)
|
||||
@ -526,13 +536,33 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
innerLoop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == triggerType)
|
||||
if(oneTrigger.getTriggerType().equals(triggerType))
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; // we don't need to check the other triggers in the same rule
|
||||
break innerLoop; // we don't need to check the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidates(Action.Action_Enum actionType)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Action oneAction : oneRule.getActionSet())
|
||||
{
|
||||
if(oneAction.getAction().equals(actionType))
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; // we don't need to check the other actions in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -581,186 +611,6 @@ public class Rule implements Comparable<Rule>
|
||||
return ruleCandidates;
|
||||
}
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByTimeFrame(TimeFrame searchTimeFrame, boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(int i=0; i<ruleCollection.size(); i++)
|
||||
{
|
||||
innerloop:
|
||||
for(int j=0; j<ruleCollection.get(i).getTriggerSet().size(); j++)
|
||||
{
|
||||
if(ruleCollection.get(i).getTriggerSet().get(j).getTriggerType() == Trigger.Trigger_Enum.timeFrame)
|
||||
{
|
||||
if(ruleCollection.get(i).getTriggerSet().get(j).getTimeFrame().equals(searchTimeFrame) && ruleCollection.get(i).getTriggerSet().get(j).getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(ruleCollection.get(i));
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByTime(Time searchTime)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "Searching for rules with TimeFrame with time " + searchTime.toString() + ". RuleCollection-Size: " + String.valueOf(ruleCollection.size()), 3);;
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.timeFrame)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "Searching interval: " + oneTrigger.getTimeFrame().getTriggerTimeStart().toString() + " to " + oneTrigger.getTimeFrame().getTriggerTimeStop().toString(), 5);
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "interval start: " + String.valueOf(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime()), 5);
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "search time: " + String.valueOf(searchTime.getTime()), 5);
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "interval stop: " + String.valueOf(oneTrigger.getTimeFrame().getTriggerTimeStop().getTime()), 5);
|
||||
|
||||
if(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime() > oneTrigger.getTimeFrame().getTriggerTimeStop().getTime())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Timeframe search", "Rule (" + oneRule.getName() + ") stretches over midnight.", 5);
|
||||
if(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime() <= searchTime.getTime() || searchTime.getTime() <= oneTrigger.getTimeFrame().getTriggerTimeStop().getTime()+20000) //add 20 seconds because of delay
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
else if(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime() <= searchTime.getTime() && searchTime.getTime() <= oneTrigger.getTimeFrame().getTriggerTimeStop().getTime()+20000) //add 20 seconds because of delay
|
||||
{
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "Rule found (" + oneRule.getName() + ") with TimeFrame with time " + searchTime.toString(), 3);
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "RuleSearch", String.valueOf(ruleCandidates.size()) + " Rule(s) found with TimeFrame with time " + searchTime.toString(), 3);
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByCharging(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.charging)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByUsbHost(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.usb_host_connection)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByAirplaneMode(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.airplaneMode)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByRoaming(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.roaming)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByPhoneCall(String direction)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.phoneCall)
|
||||
{
|
||||
String[] elements = oneTrigger.getTriggerParameter2().split(triggerParameter2Split);
|
||||
if(elements[1].equals(Trigger.triggerPhoneCallDirectionAny) || elements[1].equals(direction))
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidatesByPoi(PointOfInterest searchPoi)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
@ -783,29 +633,6 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
return ruleCandidates;
|
||||
}
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByHeadphoneJack(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.headsetPlugged)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidatesByTriggerProfile(Profile profile)
|
||||
{
|
||||
@ -904,4 +731,15 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
return ActivityPermissions.havePermissionsForRule(this, Miscellaneous.getAnyContext());
|
||||
}
|
||||
|
||||
public static Rule getByName(String ruleName)
|
||||
{
|
||||
for(Rule r : Rule.getRuleCollection())
|
||||
{
|
||||
if(r.getName().equals(ruleName))
|
||||
return r;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.jens.automation2">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<supports-screens
|
||||
android:anyDensity="true"
|
||||
@ -139,14 +138,24 @@
|
||||
<activity android:name=".ActivityDisplayLongMessage" />
|
||||
<activity android:name=".ActivityManageActionSendTextMessage" />
|
||||
<activity android:name=".ActivityManageActionPlaySound" />
|
||||
<activity android:name=".ActivityManageActionCloseNotification" />
|
||||
<activity android:name=".ActivityManageTriggerProfile" />
|
||||
<activity android:name=".ActivityManageTriggerTimeFrame" />
|
||||
<activity android:name=".ActivityMaintenance" />
|
||||
<activity android:name=".ActivityControlCenter" />
|
||||
<activity android:name=".ActivityManageTriggerPhoneCall" />
|
||||
<activity android:name=".ActivityManageTriggerBroadcast" />
|
||||
<activity android:name=".ActivityManageActionBrightnessSetting" />
|
||||
<activity android:name=".ActivityManageActionCreateNotification" />
|
||||
<activity android:name=".ActivityManageTriggerDeviceOrientation" />
|
||||
<activity android:name=".ActivityHelp" />
|
||||
<activity android:name=".ActivityManageActionVibrate" />
|
||||
<activity android:name=".ActivityManageActionControlMedia" />
|
||||
<activity android:name=".ActivityManageActionSendBroadcast" />
|
||||
<activity android:name=".ActivityManageActionRunExecutable" />
|
||||
<activity android:name=".ActivityManageActionWifi" />
|
||||
<activity android:name=".ActivityManageTriggerTethering" />
|
||||
<activity android:name=".ActivityManageActionWakeLock" />
|
||||
<activity android:name=".ActivityManageTriggerSubSystemState" />
|
||||
<activity
|
||||
android:name=".ActivityMainTabLayout"
|
||||
android:launchMode="singleTask">
|
||||
|
@ -5,12 +5,14 @@ import static com.jens.automation2.Trigger.triggerParameter2Split;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.gms.location.DetectedActivity;
|
||||
import com.jens.automation2.receivers.ActivityDetectionReceiver;
|
||||
import com.jens.automation2.receivers.BroadcastListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@ -20,24 +22,23 @@ import java.util.List;
|
||||
|
||||
public class Rule implements Comparable<Rule>
|
||||
{
|
||||
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||
public static boolean isAnyRuleActive = false;
|
||||
|
||||
private static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||
protected static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||
|
||||
protected static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||
|
||||
public static List<Rule> getRuleRunHistory()
|
||||
{
|
||||
return ruleRunHistory;
|
||||
}
|
||||
|
||||
private ArrayList<Trigger> triggerSet;
|
||||
private ArrayList<Action> actionSet;
|
||||
private String name;
|
||||
private boolean ruleActive = true; // rules can be deactivated, so they won't fire if you don't want them temporarily
|
||||
private boolean ruleToggle = false; // rule will run again and do the opposite of its actions if applicable
|
||||
private Calendar lastExecution;
|
||||
|
||||
private static Date lastActivatedRuleActivationTime;
|
||||
protected ArrayList<Trigger> triggerSet;
|
||||
protected ArrayList<Action> actionSet;
|
||||
protected String name;
|
||||
protected boolean ruleActive = true; // rules can be deactivated, so they won't fire if you don't want them temporarily
|
||||
protected boolean ruleToggle = false; // rule will run again and do the opposite of its actions if applicable
|
||||
protected Calendar lastExecution;
|
||||
|
||||
protected static Date lastActivatedRuleActivationTime;
|
||||
|
||||
public Calendar getLastExecution()
|
||||
{
|
||||
@ -185,6 +186,7 @@ public class Rule implements Comparable<Rule>
|
||||
if(this.checkBeforeSaving(context, true))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Rule", "Changing rule: " + this.toString(), 3);
|
||||
|
||||
boolean returnValue = XmlFileInterface.writeFile();
|
||||
|
||||
if(returnValue)
|
||||
@ -233,20 +235,24 @@ public class Rule implements Comparable<Rule>
|
||||
}
|
||||
|
||||
if(!changeExistingRule)
|
||||
for(Rule rule : Rule.ruleCollection)
|
||||
if(rule.getName().equals(this.getName()))
|
||||
{
|
||||
for (Rule rule : Rule.ruleCollection)
|
||||
{
|
||||
if (rule.getName().equals(this.getName()))
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.anotherRuleByThatName), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.getTriggerSet().size()==0)
|
||||
}
|
||||
}
|
||||
|
||||
if(this.getTriggerSet().size() == 0)
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.pleaseSpecifiyTrigger), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.getActionSet().size()==0)
|
||||
if(this.getActionSet().size() == 0)
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.pleaseSpecifiyAction), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
@ -312,19 +318,12 @@ public class Rule implements Comparable<Rule>
|
||||
switch(action.getAction())
|
||||
{
|
||||
case setAirplaneMode:
|
||||
return true;
|
||||
case setBluetooth:
|
||||
return true;
|
||||
case setDataConnection:
|
||||
return true;
|
||||
case setDisplayRotation:
|
||||
return true;
|
||||
case setUsbTethering:
|
||||
return true;
|
||||
case setWifi:
|
||||
return true;
|
||||
case setWifiTethering:
|
||||
return true;
|
||||
case setBluetoothTethering:
|
||||
return true;
|
||||
default:
|
||||
@ -341,6 +340,19 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
|
||||
return true;
|
||||
|
||||
/*
|
||||
Workaround for repetition in TimeFrame triggers
|
||||
*/
|
||||
if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame))
|
||||
{
|
||||
if(oneTrigger.getTimeFrame().repetition > 0)
|
||||
return true;
|
||||
}
|
||||
else if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.broadcastReceived))
|
||||
{
|
||||
return oneTrigger.getTriggerParameter() == BroadcastListener.getInstance().hasBroadcastOccurredSince(oneTrigger.getTriggerParameter2(), getLastExecution());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -351,7 +363,10 @@ public class Rule implements Comparable<Rule>
|
||||
if(applies(context))
|
||||
{
|
||||
if(hasNotAppliedSinceLastExecution())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "getsGreenLight()", "Rule " + getName() + " applies and has flipped since its last execution.", 4);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("i", "getsGreenLight()", "Rule " + getName() + " has not flipped since its last execution.", 4);
|
||||
}
|
||||
@ -376,11 +391,12 @@ public class Rule implements Comparable<Rule>
|
||||
if (!oneTrigger.applies(null, context))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Miscellaneous.logEvent("i", String.format(context.getResources().getString(R.string.ruleCheckOf), this.getName()), String.format("Rule %1$s generally applies currently. Checking if it's really due, yet will be done separately.", this.getName()), 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", String.format(context.getResources().getString(R.string.ruleCheckOf), this.getName()), String.format(context.getResources().getString(R.string.ruleIsDeactivatedCantApply), this.getName()), 3);
|
||||
Miscellaneous.logEvent("i", String.format(context.getResources().getString(R.string.ruleCheckOf), this.getName()), String.format(context.getResources().getString(R.string.ruleIsDeactivatedCantApply), this.getName()), 4);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -433,7 +449,7 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
Thread.setDefaultUncaughtExceptionHandler(Miscellaneous.uncaughtExceptionHandler);
|
||||
|
||||
// without this line debugger will - for some reason - skip all breakpoints in this class
|
||||
// without this line the debugger will - for some reason - skip all breakpoints in this class
|
||||
if(android.os.Debug.isDebuggerConnected())
|
||||
android.os.Debug.waitForDebugger();
|
||||
|
||||
@ -441,7 +457,7 @@ public class Rule implements Comparable<Rule>
|
||||
Looper.prepare();
|
||||
|
||||
setLastExecution(Calendar.getInstance());
|
||||
wasActivated = activateInternally((AutomationService)params[0], (Boolean)params[1]);
|
||||
wasActivated = activateInternally((AutomationService)params[0]);
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -476,66 +492,57 @@ public class Rule implements Comparable<Rule>
|
||||
* Will activate the rule. Should be called by a separate execution thread
|
||||
* @param automationService
|
||||
*/
|
||||
protected boolean activateInternally(AutomationService automationService, boolean force)
|
||||
protected boolean activateInternally(AutomationService automationService)
|
||||
{
|
||||
boolean isActuallyToggable = isActuallyToggable();
|
||||
boolean isActuallyToggleable = isActuallyToggable();
|
||||
|
||||
boolean notLastActive = getLastActivatedRule() == null || !getLastActivatedRule().equals(Rule.this);
|
||||
boolean doToggle = ruleToggle && isActuallyToggable;
|
||||
boolean doToggle = ruleToggle && isActuallyToggleable;
|
||||
|
||||
//if(notLastActive || force || doToggle)
|
||||
// if(force || doToggle)
|
||||
// {
|
||||
String message;
|
||||
if(!doToggle)
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivate), Rule.this.getName());
|
||||
else
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivateToggle), Rule.this.getName());
|
||||
Miscellaneous.logEvent("i", "Rule", message, 2);
|
||||
// automationService.speak(message);
|
||||
// Toast.makeText(automationService, message, Toast.LENGTH_LONG).show();
|
||||
if(Settings.startNewThreadForRuleActivation)
|
||||
publishProgress(message);
|
||||
String message;
|
||||
if(!doToggle)
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivate), Rule.this.getName());
|
||||
else
|
||||
message = String.format(automationService.getResources().getString(R.string.ruleActivateToggle), Rule.this.getName());
|
||||
|
||||
for(int i = 0; i< Rule.this.getActionSet().size(); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
Rule.this.getActionSet().get(i).run(automationService, doToggle);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "RuleExecution", "Error running action of rule " + Rule.this.getName() + ": " + Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
Miscellaneous.logEvent("i", "Rule", message, 2);
|
||||
|
||||
// Keep log of last x rule activations (Settings)
|
||||
if(Settings.startNewThreadForRuleActivation)
|
||||
publishProgress(message);
|
||||
|
||||
for(int i = 0; i< Rule.this.getActionSet().size(); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
Rule.ruleRunHistory.add(0, Rule.this); // add at beginning for better visualization
|
||||
Rule.lastActivatedRuleActivationTime = new Date();
|
||||
|
||||
while(ruleRunHistory.size() > Settings.rulesThatHaveBeenRanHistorySize)
|
||||
ruleRunHistory.remove(ruleRunHistory.size()-1);
|
||||
String history = "";
|
||||
for(Rule rule : ruleRunHistory)
|
||||
history += rule.getName() + ", ";
|
||||
if(history.length() > 0)
|
||||
history = history.substring(0, history.length()-2);
|
||||
Miscellaneous.logEvent("i", "Rule history", "Most recent first: " + history, 4);
|
||||
Rule.this.getActionSet().get(i).run(automationService, doToggle);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "Rule history error", Log.getStackTraceString(e), 3);
|
||||
Miscellaneous.logEvent("e", "RuleExecution", "Error running action of rule " + Rule.this.getName() + ": " + Log.getStackTraceString(e), 1);
|
||||
}
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "Rule", String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.ruleActivationComplete), Rule.this.getName()), 2);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Miscellaneous.logEvent("i", "Rule", "Request to activate rule " + Rule.this.getName() + ", but it is the last one that was activated. Won't do it again.", 3);
|
||||
// return false;
|
||||
// }
|
||||
// Keep log of last x rule activations (Settings)
|
||||
try
|
||||
{
|
||||
Rule.ruleRunHistory.add(0, Rule.this); // add at beginning for better visualization
|
||||
Rule.lastActivatedRuleActivationTime = new Date();
|
||||
|
||||
while(ruleRunHistory.size() > Settings.rulesThatHaveBeenRanHistorySize)
|
||||
ruleRunHistory.remove(ruleRunHistory.size()-1);
|
||||
String history = "";
|
||||
for(Rule rule : ruleRunHistory)
|
||||
history += rule.getName() + ", ";
|
||||
if(history.length() > 0)
|
||||
history = history.substring(0, history.length()-2);
|
||||
Miscellaneous.logEvent("i", "Rule history", "Most recent first: " + history, 4);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "Rule history error", Log.getStackTraceString(e), 3);
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "Rule", String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.ruleActivationComplete), Rule.this.getName()), 2);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -544,7 +551,10 @@ public class Rule implements Comparable<Rule>
|
||||
public void activate(AutomationService automationService, boolean force)
|
||||
{
|
||||
ActivateRuleTask task = new ActivateRuleTask();
|
||||
task.execute(automationService, force);
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
||||
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, automationService, force);
|
||||
else
|
||||
task.execute(automationService, force);
|
||||
}
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidates(Trigger.Trigger_Enum triggerType)
|
||||
@ -553,13 +563,33 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
innerLoop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == triggerType)
|
||||
if(oneTrigger.getTriggerType().equals(triggerType))
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; // we don't need to check the other triggers in the same rule
|
||||
break innerLoop; // we don't need to check the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidates(Action.Action_Enum actionType)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Action oneAction : oneRule.getActionSet())
|
||||
{
|
||||
if(oneAction.getAction().equals(actionType))
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; // we don't need to check the other actions in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -608,186 +638,6 @@ public class Rule implements Comparable<Rule>
|
||||
return ruleCandidates;
|
||||
}
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByTimeFrame(TimeFrame searchTimeFrame, boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(int i=0; i<ruleCollection.size(); i++)
|
||||
{
|
||||
innerloop:
|
||||
for(int j=0; j<ruleCollection.get(i).getTriggerSet().size(); j++)
|
||||
{
|
||||
if(ruleCollection.get(i).getTriggerSet().get(j).getTriggerType() == Trigger.Trigger_Enum.timeFrame)
|
||||
{
|
||||
if(ruleCollection.get(i).getTriggerSet().get(j).getTimeFrame().equals(searchTimeFrame) && ruleCollection.get(i).getTriggerSet().get(j).getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(ruleCollection.get(i));
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByTime(Time searchTime)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "Searching for rules with TimeFrame with time " + searchTime.toString() + ". RuleCollection-Size: " + String.valueOf(ruleCollection.size()), 3);;
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.timeFrame)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "Searching interval: " + oneTrigger.getTimeFrame().getTriggerTimeStart().toString() + " to " + oneTrigger.getTimeFrame().getTriggerTimeStop().toString(), 5);
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "interval start: " + String.valueOf(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime()), 5);
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "search time: " + String.valueOf(searchTime.getTime()), 5);
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "interval stop: " + String.valueOf(oneTrigger.getTimeFrame().getTriggerTimeStop().getTime()), 5);
|
||||
|
||||
if(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime() > oneTrigger.getTimeFrame().getTriggerTimeStop().getTime())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Timeframe search", "Rule (" + oneRule.getName() + ") stretches over midnight.", 5);
|
||||
if(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime() <= searchTime.getTime() || searchTime.getTime() <= oneTrigger.getTimeFrame().getTriggerTimeStop().getTime()+20000) //add 20 seconds because of delay
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
else if(oneTrigger.getTimeFrame().getTriggerTimeStart().getTime() <= searchTime.getTime() && searchTime.getTime() <= oneTrigger.getTimeFrame().getTriggerTimeStop().getTime()+20000) //add 20 seconds because of delay
|
||||
{
|
||||
Miscellaneous.logEvent("i", "RuleSearch", "Rule found (" + oneRule.getName() + ") with TimeFrame with time " + searchTime.toString(), 3);
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "RuleSearch", String.valueOf(ruleCandidates.size()) + " Rule(s) found with TimeFrame with time " + searchTime.toString(), 3);
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByCharging(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.charging)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByUsbHost(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.usb_host_connection)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //if the poi is found we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByAirplaneMode(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.airplaneMode)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByRoaming(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.roaming)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByPhoneCall(String direction)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.phoneCall)
|
||||
{
|
||||
String[] elements = oneTrigger.getTriggerParameter2().split(triggerParameter2Split);
|
||||
if(elements[1].equals(Trigger.triggerPhoneCallDirectionAny) || elements[1].equals(direction))
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidatesByPoi(PointOfInterest searchPoi)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
@ -810,29 +660,6 @@ public class Rule implements Comparable<Rule>
|
||||
|
||||
return ruleCandidates;
|
||||
}
|
||||
|
||||
/*public static ArrayList<Rule> findRuleCandidatesByHeadphoneJack(boolean triggerParameter)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = new ArrayList<Rule>();
|
||||
|
||||
for(Rule oneRule : ruleCollection)
|
||||
{
|
||||
innerloop:
|
||||
for(Trigger oneTrigger : oneRule.getTriggerSet())
|
||||
{
|
||||
if(oneTrigger.getTriggerType() == Trigger.Trigger_Enum.headsetPlugged)
|
||||
{
|
||||
if(oneTrigger.getTriggerParameter() == triggerParameter)
|
||||
{
|
||||
ruleCandidates.add(oneRule);
|
||||
break innerloop; //we don't need to search the other triggers in the same rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ruleCandidates;
|
||||
}*/
|
||||
|
||||
public static ArrayList<Rule> findRuleCandidatesByTriggerProfile(Profile profile)
|
||||
{
|
||||
@ -931,4 +758,15 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
return ActivityPermissions.havePermissionsForRule(this, Miscellaneous.getAnyContext());
|
||||
}
|
||||
|
||||
public static Rule getByName(String ruleName)
|
||||
{
|
||||
for(Rule r : Rule.getRuleCollection())
|
||||
{
|
||||
if(r.getName().equals(ruleName))
|
||||
return r;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.jens.automation2">
|
||||
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
</manifest>
|
@ -2,9 +2,12 @@ package com.jens.automation2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
|
||||
@ -17,102 +20,121 @@ public class Action
|
||||
Rule parentRule = null;
|
||||
|
||||
public static final String actionParameter2Split = "ap2split";
|
||||
public static final String intentPairSeperator = "intPairSplit";
|
||||
public static final String intentPairSeparator = "intPairSplit";
|
||||
public static final String vibrateSeparator = ",";
|
||||
|
||||
public enum Action_Enum {
|
||||
setWifi,
|
||||
setBluetooth,
|
||||
setUsbTethering,
|
||||
setWifiTethering,
|
||||
setBluetoothTethering,
|
||||
setDisplayRotation,
|
||||
turnWifiOn,turnWifiOff,
|
||||
turnBluetoothOn,turnBluetoothOff,
|
||||
triggerUrl,
|
||||
changeSoundProfile,
|
||||
turnUsbTetheringOn,turnUsbTetheringOff,
|
||||
turnWifiTetheringOn,turnWifiTetheringOff,
|
||||
enableScreenRotation,disableScreenRotation,
|
||||
startOtherActivity,
|
||||
waitBeforeNextAction,
|
||||
turnScreenOnOrOff,
|
||||
setAirplaneMode,
|
||||
setDataConnection,
|
||||
speakText,
|
||||
playMusic,
|
||||
setScreenBrightness,
|
||||
playSound,
|
||||
vibrate,
|
||||
sendTextMessage;
|
||||
|
||||
public String getFullName(Context context)
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case setWifi:
|
||||
return context.getResources().getString(R.string.actionSetWifi);
|
||||
case setBluetooth:
|
||||
return context.getResources().getString(R.string.actionSetBluetooth);
|
||||
case setWifiTethering:
|
||||
return context.getResources().getString(R.string.actionSetWifiTethering);
|
||||
case setBluetoothTethering:
|
||||
return context.getResources().getString(R.string.actionSetBluetoothTethering);
|
||||
case setUsbTethering:
|
||||
return context.getResources().getString(R.string.actionSetUsbTethering);
|
||||
case setDisplayRotation:
|
||||
return context.getResources().getString(R.string.actionSetDisplayRotation);
|
||||
case turnWifiOn:
|
||||
return context.getResources().getString(R.string.actionTurnWifiOn);
|
||||
case turnWifiOff:
|
||||
return context.getResources().getString(R.string.actionTurnWifiOff);
|
||||
case turnBluetoothOn:
|
||||
return context.getResources().getString(R.string.actionTurnBluetoothOn);
|
||||
case turnBluetoothOff:
|
||||
return context.getResources().getString(R.string.actionTurnBluetoothOff);
|
||||
case triggerUrl:
|
||||
return context.getResources().getString(R.string.actionTriggerUrl);
|
||||
case changeSoundProfile:
|
||||
return context.getResources().getString(R.string.actionChangeSoundProfile);
|
||||
case turnUsbTetheringOn:
|
||||
return context.getResources().getString(R.string.actionTurnUsbTetheringOn);
|
||||
case turnUsbTetheringOff:
|
||||
return context.getResources().getString(R.string.actionTurnUsbTetheringOff);
|
||||
case turnWifiTetheringOn:
|
||||
return context.getResources().getString(R.string.actionTurnWifiTetheringOn);
|
||||
case turnWifiTetheringOff:
|
||||
return context.getResources().getString(R.string.actionTurnWifiTetheringOff);
|
||||
case enableScreenRotation:
|
||||
return context.getResources().getString(R.string.actionEnableScreenRotation);
|
||||
case disableScreenRotation:
|
||||
return context.getResources().getString(R.string.actionDisableScreenRotation);
|
||||
case startOtherActivity:
|
||||
return context.getResources().getString(R.string.startOtherActivity);
|
||||
case waitBeforeNextAction:
|
||||
return context.getResources().getString(R.string.waitBeforeNextAction);
|
||||
case turnScreenOnOrOff:
|
||||
return context.getResources().getString(R.string.turnScreenOnOrOff);
|
||||
case vibrate:
|
||||
return context.getResources().getString(R.string.vibrate);
|
||||
case setAirplaneMode:
|
||||
return context.getResources().getString(R.string.airplaneMode);
|
||||
case setDataConnection:
|
||||
return context.getResources().getString(R.string.actionDataConnection);
|
||||
case speakText:
|
||||
return context.getResources().getString(R.string.actionSpeakText);
|
||||
case playMusic:
|
||||
return context.getResources().getString(R.string.actionPlayMusic);
|
||||
case playSound:
|
||||
return context.getResources().getString(R.string.playSound);
|
||||
case sendTextMessage:
|
||||
return context.getResources().getString(R.string.sendTextMessage);
|
||||
case setScreenBrightness:
|
||||
return context.getResources().getString(R.string.setScreenBrightness);
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
};
|
||||
public enum Action_Enum
|
||||
{
|
||||
setWifi,
|
||||
setBluetooth,
|
||||
setUsbTethering,
|
||||
setWifiTethering,
|
||||
setBluetoothTethering,
|
||||
setDisplayRotation,
|
||||
turnWifiOn,turnWifiOff,
|
||||
turnBluetoothOn,turnBluetoothOff,
|
||||
triggerUrl,
|
||||
changeSoundProfile,
|
||||
turnUsbTetheringOn,turnUsbTetheringOff,
|
||||
turnWifiTetheringOn,turnWifiTetheringOff,
|
||||
enableScreenRotation,disableScreenRotation,
|
||||
startOtherActivity,
|
||||
waitBeforeNextAction,
|
||||
turnScreenOnOrOff,
|
||||
setAirplaneMode,
|
||||
setDataConnection,
|
||||
speakText,
|
||||
playMusic,
|
||||
controlMediaPlayback,
|
||||
setScreenBrightness,
|
||||
playSound,
|
||||
vibrate,
|
||||
createNotification,
|
||||
closeNotification,
|
||||
sendBroadcast,
|
||||
runExecutable,
|
||||
wakelock,
|
||||
sendTextMessage;
|
||||
|
||||
public String getFullName(Context context)
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case setWifi:
|
||||
return context.getResources().getString(R.string.actionSetWifi);
|
||||
case setBluetooth:
|
||||
return context.getResources().getString(R.string.actionSetBluetooth);
|
||||
case setWifiTethering:
|
||||
return context.getResources().getString(R.string.actionSetWifiTethering);
|
||||
case setBluetoothTethering:
|
||||
return context.getResources().getString(R.string.actionSetBluetoothTethering);
|
||||
case setUsbTethering:
|
||||
return context.getResources().getString(R.string.actionSetUsbTethering);
|
||||
case setDisplayRotation:
|
||||
return context.getResources().getString(R.string.actionSetDisplayRotation);
|
||||
case turnWifiOn:
|
||||
return context.getResources().getString(R.string.actionTurnWifiOn);
|
||||
case turnWifiOff:
|
||||
return context.getResources().getString(R.string.actionTurnWifiOff);
|
||||
case turnBluetoothOn:
|
||||
return context.getResources().getString(R.string.actionTurnBluetoothOn);
|
||||
case turnBluetoothOff:
|
||||
return context.getResources().getString(R.string.actionTurnBluetoothOff);
|
||||
case triggerUrl:
|
||||
return context.getResources().getString(R.string.actionTriggerUrl);
|
||||
case changeSoundProfile:
|
||||
return context.getResources().getString(R.string.actionChangeSoundProfile);
|
||||
case turnUsbTetheringOn:
|
||||
return context.getResources().getString(R.string.actionTurnUsbTetheringOn);
|
||||
case turnUsbTetheringOff:
|
||||
return context.getResources().getString(R.string.actionTurnUsbTetheringOff);
|
||||
case turnWifiTetheringOn:
|
||||
return context.getResources().getString(R.string.actionTurnWifiTetheringOn);
|
||||
case turnWifiTetheringOff:
|
||||
return context.getResources().getString(R.string.actionTurnWifiTetheringOff);
|
||||
case enableScreenRotation:
|
||||
return context.getResources().getString(R.string.actionEnableScreenRotation);
|
||||
case disableScreenRotation:
|
||||
return context.getResources().getString(R.string.actionDisableScreenRotation);
|
||||
case startOtherActivity:
|
||||
return context.getResources().getString(R.string.startOtherActivity);
|
||||
case waitBeforeNextAction:
|
||||
return context.getResources().getString(R.string.waitBeforeNextAction);
|
||||
case turnScreenOnOrOff:
|
||||
return context.getResources().getString(R.string.turnScreenOnOrOff);
|
||||
case vibrate:
|
||||
return context.getResources().getString(R.string.vibrate);
|
||||
case setAirplaneMode:
|
||||
return context.getResources().getString(R.string.airplaneMode);
|
||||
case setDataConnection:
|
||||
return context.getResources().getString(R.string.actionDataConnection);
|
||||
case speakText:
|
||||
return context.getResources().getString(R.string.actionSpeakText);
|
||||
case playMusic:
|
||||
return context.getResources().getString(R.string.actionPlayMusic);
|
||||
case controlMediaPlayback:
|
||||
return context.getResources().getString(R.string.actionMediaControl);
|
||||
case playSound:
|
||||
return context.getResources().getString(R.string.playSound);
|
||||
case sendTextMessage:
|
||||
return context.getResources().getString(R.string.sendTextMessage);
|
||||
case setScreenBrightness:
|
||||
return context.getResources().getString(R.string.setScreenBrightness);
|
||||
case createNotification:
|
||||
return context.getResources().getString(R.string.createNotification);
|
||||
case closeNotification:
|
||||
return context.getResources().getString(R.string.closeNotifications);
|
||||
case sendBroadcast:
|
||||
return context.getResources().getString(R.string.sendBroadcast);
|
||||
case runExecutable:
|
||||
return context.getResources().getString(R.string.runExecutable);
|
||||
case wakelock:
|
||||
return context.getResources().getString(R.string.keepDeviceAwake);
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private Action_Enum action;
|
||||
private boolean parameter1 = false;
|
||||
@ -154,134 +176,223 @@ public class Action
|
||||
{
|
||||
StringBuilder returnString = new StringBuilder();
|
||||
|
||||
switch(getAction())
|
||||
try
|
||||
{
|
||||
case setWifi:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOff));
|
||||
break;
|
||||
case setBluetooth:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOff));
|
||||
break;
|
||||
case setUsbTethering:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOff));
|
||||
break;
|
||||
case setWifiTethering:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOff));
|
||||
break;
|
||||
case setBluetoothTethering:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOff));
|
||||
break;
|
||||
case setDisplayRotation:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionEnableScreenRotation));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionDisableScreenRotation));
|
||||
break;
|
||||
case setAirplaneMode:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOff));
|
||||
break;
|
||||
case setDataConnection:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOff));
|
||||
break;
|
||||
case startOtherActivity:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.startOtherActivity));
|
||||
break;
|
||||
case triggerUrl:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTriggerUrl));
|
||||
break;
|
||||
case speakText:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSpeakText));
|
||||
break;
|
||||
case playMusic:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionPlayMusic));
|
||||
break;
|
||||
case sendTextMessage:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.sendTextMessage));
|
||||
break;
|
||||
case turnScreenOnOrOff:
|
||||
if (getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOff));
|
||||
break;
|
||||
case playSound:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.playSound));
|
||||
break;
|
||||
case changeSoundProfile:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionChangeSoundProfile));
|
||||
break;
|
||||
case waitBeforeNextAction:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.waitBeforeNextAction));
|
||||
break;
|
||||
case setScreenBrightness:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.setScreenBrightness));
|
||||
break;
|
||||
default:
|
||||
returnString.append(action.toString());
|
||||
}
|
||||
|
||||
if(this.getAction().equals(Action_Enum.triggerUrl))
|
||||
{
|
||||
String[] components = parameter2.split(";");
|
||||
if(components.length >= 3)
|
||||
switch (getAction())
|
||||
{
|
||||
returnString.append(": " + components[2]);
|
||||
|
||||
if(parameter1)
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.usingAuthentication) + ".");
|
||||
case setWifi:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiOff));
|
||||
break;
|
||||
case setBluetooth:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothOff));
|
||||
break;
|
||||
case setUsbTethering:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnUsbTetheringOff));
|
||||
break;
|
||||
case setWifiTethering:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnWifiTetheringOff));
|
||||
break;
|
||||
case setBluetoothTethering:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnBluetoothTetheringOff));
|
||||
break;
|
||||
case setDisplayRotation:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionEnableScreenRotation));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionDisableScreenRotation));
|
||||
break;
|
||||
case setAirplaneMode:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTurnAirplaneModeOff));
|
||||
break;
|
||||
case setDataConnection:
|
||||
if (this.getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSetDataConnectionOff));
|
||||
break;
|
||||
case startOtherActivity:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.startOtherActivity));
|
||||
break;
|
||||
case triggerUrl:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionTriggerUrl));
|
||||
break;
|
||||
case speakText:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionSpeakText));
|
||||
break;
|
||||
case playMusic:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionPlayMusic));
|
||||
break;
|
||||
case controlMediaPlayback:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionMediaControl));
|
||||
break;
|
||||
case sendTextMessage:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.sendTextMessage));
|
||||
break;
|
||||
case turnScreenOnOrOff:
|
||||
if (getParameter1())
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOn));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.turnScreenOff));
|
||||
break;
|
||||
case playSound:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.playSound));
|
||||
break;
|
||||
case changeSoundProfile:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.actionChangeSoundProfile));
|
||||
break;
|
||||
case waitBeforeNextAction:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.waitBeforeNextAction));
|
||||
break;
|
||||
case setScreenBrightness:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.setScreenBrightness));
|
||||
break;
|
||||
case createNotification:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.createNotification));
|
||||
break;
|
||||
case closeNotification:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.closeNotifications));
|
||||
break;
|
||||
case sendBroadcast:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.sendBroadcast));
|
||||
break;
|
||||
case runExecutable:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.runExecutable));
|
||||
break;
|
||||
case wakelock:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.keepDeviceAwake) + " (" + String.valueOf(getParameter1()) + ")");
|
||||
break;
|
||||
default:
|
||||
returnString.append(action.toString());
|
||||
}
|
||||
else
|
||||
returnString.append(": " + components[0]);
|
||||
}
|
||||
else if(this.getAction().equals(Action_Enum.startOtherActivity))
|
||||
{
|
||||
returnString.append(": " + parameter2.replace(Action.intentPairSeperator, "/"));
|
||||
}
|
||||
else if(this.getAction().equals(Action_Enum.sendTextMessage))
|
||||
{
|
||||
String[] components = parameter2.split(Actions.smsSeparator);
|
||||
if(components.length >= 2)
|
||||
|
||||
if (this.getAction().equals(Action_Enum.triggerUrl))
|
||||
{
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.toNumber) + " " + components[0]);
|
||||
String[] components = parameter2.split(";");
|
||||
if (components.length >= 3)
|
||||
{
|
||||
returnString.append(": " + components[2]);
|
||||
|
||||
returnString.append(". " + Miscellaneous.getAnyContext().getResources().getString(R.string.message) + ": " + components[1]);
|
||||
if (parameter1)
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.usingAuthentication) + ".");
|
||||
}
|
||||
else
|
||||
returnString.append(": " + components[0]);
|
||||
}
|
||||
else if (this.getAction().equals(Action_Enum.startOtherActivity))
|
||||
{
|
||||
returnString.append(": " + parameter2.replace(Action.intentPairSeparator, "/"));
|
||||
}
|
||||
else if (this.getAction().equals(Action_Enum.sendTextMessage))
|
||||
{
|
||||
String[] components = parameter2.split(Actions.smsSeparator);
|
||||
if (components.length >= 2)
|
||||
{
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.toNumber) + " " + components[0]);
|
||||
|
||||
returnString.append(". " + Miscellaneous.getAnyContext().getResources().getString(R.string.message) + ": " + components[1]);
|
||||
}
|
||||
}
|
||||
else if (this.getAction().equals(Action_Enum.setScreenBrightness))
|
||||
{
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.to) + " ");
|
||||
|
||||
if (parameter1)
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.brightnessAuto));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.brightnessManual));
|
||||
|
||||
returnString.append(" / " + Integer.parseInt(parameter2) + "%");
|
||||
}
|
||||
else if (this.getAction().equals(Action_Enum.closeNotification))
|
||||
{
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.from) + " ");
|
||||
|
||||
String parts[] = this.getParameter2().split(Action.actionParameter2Split);
|
||||
if (parts[0].equals(Trigger.anyAppString))
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.anyApp));
|
||||
else
|
||||
returnString.append(parts[0]);
|
||||
|
||||
if (!StringUtils.isBlank(parts[2]))
|
||||
returnString.append(", " + Miscellaneous.getAnyContext().getResources().getString(R.string.ifString) + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.title) + " " + Trigger.getMatchString(parts[1]) + " " + parts[2]);
|
||||
|
||||
if (parts.length > 4 && !StringUtils.isBlank(parts[4]))
|
||||
returnString.append(", " + Miscellaneous.getAnyContext().getResources().getString(R.string.ifString) + " " + Miscellaneous.getAnyContext().getResources().getString(R.string.text) + " " + Trigger.getMatchString(parts[3]) + " " + parts[4]);
|
||||
|
||||
if(parts.length >= 6)
|
||||
{
|
||||
if(!parts[5].equals(ActivityManageActionCloseNotification.dismissRegularString))
|
||||
{
|
||||
returnString.append(" " + String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.withButton), parts[5]));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(this.getAction().equals(Action_Enum.setWifi))
|
||||
{
|
||||
if(!StringUtils.isEmpty(this.parameter2))
|
||||
{
|
||||
boolean useRoot = Boolean.parseBoolean(this.parameter2);
|
||||
if(useRoot)
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.usingRoot));
|
||||
}
|
||||
}
|
||||
else if(this.getAction().equals(Action_Enum.controlMediaPlayback))
|
||||
{
|
||||
returnString.append(": ");
|
||||
|
||||
switch (this.getParameter2())
|
||||
{
|
||||
case "0":
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.playPause));
|
||||
break;
|
||||
case "1":
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.play));
|
||||
break;
|
||||
case "2":
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.pause));
|
||||
break;
|
||||
case "3":
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.stop));
|
||||
break;
|
||||
case "4":
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.previous));
|
||||
break;
|
||||
case "5":
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.next));
|
||||
break;
|
||||
default:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.unknown));
|
||||
}
|
||||
}
|
||||
else if(this.getAction().equals(Action_Enum.sendBroadcast))
|
||||
{
|
||||
returnString.append(": " + parameter2.replace(Action.actionParameter2Split, "; ").replace(Action.intentPairSeparator, "/"));
|
||||
}
|
||||
else if (parameter2 != null && parameter2.length() > 0)
|
||||
returnString.append(": " + parameter2.replace(Action.actionParameter2Split, "; "));
|
||||
}
|
||||
else if(this.getAction().equals(Action_Enum.setScreenBrightness))
|
||||
catch (Exception e)
|
||||
{
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.to) + " ");
|
||||
|
||||
if(parameter1)
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.brightnessAuto));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.brightnessManual));
|
||||
|
||||
returnString.append(" / " + Integer.parseInt(parameter2) + "%");
|
||||
returnString.append(": " + Miscellaneous.getAnyContext().getResources().getString(R.string.error));
|
||||
}
|
||||
else
|
||||
if (parameter2 != null && parameter2.length() > 0)
|
||||
returnString.append(": " + parameter2);
|
||||
|
||||
return returnString.toString();
|
||||
}
|
||||
@ -360,7 +471,7 @@ public class Action
|
||||
|
||||
return (String[])actionTypesList.toArray(new String[actionTypesList.size()]);
|
||||
}
|
||||
|
||||
|
||||
public void run(Context context, boolean toggleActionIfPossible)
|
||||
{
|
||||
try
|
||||
@ -388,7 +499,7 @@ public class Action
|
||||
Actions.setUsbTethering(context, getParameter1(), toggleActionIfPossible);
|
||||
break;
|
||||
case setWifi:
|
||||
Actions.WifiStuff.setWifi(context, getParameter1(), toggleActionIfPossible);
|
||||
Actions.WifiStuff.setWifi(context, getParameter1(), getParameter2(), toggleActionIfPossible);
|
||||
break;
|
||||
case setWifiTethering:
|
||||
Actions.setWifiTethering(context, getParameter1(), toggleActionIfPossible);
|
||||
@ -439,6 +550,9 @@ public class Action
|
||||
case playMusic:
|
||||
Actions.playMusic(this.getParameter1(), toggleActionIfPossible);
|
||||
break;
|
||||
case controlMediaPlayback:
|
||||
Actions.controlMediaPlayback(context, Integer.parseInt(getParameter2()));
|
||||
break;
|
||||
case sendTextMessage:
|
||||
Actions.sendTextMessage(context, this.getParameter2().split(Actions.smsSeparator));
|
||||
break;
|
||||
@ -451,6 +565,31 @@ public class Action
|
||||
case playSound:
|
||||
Actions.playSound(getParameter1(), getParameter2());
|
||||
break;
|
||||
case createNotification:
|
||||
Actions.createNotification(this);
|
||||
break;
|
||||
case closeNotification:
|
||||
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.M)
|
||||
Actions.closeNotification(this);
|
||||
else
|
||||
Miscellaneous.logEvent("w", "Close notification", "Close notification was requested, but OS version is too low: " + String.valueOf(Build.VERSION.SDK_INT), 2);
|
||||
break;
|
||||
case sendBroadcast:
|
||||
Actions.sendBroadcast(context, this.getParameter2());
|
||||
break;
|
||||
case runExecutable:
|
||||
String[] execParts = this.getParameter2().split(Action.actionParameter2Split);
|
||||
if(execParts.length == 1)
|
||||
Actions.runExecutable(context, this.getParameter1(), execParts[0], null);
|
||||
else if(execParts.length == 2)
|
||||
Actions.runExecutable(context, this.getParameter1(), execParts[0], execParts[1]);
|
||||
break;
|
||||
case wakelock:
|
||||
if(this.getParameter1())
|
||||
Actions.wakeLockStart(context, Long.parseLong(this.getParameter2()));
|
||||
else
|
||||
Actions.wakeLockStop();
|
||||
break;
|
||||
default:
|
||||
Miscellaneous.logEvent("w", "Action", context.getResources().getString(R.string.unknownActionSpecified), 3);
|
||||
break;
|
||||
@ -554,7 +693,7 @@ public class Action
|
||||
//Do something with result
|
||||
//Toast.makeText(context, text, duration) result;
|
||||
Miscellaneous.logEvent("i", "HTTP RESULT", result, 3);
|
||||
Actions myAction=new Actions();
|
||||
Actions myAction = new Actions();
|
||||
myAction.useDownloadedWebpage(result);
|
||||
}
|
||||
}
|
||||
|
@ -8,13 +8,15 @@ import android.app.PendingIntent;
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.BluetoothManager;
|
||||
import android.bluetooth.BluetoothProfile;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.media.session.MediaController;
|
||||
import android.media.session.MediaSessionManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Uri;
|
||||
import android.net.wifi.WifiManager;
|
||||
@ -24,20 +26,26 @@ import android.os.PowerManager.WakeLock;
|
||||
import android.os.VibrationEffect;
|
||||
import android.os.Vibrator;
|
||||
import android.provider.MediaStore;
|
||||
import android.service.notification.NotificationListenerService;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.telephony.SmsManager;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
import android.view.WindowManager;
|
||||
import android.view.KeyEvent;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.legacy.content.WakefulBroadcastReceiver;
|
||||
|
||||
import com.jens.automation2.actions.wifi_router.MyOnStartTetheringCallback;
|
||||
import com.jens.automation2.actions.wifi_router.MyOreoWifiManager;
|
||||
import com.jens.automation2.location.WifiBroadcastReceiver;
|
||||
import com.jens.automation2.receivers.ConnectivityReceiver;
|
||||
import com.jens.automation2.receivers.NotificationListener;
|
||||
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.conn.ClientConnectionManager;
|
||||
import org.apache.http.conn.scheme.Scheme;
|
||||
@ -46,7 +54,12 @@ import org.apache.http.conn.ssl.SSLSocketFactory;
|
||||
import org.apache.http.conn.util.InetAddressUtils;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@ -54,9 +67,13 @@ import java.lang.reflect.Method;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.security.KeyStore;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
|
||||
@ -64,14 +81,9 @@ import eu.chainfire.libsuperuser.Shell;
|
||||
|
||||
public class Actions
|
||||
{
|
||||
public static AutomationService autoMationServerRef;
|
||||
public static AutomationService automationServerRef;
|
||||
public static Context context;
|
||||
public static Context rootetcontext;
|
||||
private static Intent playMusicIntent;
|
||||
private static boolean suAvailable = false;
|
||||
private static String suVersion = null;
|
||||
private static String suVersionInternal = null;
|
||||
private static List<String> suResult = null;
|
||||
public final static String smsSeparator = "&sms&";
|
||||
public final static String dummyPackageString = "dummyPkg239asd";
|
||||
|
||||
@ -79,11 +91,149 @@ public class Actions
|
||||
public static final String wireguard_tunnel_down = "com.wireguard.android.action.SET_TUNNEL_DOWN";
|
||||
public static final String wireguard_tunnel_refresh = "com.wireguard.android.action.REFRESH_TUNNEL_STATES";
|
||||
|
||||
public static class WifiStuff
|
||||
{
|
||||
public static Boolean setWifi(Context context, Boolean desiredState, boolean toggleActionIfPossible)
|
||||
public static void createNotification(Action action)
|
||||
{
|
||||
String[] elements = action.getParameter2().split(Action.actionParameter2Split);
|
||||
|
||||
Miscellaneous.logEvent("w", "createNotification", "Creating notification with title " + elements[0] + " and text " + elements[1], 3);
|
||||
|
||||
int notificationId = Math.round(Calendar.getInstance().getTimeInMillis()/1000);
|
||||
|
||||
try
|
||||
{
|
||||
if(context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q)
|
||||
String title = Miscellaneous.replaceVariablesInText(elements[0], Miscellaneous.getAnyContext());
|
||||
String text = Miscellaneous.replaceVariablesInText(elements[1], Miscellaneous.getAnyContext());
|
||||
Miscellaneous.createDismissibleNotification(title, text, notificationId, false, AutomationService.NOTIFICATION_CHANNEL_ID_RULES, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("w", "createNotification", "Error occurred while replacing vars: " + Log.getStackTraceString(e), 3);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
public static void closeNotification(Action action)
|
||||
{
|
||||
NotificationManager nm = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
for(StatusBarNotification n : nm.getActiveNotifications())
|
||||
{
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
|
||||
{
|
||||
String[] params = action.getParameter2().split(Action.actionParameter2Split);
|
||||
|
||||
String myApp = params[0];
|
||||
String myTitleDir = params[1];
|
||||
String requiredTitle = params[2];
|
||||
String myTextDir = params[3];
|
||||
String requiredText = "";
|
||||
String method = ActivityManageActionCloseNotification.dismissRegularString;
|
||||
|
||||
if(params.length >= 5)
|
||||
requiredText = params[4];
|
||||
|
||||
if(params.length >= 6 && !params[5].equals(ActivityManageActionCloseNotification.dismissRegularString))
|
||||
method = params[5];
|
||||
|
||||
for (StatusBarNotification sbn : NotificationListener.getInstance().getActiveNotifications())
|
||||
{
|
||||
NotificationListener.SimpleNotification sn = NotificationListener.convertNotificationToSimpleNotification(true, sbn);
|
||||
|
||||
Miscellaneous.logEvent("i", "NotificationCloseCheck", "Checking if this notification should be closed in the context of rule " + action.getParentRule().getName() + ": "+ sn.toString(), 5);
|
||||
|
||||
if (!myApp.equals(Trigger.anyAppString))
|
||||
{
|
||||
if (!myApp.equalsIgnoreCase(sn.getApp()))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "NotificationCloseCheck", "Notification app name does not match rule.", 5);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
Notifications from Automation are disregarded to avoid infinite loops.
|
||||
*/
|
||||
if(myApp.equals(BuildConfig.APPLICATION_ID))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
If there are multiple notifications ("stacked") title or text might be null:
|
||||
https://stackoverflow.com/questions/28047767/notificationlistenerservice-not-reading-text-of-stacked-notifications
|
||||
*/
|
||||
|
||||
// T I T L E
|
||||
if (!StringUtils.isEmpty(requiredTitle))
|
||||
{
|
||||
if (!Miscellaneous.compare(myTitleDir, requiredTitle, sn.getTitle()))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "NotificationCloseCheck", "Notification title does not match rule.", 5);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// T E X T
|
||||
if (!StringUtils.isEmpty(requiredText))
|
||||
{
|
||||
if (!Miscellaneous.compare(myTextDir, requiredText, sn.getText()))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "NotificationCloseCheck", "Notification text does not match rule.", 5);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "NotificationCloseCheck", "All criteria matches. Closing notification: " + sbn.getNotification().toString(), 3);
|
||||
if(NotificationListener.getInstance() != null)
|
||||
{
|
||||
if(method == ActivityManageActionCloseNotification.dismissRegularString)
|
||||
NotificationListener.getInstance().dismissNotification(sbn);
|
||||
else
|
||||
NotificationListener.getInstance().clickNotificationButton(sbn, method);
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("i", "NotificationCloseCheck", "NotificationListener instance is null. Can\'t close notification.", 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendBroadcast(Context context, String action)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "sendBroadcast", "Sending broadcast with action " + action, 5);
|
||||
Intent broadcastIntent = new Intent();
|
||||
|
||||
if(action.contains(Action.actionParameter2Split))
|
||||
{
|
||||
String[] parts = action.split(Action.actionParameter2Split);
|
||||
broadcastIntent.setAction(parts[0]);
|
||||
|
||||
String[] intentparts = parts[1].split(";");
|
||||
broadcastIntent = packParametersIntoIntent(broadcastIntent, intentparts, 0);
|
||||
}
|
||||
else
|
||||
broadcastIntent.setAction(action);
|
||||
|
||||
context.sendBroadcast(broadcastIntent);
|
||||
}
|
||||
|
||||
public static class WifiStuff
|
||||
{
|
||||
public static Boolean setWifi(Context context, Boolean desiredState, String parameter2, boolean toggleActionIfPossible)
|
||||
{
|
||||
boolean forceUseRoot = false;
|
||||
|
||||
try
|
||||
{
|
||||
forceUseRoot = Boolean.parseBoolean(parameter2);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if(context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q || forceUseRoot)
|
||||
return setWifiWithRoot(context, desiredState, toggleActionIfPossible);
|
||||
else
|
||||
return setWifiOldFashioned(context, desiredState, toggleActionIfPossible);
|
||||
@ -119,8 +269,15 @@ public class Actions
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Wifi", "Changing wifi to " + String.valueOf(desiredState), 4);
|
||||
|
||||
if (desiredState && Settings.useWifiForPositioning)
|
||||
WifiBroadcastReceiver.startWifiReceiver(autoMationServerRef.getLocationProvider());
|
||||
try
|
||||
{
|
||||
if (desiredState && Settings.useWifiForPositioning)
|
||||
WifiBroadcastReceiver.startWifiReceiver(automationServerRef.getLocationProvider());
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("w", "setWifiOldFashioned()", Log.getStackTraceString(e), 4);
|
||||
}
|
||||
|
||||
WifiManager myWifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
|
||||
@ -648,29 +805,21 @@ public class Actions
|
||||
return false;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
public static void setDoNotDisturb(Context context, int desiredSetting)
|
||||
public static void setDoNotDisturb(Context context, int desiredDndMode)
|
||||
{
|
||||
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
// Check if the notification policy access has been granted for the app.
|
||||
/* if (!notificationManager.isNotificationPolicyAccessGranted())
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||
{
|
||||
Intent intent = new Intent(android.provider.Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS);
|
||||
startActivity(intent);
|
||||
return;
|
||||
}*/
|
||||
/*
|
||||
if (!notificationManager.isNotificationPolicyAccessGranted())
|
||||
--> done externally
|
||||
*/
|
||||
|
||||
notificationManager.setInterruptionFilter(desiredSetting);
|
||||
|
||||
/*if (notificationManager.getCurrentInterruptionFilter() == NotificationManager.INTERRUPTION_FILTER_ALL)
|
||||
{
|
||||
notificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_NONE);
|
||||
Miscellaneous.logEvent("i", context.getResources().getString(R.string.soundSettings), "Changing DND to " + String.valueOf(desiredDndMode), 4);
|
||||
NotificationManager mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
mNotificationManager.setInterruptionFilter(desiredDndMode);
|
||||
}
|
||||
else
|
||||
{
|
||||
notificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_ALL);
|
||||
}*/
|
||||
Miscellaneous.logEvent("w", context.getResources().getString(R.string.soundSettings), "Cannot change DND to " + String.valueOf(desiredDndMode) + ". This Android version is too and doesn\'t have that feature, yet.", 4);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
@ -694,7 +843,7 @@ public class Actions
|
||||
// am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
|
||||
// }
|
||||
// else
|
||||
myAudioManager.setRingerMode(desiredSoundSetting);
|
||||
myAudioManager.setRingerMode(desiredSoundSetting);
|
||||
}
|
||||
|
||||
private static String getIPAddressUsb(final boolean useIPv4)
|
||||
@ -807,18 +956,6 @@ public class Actions
|
||||
}
|
||||
}
|
||||
|
||||
public static void setDND(Context context, int desiredDndMode)
|
||||
{
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||
{
|
||||
Miscellaneous.logEvent("i", context.getResources().getString(R.string.soundSettings), "Changing DND to " + String.valueOf(desiredDndMode), 4);
|
||||
NotificationManager mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
mNotificationManager.setInterruptionFilter(desiredDndMode);
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("w", context.getResources().getString(R.string.soundSettings), "Cannot change DND to " + String.valueOf(desiredDndMode) + ". This Android version is too and doesn\'t have that feature, yet.", 4);
|
||||
}
|
||||
|
||||
public void useDownloadedWebpage(String result)
|
||||
{
|
||||
// Toast.makeText(context, "Result: " + result, Toast.LENGTH_LONG).show();
|
||||
@ -886,8 +1023,6 @@ public class Actions
|
||||
{
|
||||
Intent externalActivityIntent;
|
||||
|
||||
int paramsStartIndex;
|
||||
|
||||
if (!startByAction)
|
||||
{
|
||||
// selected by activity
|
||||
@ -899,8 +1034,6 @@ public class Actions
|
||||
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Starting app by activity: " + packageName + " " + className, 3);
|
||||
|
||||
paramsStartIndex = 2;
|
||||
|
||||
externalActivityIntent = new Intent(Intent.ACTION_MAIN);
|
||||
externalActivityIntent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
|
||||
@ -928,9 +1061,25 @@ public class Actions
|
||||
externalActivityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
// Pack intents
|
||||
for (int i = 3; i < params.length; i++)
|
||||
{
|
||||
String[] singleParam = params[i].split(Action.intentPairSeperator);
|
||||
externalActivityIntent = packParametersIntoIntent(externalActivityIntent, params, 3);
|
||||
|
||||
if (params[2].equals(ActivityManageActionStartActivity.startByActivityString))
|
||||
automationServerRef.startActivity(externalActivityIntent);
|
||||
else
|
||||
automationServerRef.sendBroadcast(externalActivityIntent);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "StartOtherApp", automationServerRef.getResources().getString(R.string.errorStartingOtherActivity) + ": " + Log.getStackTraceString(e), 2);
|
||||
Toast.makeText(automationServerRef, automationServerRef.getResources().getString(R.string.errorStartingOtherActivity) + ": " + e.getMessage(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
public static Intent packParametersIntoIntent(Intent intent, String[] params, int startIndex)
|
||||
{
|
||||
for (int i = startIndex; i < params.length; i++)
|
||||
{
|
||||
String[] singleParam = params[i].split(Action.intentPairSeparator);
|
||||
|
||||
/*Class c = Class.forName(singleParam[0]);
|
||||
for(Method m : c.getMethods())
|
||||
@ -942,83 +1091,74 @@ public class Actions
|
||||
}
|
||||
}*/
|
||||
|
||||
if (singleParam[0].equals("boolean"))
|
||||
if (singleParam[0].equals("boolean"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], Boolean.parseBoolean(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("byte"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], Byte.parseByte(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("char"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], singleParam[2].charAt(0));
|
||||
}
|
||||
else if (singleParam[0].equals("CharSequence"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], (CharSequence) singleParam[2]);
|
||||
}
|
||||
else if (singleParam[0].equals("double"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], Double.parseDouble(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("float"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], Float.parseFloat(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("int"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], Integer.parseInt(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("long"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], Long.parseLong(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("short"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], Short.parseShort(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("Uri"))
|
||||
{
|
||||
if (singleParam[1].equalsIgnoreCase("IntentData"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], Boolean.parseBoolean(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("byte"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], Byte.parseByte(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("char"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], singleParam[2].charAt(0));
|
||||
}
|
||||
else if (singleParam[0].equals("CharSequence"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], (CharSequence) singleParam[2]);
|
||||
}
|
||||
else if (singleParam[0].equals("double"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], Double.parseDouble(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("float"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], Float.parseFloat(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("int"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], Integer.parseInt(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("long"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], Long.parseLong(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("short"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], Short.parseShort(singleParam[2]));
|
||||
}
|
||||
else if (singleParam[0].equals("Uri"))
|
||||
{
|
||||
if (singleParam[1].equalsIgnoreCase("IntentData"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with value " + singleParam[2] + " as standard data parameter.", 3);
|
||||
externalActivityIntent.setData(Uri.parse(singleParam[2]));
|
||||
}
|
||||
else
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], Uri.parse(singleParam[2]));
|
||||
}
|
||||
}
|
||||
else if (singleParam[0].equals("String"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
externalActivityIntent.putExtra(singleParam[1], singleParam[2]);
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with value " + singleParam[2] + " as standard data parameter.", 3);
|
||||
intent.setData(Uri.parse(singleParam[2]));
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("w", "StartOtherApp", "Unknown type of parameter " + singleParam[0] + " found. Name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], Uri.parse(singleParam[2]));
|
||||
}
|
||||
}
|
||||
else if (singleParam[0].equals("String"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
intent.putExtra(singleParam[1], singleParam[2]);
|
||||
}
|
||||
|
||||
if (params[2].equals(ActivityManageActionStartActivity.startByActivityString))
|
||||
autoMationServerRef.startActivity(externalActivityIntent);
|
||||
else
|
||||
autoMationServerRef.sendBroadcast(externalActivityIntent);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "StartOtherApp", autoMationServerRef.getResources().getString(R.string.errorStartingOtherActivity) + ": " + Log.getStackTraceString(e), 2);
|
||||
Toast.makeText(autoMationServerRef, autoMationServerRef.getResources().getString(R.string.errorStartingOtherActivity) + ": " + e.getMessage(), Toast.LENGTH_LONG).show();
|
||||
Miscellaneous.logEvent("w", "StartOtherApp", "Unknown type of parameter " + singleParam[0] + " found. Name " + singleParam[1] + " and value " + singleParam[2], 3);
|
||||
}
|
||||
|
||||
return intent;
|
||||
}
|
||||
|
||||
public static void waitBeforeNextAction(Long waitTime)
|
||||
@ -1074,7 +1214,7 @@ public class Actions
|
||||
|
||||
PendingIntent pi = PendingIntent.getActivity(context, 0, new Intent(context, Actions.class), 0);
|
||||
SmsManager sms = SmsManager.getDefault();
|
||||
sms.sendTextMessage(phoneNumber, null, message, pi, null);
|
||||
sms.sendTextMessage(phoneNumber, null, textToSend, pi, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -1201,7 +1341,7 @@ public class Actions
|
||||
|
||||
try
|
||||
{
|
||||
boolean isEnabled = ConnectivityReceiver.isAirplaneMode(autoMationServerRef);
|
||||
boolean isEnabled = ConnectivityReceiver.isAirplaneMode(automationServerRef);
|
||||
|
||||
if (isEnabled)
|
||||
Miscellaneous.logEvent("i", "Airplane mode", "Current status is enabled.", 4);
|
||||
@ -1315,7 +1455,7 @@ public class Actions
|
||||
try
|
||||
{
|
||||
String textToSpeak = Miscellaneous.replaceVariablesInText(parameter2, context);
|
||||
autoMationServerRef.speak(textToSpeak, true);
|
||||
automationServerRef.speak(textToSpeak, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -1345,23 +1485,7 @@ public class Actions
|
||||
playMusicIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(playMusicIntent);
|
||||
|
||||
// playMusicIntent = new Intent();
|
||||
// playMusicIntent.setAction(android.content.Intent.ACTION_VIEW);
|
||||
// File file = new File(YOUR_SONG_URI);
|
||||
// playMusicIntent.setDataAndType(Uri.fromFile(file), "audio/*");
|
||||
// context.startActivity(playMusicIntent);
|
||||
|
||||
return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if(playMusicIntent != null)
|
||||
// {
|
||||
// context.stopService(playMusicIntent);
|
||||
// }
|
||||
// }
|
||||
|
||||
// return false;
|
||||
}
|
||||
catch (ActivityNotFoundException e)
|
||||
{
|
||||
@ -1377,6 +1501,45 @@ public class Actions
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
public static boolean controlMediaPlayback(Context context, int command)
|
||||
{
|
||||
int keyCode = -1;
|
||||
switch(command)
|
||||
{
|
||||
case 0:
|
||||
keyCode = KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE;
|
||||
break;
|
||||
case 1:
|
||||
keyCode = KeyEvent.KEYCODE_MEDIA_PLAY;
|
||||
break;
|
||||
case 2:
|
||||
keyCode = KeyEvent.KEYCODE_MEDIA_PAUSE;
|
||||
break;
|
||||
case 3:
|
||||
keyCode = KeyEvent.KEYCODE_MEDIA_STOP;
|
||||
break;
|
||||
case 4:
|
||||
keyCode = KeyEvent.KEYCODE_MEDIA_PREVIOUS;
|
||||
break;
|
||||
case 5:
|
||||
keyCode = KeyEvent.KEYCODE_MEDIA_NEXT;
|
||||
break;
|
||||
}
|
||||
|
||||
return controlMediaByDispatch(keyCode);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
static boolean controlMediaByDispatch(int keyCode)
|
||||
{
|
||||
AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||
KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN, keyCode);
|
||||
mAudioManager.dispatchMediaKeyEvent(event);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private String getTransactionCode()
|
||||
{
|
||||
try
|
||||
@ -1490,7 +1653,7 @@ public class Actions
|
||||
{
|
||||
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.O_MR1)
|
||||
{
|
||||
if(MobileDataStuff.setMobileNetworkFromAndroid9(desiredState, autoMationServerRef))
|
||||
if(MobileDataStuff.setMobileNetworkFromAndroid9(desiredState, automationServerRef))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "setDataConnectionWithRoot()", Miscellaneous.getAnyContext().getResources().getString(R.string.dataConWithRootSuccess), 2);
|
||||
return true;
|
||||
@ -1503,7 +1666,7 @@ public class Actions
|
||||
}
|
||||
else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP)
|
||||
{
|
||||
if (MobileDataStuff.setMobileNetworkTillAndroid5(desiredState, autoMationServerRef))
|
||||
if (MobileDataStuff.setMobileNetworkTillAndroid5(desiredState, automationServerRef))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "setDataConnectionWithRoot()", Miscellaneous.getAnyContext().getResources().getString(R.string.dataConWithRootSuccess), 2);
|
||||
return true;
|
||||
@ -1516,7 +1679,7 @@ public class Actions
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MobileDataStuff.setMobileNetworkAndroid6Till8(desiredState, autoMationServerRef))
|
||||
if (MobileDataStuff.setMobileNetworkAndroid6Till8(desiredState, automationServerRef))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "setDataConnectionWithRoot()", Miscellaneous.getAnyContext().getResources().getString(R.string.dataConWithRootSuccess), 2);
|
||||
return true;
|
||||
@ -1725,6 +1888,12 @@ public class Actions
|
||||
|
||||
protected static boolean executeCommandViaSu(String[] commands)
|
||||
{
|
||||
boolean suAvailable = false;
|
||||
String suVersion = null;
|
||||
String suVersionInternal = null;
|
||||
// List<String> suResult = null;
|
||||
int suResult;
|
||||
|
||||
boolean success = false;
|
||||
|
||||
try
|
||||
@ -1734,17 +1903,30 @@ public class Actions
|
||||
{
|
||||
suVersion = Shell.SU.version(false);
|
||||
suVersionInternal = Shell.SU.version(true);
|
||||
suResult = Shell.SU.run(commands);
|
||||
|
||||
if (suResult != null)
|
||||
Miscellaneous.logEvent("i", "executeCommandViaSu()", "suVersion: " + suVersion + ", suVersionInternal: " + suVersionInternal, 5);
|
||||
|
||||
// suResult = Shell.SU.run(commands);
|
||||
suResult = Shell.Pool.SU.run(commands);
|
||||
|
||||
// if (suResult != null)
|
||||
// success = true;
|
||||
|
||||
Miscellaneous.logEvent("i", "executeCommandViaSu()", "RC=" + String.valueOf(suResult), 3);
|
||||
|
||||
if(suResult == 0)
|
||||
success = true;
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("w", "executeCommandViaSu()", "su not available.", 4);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "executeCommandViaSu()", "Returning " + String.valueOf(success), 4);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@ -1770,4 +1952,244 @@ public class Actions
|
||||
return android.provider.Settings.Global.getInt(context.getContentResolver(), android.provider.Settings.Global.AIRPLANE_MODE_ON, 0) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean runExecutable(Context context, boolean runAsRoot, String path, String parameters)
|
||||
{
|
||||
if(runAsRoot)
|
||||
{
|
||||
if(!StringUtils.isEmpty(parameters))
|
||||
return executeCommandViaSu(new String[] { path + " " + parameters });
|
||||
else
|
||||
return executeCommandViaSu(new String[] { path });
|
||||
}
|
||||
else
|
||||
{
|
||||
Object[] result;
|
||||
|
||||
File executable = new File(path);
|
||||
File workingDir = new File(executable.getParent());
|
||||
|
||||
if(!StringUtils.isEmpty(parameters))
|
||||
result = runExternalApplication(path, 0, workingDir, parameters);
|
||||
else
|
||||
result = runExternalApplication(path, 0, workingDir, null);
|
||||
|
||||
boolean execResult = (boolean) result[0];
|
||||
|
||||
return execResult;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param commandToExecute
|
||||
* @param timeout
|
||||
* @param params
|
||||
* @return Returns an array: 0=exit code, 1=cmdline output
|
||||
*/
|
||||
public static Object[] runExternalApplication(String commandToExecute, long timeout, File workingDirectory, String params)
|
||||
{
|
||||
/*
|
||||
* Classes stolen from https://github.com/stleary/JSON-java
|
||||
*/
|
||||
|
||||
String fullCommand;
|
||||
|
||||
if(!StringUtils.isEmpty(params))
|
||||
fullCommand = commandToExecute + " " + params;
|
||||
else
|
||||
fullCommand = commandToExecute;
|
||||
|
||||
Miscellaneous.logEvent("i", "Running executable", "Running external application " + fullCommand, 4);
|
||||
|
||||
Object[] returnObject = new Object[2];
|
||||
|
||||
StringBuilder output = new StringBuilder();
|
||||
String line = null;
|
||||
OutputStream stdin = null;
|
||||
InputStream stderr = null;
|
||||
InputStream stdout = null;
|
||||
|
||||
try
|
||||
{
|
||||
Process process = null;
|
||||
|
||||
if(workingDirectory != null)
|
||||
process = Runtime.getRuntime().exec(fullCommand, null, workingDirectory);
|
||||
else
|
||||
process = Runtime.getRuntime().exec(fullCommand);
|
||||
stdin = process.getOutputStream ();
|
||||
stderr = process.getErrorStream ();
|
||||
stdout = process.getInputStream ();
|
||||
|
||||
// "write" the parms into stdin
|
||||
/*line = "param1" + "\n";
|
||||
stdin.write(line.getBytes() );
|
||||
stdin.flush();
|
||||
|
||||
line = "param2" + "\n";
|
||||
stdin.write(line.getBytes() );
|
||||
stdin.flush();
|
||||
|
||||
line = "param3" + "\n";
|
||||
stdin.write(line.getBytes() );
|
||||
stdin.flush();*/
|
||||
|
||||
stdin.close();
|
||||
|
||||
// clean up if any output in stdout
|
||||
BufferedReader brCleanUp = new BufferedReader (new InputStreamReader (stdout));
|
||||
while ((line = brCleanUp.readLine ()) != null)
|
||||
{
|
||||
Miscellaneous.logEvent ("i", "Running executable", "[Stdout] " + line, 4);
|
||||
output.append(line);
|
||||
}
|
||||
brCleanUp.close();
|
||||
|
||||
// clean up if any output in stderr
|
||||
brCleanUp = new BufferedReader (new InputStreamReader(stderr));
|
||||
while ((line = brCleanUp.readLine ()) != null)
|
||||
{
|
||||
Miscellaneous.logEvent ("i", "Running executable", "[Stderr] " + line, 4);
|
||||
output.append(line);
|
||||
}
|
||||
brCleanUp.close();
|
||||
|
||||
try
|
||||
{
|
||||
// Wait for the process to exit, we want the return code
|
||||
if(timeout > 0 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!process.waitFor(timeout, TimeUnit.MILLISECONDS))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Running executable", "Timeout of " + String.valueOf(timeout) + " ms reached. Killing check attempt.", 3);
|
||||
process.destroyForcibly();
|
||||
}
|
||||
}
|
||||
catch(NoSuchMethodError e)
|
||||
{
|
||||
process.waitFor();
|
||||
}
|
||||
}
|
||||
else
|
||||
process.waitFor();
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Running executable", "Waiting for process failed: " + Log.getStackTraceString(e), 4);
|
||||
Miscellaneous.logEvent("i", "Running executable", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
|
||||
if(process.exitValue() == 0)
|
||||
Miscellaneous.logEvent("i", "Running executable", "ReturnCode: " + String.valueOf(process.exitValue()), 4);
|
||||
else
|
||||
Miscellaneous.logEvent("i", "Running executable", "External execution (RC=" + String.valueOf(process.exitValue()) + ") returned error: " + output.toString(), 3);
|
||||
|
||||
returnObject[0] = process.exitValue();
|
||||
returnObject[1] = output.toString();
|
||||
|
||||
return returnObject;
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "Running executable", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
|
||||
Miscellaneous.logEvent("i", "Running executable", "Error running external application.", 1);
|
||||
|
||||
// if(slotMap != null)
|
||||
// for(String key : slotMap.keySet())
|
||||
// System.clearProperty(key);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isTetheringActive1(Context context)
|
||||
{
|
||||
try
|
||||
{
|
||||
for(Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();)
|
||||
{
|
||||
NetworkInterface intf = en.nextElement();
|
||||
|
||||
for(Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();)
|
||||
{
|
||||
InetAddress inetAddress = enumIpAddr.nextElement();
|
||||
|
||||
if(!intf.isLoopback())
|
||||
{
|
||||
if(intf.getName().contains("rndis"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "isTetheringActive()", Log.getStackTraceString(e), 3);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public final static int wakeLockTimeoutDisabled = -1;
|
||||
static boolean wakeLockStopRequested = false;
|
||||
public static void wakeLockStart(Context context, long duration)
|
||||
{
|
||||
Thread lockThread = new Thread(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
wakeLockStopRequested = false;
|
||||
|
||||
long waited = 0;
|
||||
int step = 2000;
|
||||
|
||||
try
|
||||
{
|
||||
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||
PowerManager.WakeLock fullWakeLock = powerManager.newWakeLock((PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP), "Loneworker - FULL WAKE LOCK");
|
||||
fullWakeLock.acquire(); // turn on
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(step); // turn on duration
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(duration > 0)
|
||||
waited += step;
|
||||
|
||||
if(wakeLockStopRequested) //stop requested
|
||||
Miscellaneous.logEvent("i", "WakeLockStart", "Stop requested.", 4);
|
||||
}
|
||||
while(!wakeLockStopRequested && (duration < 0 || waited <= duration));
|
||||
|
||||
fullWakeLock.release();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
lockThread.start();
|
||||
}
|
||||
|
||||
public static void wakeLockStop()
|
||||
{
|
||||
Miscellaneous.logEvent("i", "WakeLockStart", "Requesting stop.", 4);
|
||||
wakeLockStopRequested = true;
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -20,8 +21,9 @@ import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ActivityMaintenance extends Activity
|
||||
public class ActivityControlCenter extends Activity
|
||||
{
|
||||
final static int requestCodeImport = 1001;
|
||||
final static int requestCodeExport = 1002;
|
||||
@ -30,13 +32,14 @@ public class ActivityMaintenance extends Activity
|
||||
final static String prefsFileName = "com.jens.automation2_preferences.xml";
|
||||
|
||||
TextView tvFileStoreLocation, tvAppVersion;
|
||||
Button bVolumeTest, bMoreSettings, bSettingsSetToDefault, bShareConfigAndLog, bImportConfiguration, bExportConfiguration;
|
||||
Button bVolumeTest, bMoreSettings, bSettingsSetToDefault, bSendEmailToDev, bImportConfiguration, bExportConfiguration;
|
||||
CheckBox chkShareConfigAndLog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_maintenance);
|
||||
setContentView(R.layout.activity_control_center);
|
||||
|
||||
bVolumeTest = (Button) findViewById(R.id.bVolumeTest);
|
||||
bVolumeTest.setOnClickListener(new View.OnClickListener()
|
||||
@ -44,18 +47,25 @@ public class ActivityMaintenance extends Activity
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
Intent intent = new Intent(ActivityMaintenance.this, ActivityVolumeTest.class);
|
||||
Intent intent = new Intent(ActivityControlCenter.this, ActivityVolumeTest.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
bShareConfigAndLog = (Button) findViewById(R.id.bShareConfigAndLog);
|
||||
bShareConfigAndLog.setOnClickListener(new View.OnClickListener()
|
||||
chkShareConfigAndLog = (CheckBox)findViewById(R.id.chkShareConfigAndLog);
|
||||
bSendEmailToDev = (Button) findViewById(R.id.bSendEmailToDev);
|
||||
bSendEmailToDev.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
getShareConfigAndLogDialogue(ActivityMaintenance.this).show();
|
||||
if(chkShareConfigAndLog.isChecked())
|
||||
getShareConfigAndLogDialogue(ActivityControlCenter.this).show();
|
||||
else
|
||||
{
|
||||
String subject = "Automation";
|
||||
Miscellaneous.sendEmail(ActivityControlCenter.this, "android-development@gmx.de", "Automation logs", getSystemInfo(), null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -65,17 +75,17 @@ public class ActivityMaintenance extends Activity
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
getDefaultSettingsDialog(ActivityMaintenance.this).show();
|
||||
getDefaultSettingsDialog(ActivityControlCenter.this).show();
|
||||
}
|
||||
});
|
||||
|
||||
Button bMoreSettings = (Button) findViewById(R.id.bMoreSettings);
|
||||
bMoreSettings = (Button) findViewById(R.id.bMoreSettings);
|
||||
bMoreSettings.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
Intent myIntent = new Intent(ActivityMaintenance.this, ActivitySettings.class);
|
||||
Intent myIntent = new Intent(ActivityControlCenter.this, ActivitySettings.class);
|
||||
startActivityForResult(myIntent, requestCodeMoreSettings);
|
||||
}
|
||||
});
|
||||
@ -123,7 +133,7 @@ public class ActivityMaintenance extends Activity
|
||||
if (AutomationService.isMyServiceRunning(this))
|
||||
AutomationService.getInstance().serviceInterface(AutomationService.serviceCommands.reloadSettings);
|
||||
|
||||
if (AutomationService.isMyServiceRunning(ActivityMaintenance.this))
|
||||
if (AutomationService.isMyServiceRunning(ActivityControlCenter.this))
|
||||
Toast.makeText(this, getResources().getString(R.string.settingsWillTakeTime), Toast.LENGTH_LONG).show();
|
||||
|
||||
break;
|
||||
@ -170,7 +180,7 @@ public class ActivityMaintenance extends Activity
|
||||
if (Miscellaneous.copyDocumentFileToFile(file, dstRules))
|
||||
filesImported++;
|
||||
else
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.rulesImportError), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.rulesImportError), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
else if (file.getName().equals(prefsFileName))
|
||||
@ -183,7 +193,7 @@ public class ActivityMaintenance extends Activity
|
||||
if (Miscellaneous.copyDocumentFileToFile(file, dstPrefs))
|
||||
filesImported++;
|
||||
else
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.prefsImportError), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.prefsImportError), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -191,12 +201,12 @@ public class ActivityMaintenance extends Activity
|
||||
if(applicableFilesFound > 0)
|
||||
{
|
||||
if(filesImported == 0)
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.noFilesImported), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.noFilesImported), Toast.LENGTH_LONG).show();
|
||||
else if(filesImported < applicableFilesFound)
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.notAllFilesImported), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.notAllFilesImported), Toast.LENGTH_LONG).show();
|
||||
else if (filesImported == applicableFilesFound)
|
||||
{
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.configurationImportedSuccessfully), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.configurationImportedSuccessfully), Toast.LENGTH_LONG).show();
|
||||
|
||||
try
|
||||
{
|
||||
@ -208,19 +218,23 @@ public class ActivityMaintenance extends Activity
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "Reading import", "Rules re-read failed: " + Log.getStackTraceString(e), 1);
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.errorReadingPoisAndRulesFromFile), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.errorReadingPoisAndRulesFromFile), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
Settings.readFromPersistentStorage(ActivityMaintenance.this);
|
||||
Settings.readFromPersistentStorage(ActivityControlCenter.this);
|
||||
|
||||
AutomationService service = AutomationService.getInstance();
|
||||
if(service != null && service.isRunning)
|
||||
service.applySettingsAndRules();
|
||||
}
|
||||
else
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.noFilesImported), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.noFilesImported), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
else
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.noApplicableFilesFoundInDirectory), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.noApplicableFilesFoundInDirectory), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
else
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.noApplicableFilesFoundInDirectory), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.noApplicableFilesFoundInDirectory), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
void exportFiles(Uri uriTree)
|
||||
@ -252,12 +266,12 @@ public class ActivityMaintenance extends Activity
|
||||
if(dstRules.canWrite() && dstPrefs.canWrite())
|
||||
{
|
||||
if(Miscellaneous.copyFileToDocumentFile(srcRules, dstRules) && Miscellaneous.copyFileToDocumentFile(srcPrefs, dstPrefs))
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.configurationExportedSuccessfully), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.configurationExportedSuccessfully), Toast.LENGTH_LONG).show();
|
||||
else
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.ConfigurationExportError), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.ConfigurationExportError), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
else
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.ConfigurationExportError), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.ConfigurationExportError), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
private static AlertDialog getDefaultSettingsDialog(final Context context)
|
||||
@ -296,32 +310,33 @@ public class ActivityMaintenance extends Activity
|
||||
srcFilesList.add(Miscellaneous.getWriteableFolder() + "/../shared_prefs/" + prefsFileName);
|
||||
|
||||
String logFilePath = Miscellaneous.getWriteableFolder() + "/" + Miscellaneous.logFileName;
|
||||
if((new File(logFilePath)).exists())
|
||||
if ((new File(logFilePath)).exists())
|
||||
srcFilesList.add(logFilePath);
|
||||
|
||||
String logFilePathArchive = Miscellaneous.getWriteableFolder() + "/" + Miscellaneous.logFileName + "-old";
|
||||
if((new File(logFilePathArchive)).exists())
|
||||
if ((new File(logFilePathArchive)).exists())
|
||||
srcFilesList.add(logFilePathArchive);
|
||||
|
||||
String[] srcFiles = srcFilesList.toArray(new String[srcFilesList.size()]);
|
||||
|
||||
if(dstZipFile.exists())
|
||||
if (dstZipFile.exists())
|
||||
dstZipFile.delete();
|
||||
|
||||
Miscellaneous.zip(srcFiles, dstZipFile.getAbsolutePath());
|
||||
|
||||
/*
|
||||
Without root the zip file in the cache directory is not directly accessible.
|
||||
But have to route it through this content provider crap.
|
||||
*/
|
||||
/*
|
||||
Without root the zip file in the cache directory is not directly accessible.
|
||||
But have to route it through this content provider crap.
|
||||
*/
|
||||
|
||||
String subject = "Automation logs";
|
||||
|
||||
Uri uri = Uri.parse("content://com.jens.automation2/" + Settings.zipFileName);
|
||||
|
||||
Miscellaneous.sendEmail(ActivityMaintenance.this, "android-development@gmx.de", "Automation logs", getSystemInfo(), uri);
|
||||
Miscellaneous.sendEmail(ActivityControlCenter.this, "android-development@gmx.de", "Automation logs", getSystemInfo(), uri);
|
||||
}
|
||||
});
|
||||
|
||||
alertDialogBuilder.setNegativeButton(context.getResources().getString(R.string.no), null);
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
@ -331,13 +346,37 @@ public class ActivityMaintenance extends Activity
|
||||
public static String getSystemInfo()
|
||||
{
|
||||
StringBuilder systemInfoText = new StringBuilder();
|
||||
systemInfoText.append("App details" + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Version name: " + BuildConfig.VERSION_NAME + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Version code: " + BuildConfig.VERSION_CODE + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Flavor: " + BuildConfig.FLAVOR + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Device details" + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("OS version: " + System.getProperty("os.version") + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("API Level: " + android.os.Build.VERSION.SDK + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Target SDK: " + Miscellaneous.getAnyContext().getApplicationInfo().targetSdkVersion + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Device: " + android.os.Build.DEVICE + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Model: " + android.os.Build.MODEL + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Product: " + android.os.Build.PRODUCT + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Flavor: " + BuildConfig.FLAVOR);
|
||||
systemInfoText.append("Rooted: " + String.valueOf(Miscellaneous.isPhoneRooted()) + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Country: " + Miscellaneous.getUserCountry(Miscellaneous.getAnyContext()) + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("OS language: " + Locale.getDefault().getDisplayName() + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Logfile written: " + String.valueOf(Settings.writeLogFile) + Miscellaneous.lineSeparator);
|
||||
systemInfoText.append("Log level: " + String.valueOf(Settings.logLevel));
|
||||
|
||||
/*
|
||||
I've checked the Locale methods on my Android 4.1.2 device, and the results:
|
||||
|
||||
Locale.getDefault().getLanguage() ---> en
|
||||
Locale.getDefault().getISO3Language() ---> eng
|
||||
Locale.getDefault().getCountry() ---> US
|
||||
Locale.getDefault().getISO3Country() ---> USA
|
||||
Locale.getDefault().getDisplayCountry() ---> United States
|
||||
Locale.getDefault().getDisplayName() ---> English (United States)
|
||||
Locale.getDefault().toString() ---> en_US
|
||||
Locale.getDefault().getDisplayLanguage()---> English
|
||||
Locale.getDefault().toLanguageTag() ---> en-US
|
||||
*/
|
||||
|
||||
return systemInfoText.toString();
|
||||
}
|
||||
|
||||
@ -367,7 +406,7 @@ public class ActivityMaintenance extends Activity
|
||||
{
|
||||
// if you reach this place, it means there is no any file
|
||||
// explorer app installed on your device
|
||||
Toast.makeText(ActivityMaintenance.this, getResources().getString(R.string.noFileManageInstalled), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.noFileManageInstalled), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
@ -25,6 +25,7 @@ import java.util.ArrayList;
|
||||
|
||||
public class ActivityMainRules extends ActivityGeneric
|
||||
{
|
||||
public static final String intentNameRuleName = "ruleName";
|
||||
private ListView ruleListView;
|
||||
ArrayList<Rule> ruleList = new ArrayList<>();
|
||||
private ArrayAdapter<Rule> ruleListViewAdapter;
|
||||
@ -135,7 +136,7 @@ public class ActivityMainRules extends ActivityGeneric
|
||||
else
|
||||
holder = (RuleHolder) v.getTag();
|
||||
|
||||
System.out.println("Position ["+position+"]");
|
||||
// System.out.println("Position ["+position+"]");
|
||||
Rule r = Rule.getRuleCollection().get(position);
|
||||
holder.tvRuleName.setText(r.getName());
|
||||
if(r.isRuleActive())
|
||||
@ -199,6 +200,7 @@ public class ActivityMainRules extends ActivityGeneric
|
||||
AutomationService runContext = AutomationService.getInstance();
|
||||
if(runContext != null)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "ActivityMainRules", "Initiating manual execution of rule " + ruleThisIsAbout.getName(), 3);
|
||||
ruleThisIsAbout.activate(runContext, true);
|
||||
break;
|
||||
}
|
||||
@ -206,8 +208,8 @@ public class ActivityMainRules extends ActivityGeneric
|
||||
Toast.makeText(ActivityMainRules.this, getResources().getString(R.string.serviceHasToRunForThat), Toast.LENGTH_LONG).show();
|
||||
break;
|
||||
case 1:
|
||||
ruleToEdit = ruleThisIsAbout;
|
||||
Intent manageSpecificRuleIntent = new Intent (ActivityMainRules.this, ActivityManageRule.class);
|
||||
manageSpecificRuleIntent.putExtra(intentNameRuleName, ruleThisIsAbout.getName());
|
||||
startActivityForResult(manageSpecificRuleIntent, requestCodeChangeRule);
|
||||
break;
|
||||
case 2:
|
||||
@ -250,15 +252,5 @@ public class ActivityMainRules extends ActivityGeneric
|
||||
}
|
||||
catch(NullPointerException e)
|
||||
{}
|
||||
|
||||
try
|
||||
{
|
||||
if(AutomationService.isMyServiceRunning(this))
|
||||
DateTimeListener.reloadAlarms();
|
||||
}
|
||||
catch(NullPointerException e)
|
||||
{
|
||||
// AlarmManager instance not prepared, yet.
|
||||
}
|
||||
}
|
||||
}
|
@ -3,7 +3,6 @@ package com.jens.automation2;
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
@ -11,7 +10,6 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.util.Xml;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@ -29,29 +27,25 @@ import androidx.core.text.HtmlCompat;
|
||||
|
||||
import com.jens.automation2.AutomationService.serviceCommands;
|
||||
import com.jens.automation2.Trigger.Trigger_Enum;
|
||||
import com.jens.automation2.location.CellLocationChangedReceiver;
|
||||
import com.jens.automation2.location.LocationProvider;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public class ActivityMainScreen extends ActivityGeneric
|
||||
{
|
||||
private static boolean guiChangeInProgress = false;
|
||||
static boolean guiChangeInProgress = false;
|
||||
static ActivityMainScreen activityMainScreenInstance = null;
|
||||
static boolean updateNoteDisplayed = false;
|
||||
static boolean uiUpdateRunning = false;
|
||||
|
||||
private static ActivityMainScreen activityMainScreenInstance = null;
|
||||
private ToggleButton toggleService, tbLockSound;
|
||||
private Button bShowHelp, bPrivacy, bSettingsErase, bAddSoundLockTIme, bDonate;
|
||||
private TextView tvActivePoi, tvClosestPoi, tvLastRule, tvMainScreenNotePermissions, tvMainScreenNoteFeaturesFromOtherFlavor, tvMainScreenNoteLocationImpossibleBlameGoogle, tvMainScreenNoteNews, tvlockSoundDuration;
|
||||
private static boolean updateNoteDisplayed = false;
|
||||
ToggleButton toggleService, tbLockSound;
|
||||
Button bShowHelp, bPrivacy, bAddSoundLockTIme, bDonate, bControlCenter;
|
||||
TextView tvActivePoi, tvClosestPoi, tvLastRule, tvLastProfile, tvMainScreenNotePermissions, tvMainScreenNoteFeaturesFromOtherFlavor, tvMainScreenNoteLocationImpossibleBlameGoogle, tvMainScreenNoteNews, tvLockSoundDuration;
|
||||
|
||||
private ListView lvRuleHistory;
|
||||
private ArrayAdapter<Rule> ruleHistoryListViewAdapter;
|
||||
|
||||
private static boolean uiUpdateRunning = false;
|
||||
ListView lvRuleHistory;
|
||||
ArrayAdapter<Rule> ruleHistoryListViewAdapter;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
@ -74,18 +68,18 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
tvActivePoi = (TextView) findViewById(R.id.tvActivePoi);
|
||||
tvClosestPoi = (TextView) findViewById(R.id.tvClosestPoi);
|
||||
lvRuleHistory = (ListView) findViewById(R.id.lvRuleHistory);
|
||||
tvLastRule = (TextView) findViewById(R.id.tvTimeFrameHelpText);
|
||||
tvLastRule = (TextView) findViewById(R.id.tvLastRule);
|
||||
tvLastProfile = (TextView)findViewById(R.id.tvLastProfile);
|
||||
tvMainScreenNotePermissions = (TextView) findViewById(R.id.tvMainScreenNotePermissions);
|
||||
tvMainScreenNoteFeaturesFromOtherFlavor = (TextView) findViewById(R.id.tvMainScreenNoteFeaturesFromOtherFlavor);
|
||||
tvMainScreenNoteLocationImpossibleBlameGoogle = (TextView) findViewById(R.id.tvMainScreenNoteLocationImpossibleBlameGoogle);
|
||||
tvMainScreenNoteNews = (TextView) findViewById(R.id.tvMainScreenNoteNews);
|
||||
tvlockSoundDuration = (TextView)findViewById(R.id.tvlockSoundDuration);
|
||||
tvLockSoundDuration = (TextView)findViewById(R.id.tvlockSoundDuration);
|
||||
tbLockSound = (ToggleButton) findViewById(R.id.tbLockSound);
|
||||
toggleService = (ToggleButton) findViewById(R.id.tbArmMastListener);
|
||||
|
||||
bDonate = (Button)findViewById(R.id.bDonate);
|
||||
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase("googlePlayFlavor"))
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase(AutomationService.flavor_name_googleplay))
|
||||
bDonate.setVisibility(View.VISIBLE);
|
||||
|
||||
toggleService.setChecked(AutomationService.isMyServiceRunning(this));
|
||||
@ -99,7 +93,8 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
if (toggleService.isChecked())
|
||||
{
|
||||
startAutomationService(getBaseContext(), false);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
stopAutomationService();
|
||||
}
|
||||
@ -147,13 +142,13 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
}
|
||||
});
|
||||
|
||||
Button bSettings = (Button) findViewById(R.id.bSettings);
|
||||
bSettings.setOnClickListener(new OnClickListener()
|
||||
bControlCenter = (Button) findViewById(R.id.bControlCenter);
|
||||
bControlCenter.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
Intent myIntent = new Intent(ActivityMainScreen.this, ActivityMaintenance.class);
|
||||
Intent myIntent = new Intent(ActivityMainScreen.this, ActivityControlCenter.class);
|
||||
startActivity(myIntent);
|
||||
}
|
||||
});
|
||||
@ -370,6 +365,16 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
{
|
||||
activityMainScreenInstance.tvLastRule.setText("n./a.");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
activityMainScreenInstance.tvLastProfile.setText(Profile.getLastActivatedProfile().getName());
|
||||
activityMainScreenInstance.updateListView();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
activityMainScreenInstance.tvLastProfile.setText("n./a.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -378,6 +383,7 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
activityMainScreenInstance.tvActivePoi.setText(activityMainScreenInstance.getResources().getString(R.string.serviceNotRunning));
|
||||
activityMainScreenInstance.tvClosestPoi.setText("");
|
||||
activityMainScreenInstance.tvLastRule.setText("");
|
||||
activityMainScreenInstance.tvLastProfile.setText("");
|
||||
}
|
||||
|
||||
// uiUpdateRunning = true;
|
||||
@ -395,21 +401,21 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
long millis = end.getTimeInMillis() - now.getTimeInMillis();
|
||||
long minutes = millis/1000/60;
|
||||
if(minutes < 60)
|
||||
activityMainScreenInstance.tvlockSoundDuration.setText(String.valueOf(minutes + " min..."));
|
||||
activityMainScreenInstance.tvLockSoundDuration.setText(String.valueOf(minutes + " min..."));
|
||||
else
|
||||
{
|
||||
double hours = (double)minutes / 60.0;
|
||||
activityMainScreenInstance.tvlockSoundDuration.setText(String.valueOf(Math.round(hours * 100.0) / 100.0) + " h...");
|
||||
activityMainScreenInstance.tvLockSoundDuration.setText(String.valueOf(Math.round(hours * 100.0) / 100.0) + " h...");
|
||||
}
|
||||
}
|
||||
else
|
||||
activityMainScreenInstance.tvlockSoundDuration.setText(String.valueOf(""));
|
||||
activityMainScreenInstance.tvLockSoundDuration.setText(String.valueOf(""));
|
||||
}
|
||||
else
|
||||
{
|
||||
activityMainScreenInstance.tbLockSound.setChecked(false);
|
||||
activityMainScreenInstance.tbLockSound.setEnabled(false);
|
||||
activityMainScreenInstance.tvlockSoundDuration.setText("");
|
||||
activityMainScreenInstance.tvLockSoundDuration.setText("");
|
||||
}
|
||||
Settings.writeSettings(activityMainScreenInstance);
|
||||
// uiUpdateRunning = false;
|
||||
|
@ -10,10 +10,13 @@ import android.widget.CompoundButton;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class ActivityManageActionBrightnessSetting extends Activity
|
||||
{
|
||||
public static final String intentNameAutoBrightness = "autoBrightness";
|
||||
public static final String intentNameBrightnessValue = "brightnessValue";
|
||||
|
||||
CheckBox chkAutoBrightness;
|
||||
SeekBar sbBrightness;
|
||||
Button bApplyBrightness;
|
||||
@ -22,7 +25,7 @@ public class ActivityManageActionBrightnessSetting extends Activity
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
setContentView(R.layout.activity_manage_brightness_setting);
|
||||
setContentView(R.layout.activity_manage_action_brightness_settings);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
chkAutoBrightness = (CheckBox)findViewById(R.id.chkAutoBrightness);
|
||||
@ -32,11 +35,11 @@ public class ActivityManageActionBrightnessSetting extends Activity
|
||||
|
||||
Intent input = getIntent();
|
||||
|
||||
if(input.hasExtra("autoBrightness"))
|
||||
chkAutoBrightness.setChecked(input.getBooleanExtra("autoBrightness", false));
|
||||
if(input.hasExtra(intentNameAutoBrightness))
|
||||
chkAutoBrightness.setChecked(input.getBooleanExtra(intentNameAutoBrightness, false));
|
||||
|
||||
if(input.hasExtra("brightnessValue"))
|
||||
sbBrightness.setProgress(input.getIntExtra("brightnessValue", 0));
|
||||
if(input.hasExtra(intentNameBrightnessValue))
|
||||
sbBrightness.setProgress(input.getIntExtra(intentNameBrightnessValue, 0));
|
||||
|
||||
bApplyBrightness.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@ -44,8 +47,8 @@ public class ActivityManageActionBrightnessSetting extends Activity
|
||||
public void onClick(View view)
|
||||
{
|
||||
Intent answer = new Intent();
|
||||
answer.putExtra("autoBrightness", chkAutoBrightness.isChecked());
|
||||
answer.putExtra("brightnessValue", sbBrightness.getProgress());
|
||||
answer.putExtra(intentNameAutoBrightness, chkAutoBrightness.isChecked());
|
||||
answer.putExtra(intentNameBrightnessValue, sbBrightness.getProgress());
|
||||
setResult(RESULT_OK, answer);
|
||||
finish();
|
||||
}
|
||||
|
@ -0,0 +1,430 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivityManageActionCloseNotification 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";
|
||||
|
||||
boolean edit = false;
|
||||
ProgressDialog progressDialog = null;
|
||||
|
||||
EditText etNotificationTitle, etNotificationText, etNotificationDismissalButtonText;
|
||||
Button bSelectApp, bSaveActionCloseNotification;
|
||||
Spinner spinnerTitleDirection, spinnerTextDirection;
|
||||
TextView tvSelectedApplication;
|
||||
RadioButton rbNotificationDismissSimple, rbNotificationDismissButton;
|
||||
|
||||
private static List<PackageInfo> pInfos = null;
|
||||
|
||||
final static String dismissRegularString = "p0815DismissString";
|
||||
|
||||
private static String[] directions;
|
||||
|
||||
ArrayAdapter<String> directionSpinnerAdapter;
|
||||
|
||||
public static void getActivityList(final Context context)
|
||||
{
|
||||
if(pInfos == null)
|
||||
{
|
||||
pInfos = context.getPackageManager().getInstalledPackages(PackageManager.GET_ACTIVITIES);
|
||||
Collections.sort(pInfos, new Comparator<PackageInfo>()
|
||||
{
|
||||
public int compare(PackageInfo obj1, PackageInfo obj2)
|
||||
{
|
||||
String name1 = "";
|
||||
String name2 = "";
|
||||
|
||||
ApplicationInfo aInfo1 = obj1.applicationInfo;
|
||||
if (aInfo1 != null)
|
||||
{
|
||||
name1 = (String) context.getPackageManager().getApplicationLabel(aInfo1);
|
||||
}
|
||||
ApplicationInfo aInfo2 = obj2.applicationInfo;
|
||||
if (aInfo2 != null)
|
||||
{
|
||||
name2 = (String) context.getPackageManager().getApplicationLabel(aInfo2);
|
||||
}
|
||||
|
||||
return name1.compareTo(name2);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static String[] getApplicationNameListString(Context myContext)
|
||||
{
|
||||
// Generate the actual list
|
||||
getActivityList(myContext);
|
||||
|
||||
ArrayList<String> returnList = new ArrayList<String>();
|
||||
|
||||
for (PackageInfo pInfo : pInfos)
|
||||
{
|
||||
ApplicationInfo aInfo = pInfo.applicationInfo;
|
||||
if (aInfo != null)
|
||||
{
|
||||
String aLabel;
|
||||
|
||||
aLabel = (String) myContext.getPackageManager().getApplicationLabel(aInfo);
|
||||
|
||||
ActivityInfo[] aInfos = pInfo.activities;
|
||||
if (aInfos != null && aInfos.length > 0) // Only put Applications into the list that have packages.
|
||||
{
|
||||
if(!returnList.contains(aLabel))
|
||||
returnList.add(aLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnList.toArray(new String[returnList.size()]);
|
||||
}
|
||||
|
||||
public static String[] getPackageListString(Context myContext, String applicationLabel)
|
||||
{
|
||||
// Generate the actual list
|
||||
getActivityList(myContext);
|
||||
|
||||
ArrayList<String> returnList = new ArrayList<String>();
|
||||
|
||||
for (PackageInfo pInfo : pInfos)
|
||||
{
|
||||
if(myContext.getPackageManager().getApplicationLabel(pInfo.applicationInfo).equals(applicationLabel))
|
||||
{
|
||||
ActivityInfo[] aInfos = pInfo.activities;
|
||||
if (aInfos != null && aInfos.length > 0)
|
||||
{
|
||||
returnList.add(pInfo.packageName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnList.toArray(new String[returnList.size()]);
|
||||
}
|
||||
|
||||
public static String[] getPackageListString(Context myContext)
|
||||
{
|
||||
// Generate the actual list
|
||||
getActivityList(myContext);
|
||||
|
||||
ArrayList<String> returnList = new ArrayList<String>();
|
||||
|
||||
for (PackageInfo pInfo : pInfos)
|
||||
{
|
||||
ActivityInfo[] aInfos = pInfo.activities;
|
||||
if (aInfos != null && aInfos.length > 0)
|
||||
{
|
||||
returnList.add(pInfo.packageName);
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("w", "Empty Application", "Application " + myContext.getPackageManager().getApplicationLabel(pInfo.applicationInfo) + " doesn\'t have packages.", 5);
|
||||
}
|
||||
|
||||
return returnList.toArray(new String[returnList.size()]);
|
||||
}
|
||||
|
||||
public static String[] getActivityListForPackageName(String packageName)
|
||||
{
|
||||
ArrayList<String> returnList = new ArrayList<String>();
|
||||
|
||||
for (PackageInfo pInfo : pInfos)
|
||||
{
|
||||
if(pInfo.packageName.equals(packageName))
|
||||
{
|
||||
ActivityInfo[] aInfos = pInfo.activities;
|
||||
if (aInfos != null)
|
||||
{
|
||||
for (ActivityInfo activityInfo : aInfos)
|
||||
{
|
||||
returnList.add(activityInfo.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnList.toArray(new String[returnList.size()]);
|
||||
}
|
||||
|
||||
public static ActivityInfo getActivityInfoForPackageNameAndActivityName(String packageName, String activityName)
|
||||
{
|
||||
for (PackageInfo pInfo : pInfos)
|
||||
{
|
||||
if(pInfo.packageName.equals(packageName))
|
||||
{
|
||||
ActivityInfo[] aInfos = pInfo.activities;
|
||||
if (aInfos != null)
|
||||
{
|
||||
for (ActivityInfo activityInfo : aInfos)
|
||||
{
|
||||
if(activityInfo.name.equals(activityName))
|
||||
return activityInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private AlertDialog getActionStartActivityDialog1()
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectApplication));
|
||||
final String[] applicationArray = ActivityManageActionCloseNotification.getApplicationNameListString(this);
|
||||
alertDialogBuilder.setItems(applicationArray, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
dialog.dismiss();
|
||||
getActionStartActivityDialog2(applicationArray[which]).show();
|
||||
}
|
||||
});
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
return alertDialog;
|
||||
}
|
||||
private AlertDialog getActionStartActivityDialog2(String applicationName)
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectPackageOfApplication));
|
||||
final String[] packageArray = ActivityManageActionCloseNotification.getPackageListString(this, applicationName);
|
||||
alertDialogBuilder.setItems(packageArray, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
//getActionStartActivityDialog3(packageArray[which]).show();
|
||||
//Miscellaneous.messageBox(getResources().getString(R.string.hint), getResources().getString(R.string.chooseActivityHint), ActivityManageNotificationTrigger.this).show();
|
||||
tvSelectedApplication.setText(packageArray[which]);
|
||||
}
|
||||
});
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
return alertDialog;
|
||||
}
|
||||
private AlertDialog getActionStartActivityDialog3(final String packageName)
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectActivityToBeStarted));
|
||||
final String activityArray[] = ActivityManageActionCloseNotification.getActivityListForPackageName(packageName);
|
||||
alertDialogBuilder.setItems(activityArray, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
ActivityInfo ai = ActivityManageActionCloseNotification.getActivityInfoForPackageNameAndActivityName(packageName, activityArray[which]);
|
||||
tvSelectedApplication.setText(ai.packageName + ";" + ai.name);
|
||||
}
|
||||
});
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_action_close_notification);
|
||||
|
||||
etNotificationTitle = (EditText)findViewById(R.id.etNotificationTitle);
|
||||
etNotificationText = (EditText)findViewById(R.id.etNotificationText);
|
||||
bSelectApp = (Button)findViewById(R.id.bSelectApp);
|
||||
bSaveActionCloseNotification = (Button)findViewById(R.id.bSaveActionCloseNotification);
|
||||
spinnerTitleDirection = (Spinner)findViewById(R.id.spinnerTitleDirection);
|
||||
spinnerTextDirection = (Spinner)findViewById(R.id.spinnerTextDirection);
|
||||
tvSelectedApplication = (TextView)findViewById(R.id.etActivityOrActionPath);
|
||||
etNotificationDismissalButtonText = (EditText)findViewById(R.id.etNotificationDismissalButtonText);
|
||||
rbNotificationDismissSimple = (RadioButton)findViewById(R.id.rbNotificationDismissSimple);
|
||||
rbNotificationDismissButton = (RadioButton)findViewById(R.id.rbNotificationDismissButton);
|
||||
|
||||
directions = new String[] {
|
||||
getResources().getString(R.string.directionStringEquals),
|
||||
getResources().getString(R.string.directionStringContains),
|
||||
getResources().getString(R.string.directionStringDoesNotContain),
|
||||
getResources().getString(R.string.directionStringStartsWith),
|
||||
getResources().getString(R.string.directionStringEndsWith),
|
||||
getResources().getString(R.string.directionStringNotEquals)
|
||||
};
|
||||
|
||||
directionSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ActivityManageActionCloseNotification.directions);
|
||||
spinnerTitleDirection.setAdapter(directionSpinnerAdapter);
|
||||
spinnerTextDirection.setAdapter(directionSpinnerAdapter);
|
||||
directionSpinnerAdapter.notifyDataSetChanged();
|
||||
|
||||
bSelectApp.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
GetActivityListTask getActivityListTask = new GetActivityListTask();
|
||||
getActivityListTask.execute();
|
||||
progressDialog = ProgressDialog.show(ActivityManageActionCloseNotification.this, "", ActivityManageActionCloseNotification.this.getResources().getString(R.string.gettingListOfInstalledApplications));
|
||||
}
|
||||
});
|
||||
|
||||
bSaveActionCloseNotification.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
String app;
|
||||
if (tvSelectedApplication.getText().toString().equalsIgnoreCase(getResources().getString(R.string.anyApp)))
|
||||
app = Trigger.anyAppString;
|
||||
else
|
||||
app = tvSelectedApplication.getText().toString();
|
||||
|
||||
String titleDir = Trigger.getMatchCode(spinnerTitleDirection.getSelectedItem().toString());
|
||||
String title = etNotificationTitle.getText().toString();
|
||||
String textDir = Trigger.getMatchCode(spinnerTextDirection.getSelectedItem().toString());
|
||||
String text = etNotificationText.getText().toString();
|
||||
|
||||
Intent responseData = new Intent();
|
||||
|
||||
String dismissMethod;
|
||||
if (rbNotificationDismissSimple.isChecked())
|
||||
dismissMethod = dismissRegularString;
|
||||
else
|
||||
{
|
||||
if(StringUtils.isEmpty(etNotificationDismissalButtonText.getText().toString()))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionCloseNotification.this, getResources().getString(R.string.enterText), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else
|
||||
dismissMethod = etNotificationDismissalButtonText.getText().toString();
|
||||
}
|
||||
|
||||
responseData.putExtra(ActivityManageRule.intentNameActionParameter2,
|
||||
app + Action.actionParameter2Split +
|
||||
titleDir + Action.actionParameter2Split +
|
||||
title + Action.actionParameter2Split +
|
||||
textDir + Action.actionParameter2Split +
|
||||
text + Action.actionParameter2Split +
|
||||
dismissMethod
|
||||
);
|
||||
|
||||
ActivityManageActionCloseNotification.this.setResult(RESULT_OK, responseData);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
rbNotificationDismissSimple.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b)
|
||||
{
|
||||
etNotificationDismissalButtonText.setEnabled(!b);
|
||||
}
|
||||
});
|
||||
|
||||
Intent i = getIntent();
|
||||
if(!StringUtils.isBlank(i.getStringExtra(ActivityManageRule.intentNameActionParameter2)))
|
||||
{
|
||||
edit = true;
|
||||
loadValuesIntoGui(i.getStringExtra(ActivityManageRule.intentNameActionParameter2));
|
||||
}
|
||||
}
|
||||
|
||||
private void loadValuesIntoGui(String param)
|
||||
{
|
||||
String[] params = param.split(Action.actionParameter2Split);
|
||||
|
||||
String app = params[0];
|
||||
String titleDir = params[1];
|
||||
String title = params[2];
|
||||
String textDir = params[3];
|
||||
String text;
|
||||
if (params.length >= 5)
|
||||
text = params[4];
|
||||
else
|
||||
text = "";
|
||||
|
||||
/*
|
||||
That's not reliable, yet. Last parameter may be empty, hence the method might
|
||||
be incorrectly interpreted as a text notification text.
|
||||
*/
|
||||
|
||||
if (params.length >= 6 && !params[5].equals(dismissRegularString))
|
||||
{
|
||||
rbNotificationDismissButton.setChecked(true);
|
||||
etNotificationDismissalButtonText.setText(params[5]);
|
||||
etNotificationDismissalButtonText.setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
rbNotificationDismissSimple.setChecked(true);
|
||||
etNotificationDismissalButtonText.setText("");
|
||||
etNotificationDismissalButtonText.setEnabled(false);
|
||||
}
|
||||
|
||||
if(!app.equals(Trigger.anyAppString))
|
||||
tvSelectedApplication.setText(app);
|
||||
|
||||
for(int i = 0; i < directions.length; i++)
|
||||
{
|
||||
if(Trigger.getMatchCode(directions[i]).equalsIgnoreCase(titleDir))
|
||||
spinnerTitleDirection.setSelection(i);
|
||||
|
||||
if(Trigger.getMatchCode(directions[i]).equalsIgnoreCase(textDir))
|
||||
spinnerTextDirection.setSelection(i);
|
||||
}
|
||||
|
||||
if(title.length() > 0)
|
||||
etNotificationTitle.setText(title);
|
||||
|
||||
if(text.length() > 0)
|
||||
etNotificationText.setText(text);
|
||||
}
|
||||
|
||||
private class GetActivityListTask extends AsyncTask<Void, Void, Void>
|
||||
{
|
||||
@Override
|
||||
protected Void doInBackground(Void... params)
|
||||
{
|
||||
getActivityList(ActivityManageActionCloseNotification.this);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Void result)
|
||||
{
|
||||
progressDialog.dismiss();
|
||||
getActionStartActivityDialog1().show();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class ActivityManageActionControlMedia extends Activity
|
||||
{
|
||||
RadioButton rbMediaPlayPause, rbMediaPlay, rbMediaPause, rbMediaStop, rbMediaPrevious, rbMediaNext;
|
||||
Button bSaveControlMediaAction;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_action_control_media);
|
||||
|
||||
rbMediaPlayPause = (RadioButton)findViewById(R.id.rbMediaPlayPause);
|
||||
rbMediaPlay = (RadioButton)findViewById(R.id.rbMediaPlay);
|
||||
rbMediaPause = (RadioButton)findViewById(R.id.rbMediaPause);
|
||||
rbMediaStop = (RadioButton)findViewById(R.id.rbMediaStop);
|
||||
rbMediaPrevious = (RadioButton)findViewById(R.id.rbMediaPrevious);
|
||||
rbMediaNext = (RadioButton)findViewById(R.id.rbMediaNext);
|
||||
|
||||
bSaveControlMediaAction = (Button)findViewById(R.id.bSaveControlMediaAction);
|
||||
|
||||
bSaveControlMediaAction.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
if(checkInput())
|
||||
{
|
||||
Intent answer = new Intent();
|
||||
|
||||
if(rbMediaPlayPause.isChecked())
|
||||
answer.putExtra(ActivityManageRule.intentNameActionParameter2, "0");
|
||||
else if(rbMediaPlay.isChecked())
|
||||
answer.putExtra(ActivityManageRule.intentNameActionParameter2, "1");
|
||||
else if(rbMediaPause.isChecked())
|
||||
answer.putExtra(ActivityManageRule.intentNameActionParameter2, "2");
|
||||
else if(rbMediaStop.isChecked())
|
||||
answer.putExtra(ActivityManageRule.intentNameActionParameter2, "3");
|
||||
else if(rbMediaPrevious.isChecked())
|
||||
answer.putExtra(ActivityManageRule.intentNameActionParameter2, "4");
|
||||
else if(rbMediaNext.isChecked())
|
||||
answer.putExtra(ActivityManageRule.intentNameActionParameter2, "5");
|
||||
|
||||
setResult(RESULT_OK, answer);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Intent input = getIntent();
|
||||
|
||||
if(input.hasExtra(ActivityManageRule.intentNameActionParameter2))
|
||||
{
|
||||
String existing = input.getStringExtra(ActivityManageRule.intentNameActionParameter2);
|
||||
switch (existing)
|
||||
{
|
||||
case "0":
|
||||
rbMediaPlayPause.setChecked(true);
|
||||
break;
|
||||
case "1":
|
||||
rbMediaPlay.setChecked(true);
|
||||
break;
|
||||
case "2":
|
||||
rbMediaPause.setChecked(true);
|
||||
break;
|
||||
case "3":
|
||||
rbMediaStop.setChecked(true);
|
||||
break;
|
||||
case "4":
|
||||
rbMediaPrevious.setChecked(true);
|
||||
break;
|
||||
case "5":
|
||||
rbMediaNext.setChecked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean checkInput()
|
||||
{
|
||||
if(
|
||||
!rbMediaPlayPause.isChecked()
|
||||
&&
|
||||
!rbMediaPlay.isChecked()
|
||||
&&
|
||||
!rbMediaPause.isChecked()
|
||||
&&
|
||||
!rbMediaStop.isChecked()
|
||||
&&
|
||||
!rbMediaPrevious.isChecked()
|
||||
&&
|
||||
!rbMediaNext.isChecked()
|
||||
)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionControlMedia.this, getResources().getString(R.string.pleaseSelectActionValue), Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class ActivityManageActionCreateNotification extends Activity
|
||||
{
|
||||
public static final String intentNameNotificationTitle = "notificationTitle";
|
||||
public static final String intentNameNotificationText = "notificationText";
|
||||
|
||||
EditText etNotificationTitle, etNotificationText;
|
||||
Button bSaveActionNotification;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_action_create_notification);
|
||||
|
||||
etNotificationTitle = (EditText) findViewById(R.id.etNotificationTitle);
|
||||
etNotificationText = (EditText)findViewById(R.id.etNotificationText);
|
||||
bSaveActionNotification = (Button)findViewById(R.id.bSaveActionNotification);
|
||||
|
||||
Intent input = getIntent();
|
||||
|
||||
if(input.hasExtra(intentNameNotificationTitle))
|
||||
etNotificationTitle.setText(input.getStringExtra(intentNameNotificationTitle));
|
||||
|
||||
if(input.hasExtra(intentNameNotificationText))
|
||||
etNotificationText.setText(input.getStringExtra(intentNameNotificationText));
|
||||
|
||||
bSaveActionNotification.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
if(StringUtils.isBlank(etNotificationTitle.getText().toString()))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionCreateNotification.this, getResources().getString(R.string.enterTitle), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(StringUtils.isBlank(etNotificationText.getText().toString()))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionCreateNotification.this, getResources().getString(R.string.enterText), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
Intent answer = new Intent();
|
||||
answer.putExtra(intentNameNotificationTitle, etNotificationTitle.getText().toString());
|
||||
answer.putExtra(intentNameNotificationText, etNotificationText.getText().toString());
|
||||
setResult(RESULT_OK, answer);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ActivityManageActionRunExecutable extends Activity
|
||||
{
|
||||
final static int PICKFILE_RESULT_CODE = 4711;
|
||||
|
||||
CheckBox chkRunExecAsRoot;
|
||||
EditText etRunExecutablePath, etRunExecutableParameters;
|
||||
Button bChooseExecutable, bSaveActionRunExec;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_action_run_executable);
|
||||
|
||||
chkRunExecAsRoot = (CheckBox)findViewById(R.id.chkRunExecAsRoot);
|
||||
etRunExecutablePath = (EditText) findViewById(R.id.etRunExecutablePath);
|
||||
etRunExecutableParameters = (EditText) findViewById(R.id.etRunExecutableParameters);
|
||||
bChooseExecutable = (Button) findViewById(R.id.bChooseExecutable);
|
||||
bSaveActionRunExec = (Button) findViewById(R.id.bSaveActionRunExec);
|
||||
|
||||
bChooseExecutable.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
//Need to check for storage permissions
|
||||
Intent chooseFile = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
chooseFile.setType("*/*");
|
||||
chooseFile = Intent.createChooser(chooseFile, getResources().getString(R.string.selectSoundFile));
|
||||
startActivityForResult(chooseFile, PICKFILE_RESULT_CODE);
|
||||
}
|
||||
});
|
||||
|
||||
bSaveActionRunExec.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
saveExecSettings();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void saveExecSettings()
|
||||
{
|
||||
if(etRunExecutablePath.getText().toString() == null || etRunExecutablePath.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionRunExecutable.this, getResources().getString(R.string.selectValidExecutable), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
File executableFile = new File(etRunExecutablePath.getText().toString());
|
||||
if(!executableFile.exists())
|
||||
{
|
||||
Toast.makeText(ActivityManageActionRunExecutable.this, getResources().getString(R.string.fileDoesNotExist), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!chkRunExecAsRoot.isChecked() && !executableFile.canExecute())
|
||||
{
|
||||
Toast.makeText(ActivityManageActionRunExecutable.this, getResources().getString(R.string.fileNotExecutable), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Intent returnData = new Intent();
|
||||
returnData.putExtra(ActivityManageRule.intentNameActionParameter1, chkRunExecAsRoot.isChecked());
|
||||
|
||||
if(etRunExecutableParameters.getText() != null && !StringUtils.isEmpty(etRunExecutableParameters.getText().toString()))
|
||||
returnData.putExtra(ActivityManageRule.intentNameActionParameter2, etRunExecutablePath.getText().toString() + Action.actionParameter2Split + etRunExecutableParameters.getText().toString());
|
||||
else
|
||||
returnData.putExtra(ActivityManageRule.intentNameActionParameter2, etRunExecutablePath.getText().toString());
|
||||
|
||||
setResult(RESULT_OK, returnData);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data)
|
||||
{
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
if(requestCode == PICKFILE_RESULT_CODE)
|
||||
{
|
||||
Uri fileUri = data.getData();
|
||||
String filePath = CompensateCrappyAndroidPaths.getPath(ActivityManageActionRunExecutable.this, fileUri);
|
||||
etRunExecutablePath.setText(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,281 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivityManageActionSendBroadcast extends Activity
|
||||
{
|
||||
EditText etBroadcastToSend;
|
||||
Button bBroadcastSendShowSuggestions, bSaveSendBroadcast, bAddIntentPair;
|
||||
ListView lvIntentPairs;
|
||||
EditText etParameterName, etParameterValue;
|
||||
Spinner spinnerParameterType;
|
||||
ArrayAdapter<String> intentTypeSpinnerAdapter, intentPairAdapter;
|
||||
private static final String[] supportedIntentTypes = { "boolean", "byte", "char", "double", "float", "int", "long", "short", "String", "Uri" };
|
||||
private ArrayList<String> intentPairList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_action_send_broadcast);
|
||||
|
||||
etBroadcastToSend = (EditText)findViewById(R.id.etBroadcastToSend);
|
||||
bBroadcastSendShowSuggestions = (Button)findViewById(R.id.bBroadcastSendShowSuggestions);
|
||||
bSaveSendBroadcast = (Button)findViewById(R.id.bSaveSendBroadcast);
|
||||
bAddIntentPair = (Button)findViewById(R.id.bAddIntentPair);
|
||||
lvIntentPairs = (ListView) findViewById(R.id.lvIntentPairs);
|
||||
etParameterName = (EditText) findViewById(R.id.etParameterName);
|
||||
etParameterValue = (EditText) findViewById(R.id.etParameterValue);
|
||||
spinnerParameterType = (Spinner) findViewById(R.id.spinnerParameterType);
|
||||
|
||||
intentTypeSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ActivityManageActionSendBroadcast.supportedIntentTypes);
|
||||
spinnerParameterType.setAdapter(intentTypeSpinnerAdapter);
|
||||
intentTypeSpinnerAdapter.notifyDataSetChanged();
|
||||
intentPairAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, intentPairList);
|
||||
|
||||
bSaveSendBroadcast.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
if(checkInput())
|
||||
{
|
||||
Intent answer = new Intent();
|
||||
|
||||
String param2 = etBroadcastToSend.getText().toString();
|
||||
|
||||
if(intentPairList.size() > 0)
|
||||
{
|
||||
param2 += Action.actionParameter2Split;
|
||||
|
||||
for (String s : intentPairList)
|
||||
param2 += s + ";";
|
||||
|
||||
param2 = param2.substring(0, param2.length() - 1);
|
||||
}
|
||||
|
||||
answer.putExtra(ActivityManageRule.intentNameActionParameter2, param2);
|
||||
setResult(RESULT_OK, answer);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
bBroadcastSendShowSuggestions.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(ActivityManageActionSendBroadcast.this);
|
||||
builder.setTitle(getResources().getString(R.string.selectBroadcast));
|
||||
builder.setItems(ActivityManageTriggerBroadcast.broadcastSuggestions, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int which)
|
||||
{
|
||||
etBroadcastToSend.setText(ActivityManageTriggerBroadcast.broadcastSuggestions[which]);
|
||||
}
|
||||
});
|
||||
builder.create().show();
|
||||
}
|
||||
});
|
||||
|
||||
Intent input = getIntent();
|
||||
|
||||
if(input.hasExtra(ActivityManageRule.intentNameActionParameter2))
|
||||
{
|
||||
String param2 = input.getStringExtra(ActivityManageRule.intentNameActionParameter2);
|
||||
if(!param2.contains(Action.actionParameter2Split))
|
||||
etBroadcastToSend.setText(input.getStringExtra(ActivityManageRule.intentNameActionParameter2));
|
||||
else
|
||||
{
|
||||
String[] param2Parts = param2.split(Action.actionParameter2Split);
|
||||
etBroadcastToSend.setText(param2Parts[0]);
|
||||
|
||||
String[] params = param2Parts[1].split(";");
|
||||
|
||||
intentPairList.clear();
|
||||
|
||||
for(int i = 0; i < params.length; i++)
|
||||
{
|
||||
if(lvIntentPairs.getVisibility() != View.VISIBLE)
|
||||
lvIntentPairs.setVisibility(View.VISIBLE);
|
||||
|
||||
intentPairList.add(params[i]);
|
||||
}
|
||||
|
||||
updateIntentPairList();
|
||||
}
|
||||
}
|
||||
|
||||
bAddIntentPair.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
// type;name;value
|
||||
if(spinnerParameterType.getSelectedItem().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, getResources().getString(R.string.selectTypeOfIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(etParameterName.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, getResources().getString(R.string.enterNameForIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterName.getText().toString().contains(Action.intentPairSeparator))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, String.format(getResources().getString(R.string.stringNotAllowed), Action.intentPairSeparator), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterName.getText().toString().contains(";"))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, String.format(getResources().getString(R.string.stringNotAllowed), ";"), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(etParameterValue.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, getResources().getString(R.string.enterValueForIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterValue.getText().toString().contains(Action.intentPairSeparator))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, String.format(getResources().getString(R.string.stringNotAllowed), Action.intentPairSeparator), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterValue.getText().toString().contains(";"))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, String.format(getResources().getString(R.string.stringNotAllowed), ";"), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
switch(supportedIntentTypes[spinnerParameterType.getSelectedItemPosition()])
|
||||
{
|
||||
case "int":
|
||||
case "long":
|
||||
case "short":
|
||||
if(!Miscellaneous.isNumeric(etParameterValue.getText().toString()))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, getResources().getString(R.string.enter_a_number), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "double":
|
||||
case "float":
|
||||
if(!Miscellaneous.isNumericDecimal(etParameterValue.getText().toString()))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, getResources().getString(R.string.enter_a_number), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ActivityManageActionSendBroadcast.this.etParameterValue.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
}
|
||||
|
||||
String param = supportedIntentTypes[spinnerParameterType.getSelectedItemPosition()] + Action.intentPairSeparator + etParameterName.getText().toString() + Action.intentPairSeparator + etParameterValue.getText().toString();
|
||||
intentPairList.add(param);
|
||||
|
||||
spinnerParameterType.setSelection(0);
|
||||
etParameterName.setText("");
|
||||
etParameterValue.setText("");
|
||||
|
||||
updateIntentPairList();
|
||||
|
||||
if(lvIntentPairs.getVisibility() != View.VISIBLE)
|
||||
lvIntentPairs.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
lvIntentPairs.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener()
|
||||
{
|
||||
@Override
|
||||
public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2, long arg3)
|
||||
{
|
||||
getIntentPairDialog(arg2).show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
spinnerParameterType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
|
||||
{
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3)
|
||||
{
|
||||
if(supportedIntentTypes[arg2].equals("int") || supportedIntentTypes[arg2].equals("long") || supportedIntentTypes[arg2].equals("short"))
|
||||
ActivityManageActionSendBroadcast.this.etParameterValue.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
else if(supportedIntentTypes[arg2].equals("double") || supportedIntentTypes[arg2].equals("float"))
|
||||
ActivityManageActionSendBroadcast.this.etParameterValue.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
||||
else
|
||||
ActivityManageActionSendBroadcast.this.etParameterValue.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> arg0)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
boolean checkInput()
|
||||
{
|
||||
String broadcastToSend = etBroadcastToSend.getText().toString();
|
||||
if(StringUtils.isEmpty(broadcastToSend))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionSendBroadcast.this, getResources().getString(R.string.enterBroadcast), Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void updateIntentPairList()
|
||||
{
|
||||
if(lvIntentPairs.getAdapter() == null)
|
||||
lvIntentPairs.setAdapter(intentPairAdapter);
|
||||
|
||||
intentPairAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private AlertDialog getIntentPairDialog(final int itemPosition)
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(ActivityManageActionSendBroadcast.this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.whatToDoWithIntentPair));
|
||||
alertDialogBuilder.setItems(new String[]{getResources().getString(R.string.delete)}, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
// Only 1 choice at the moment, no need to check
|
||||
ActivityManageActionSendBroadcast.this.intentPairList.remove(itemPosition);
|
||||
updateIntentPairList();
|
||||
}
|
||||
});
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
return alertDialog;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
@ -123,7 +124,7 @@ public class ActivityManageActionSendTextMessage extends Activity
|
||||
{
|
||||
for(int i=0; i<permissions.length; i++)
|
||||
{
|
||||
if(permissions[i].equals("android.permission.READ_CONTACTS"))
|
||||
if(permissions[i].equals(Manifest.permission.READ_CONTACTS))
|
||||
{
|
||||
if(grantResults[i] == PackageManager.PERMISSION_GRANTED)
|
||||
{
|
||||
|
@ -15,8 +15,6 @@ public class ActivityManageActionSpeakText extends Activity
|
||||
private Button bSaveSpeakText;
|
||||
private EditText etSpeakText;
|
||||
|
||||
// private String existingUrl = "";
|
||||
|
||||
public static boolean edit = false;
|
||||
public static Action resultingAction = null;
|
||||
|
||||
@ -27,7 +25,7 @@ public class ActivityManageActionSpeakText extends Activity
|
||||
this.setContentView(R.layout.activity_manage_action_speak_text);
|
||||
|
||||
etSpeakText = (EditText)findViewById(R.id.etTextToSpeak);
|
||||
bSaveSpeakText = (Button)findViewById(R.id.bSaveTriggerUrl);
|
||||
bSaveSpeakText = (Button)findViewById(R.id.bSaveSpeakText);
|
||||
bSaveSpeakText.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
@ -12,6 +13,7 @@ import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.view.MotionEvent;
|
||||
@ -30,6 +32,8 @@ import android.widget.RadioButton;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.jens.automation2.Action.Action_Enum;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -54,6 +58,251 @@ public class ActivityManageActionStartActivity extends Activity
|
||||
final String urlShowExamples = "https://server47.de/automation/examples_startProgram.html";
|
||||
final static String startByActivityString = "0";
|
||||
final static String startByBroadcastString = "1";
|
||||
|
||||
final static int requestCodeForRequestQueryAllPackagesPermission = 4711;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_action_start_activity);
|
||||
|
||||
lvIntentPairs = (ListView)findViewById(R.id.lvIntentPairs);
|
||||
etParameterName = (EditText)findViewById(R.id.etParameterName);
|
||||
etParameterValue = (EditText)findViewById(R.id.etParameterValue);
|
||||
bSelectApp = (Button)findViewById(R.id.bSelectApp);
|
||||
bAddIntentPair = (Button)findViewById(R.id.bAddIntentPair);
|
||||
bSaveActionStartOtherActivity = (Button)findViewById(R.id.bSaveActionStartOtherActivity);
|
||||
spinnerParameterType = (Spinner)findViewById(R.id.spinnerParameterType);
|
||||
etPackageName = (EditText) findViewById(R.id.etPackageName);
|
||||
etActivityOrActionPath = (EditText) findViewById(R.id.etActivityOrActionPath);
|
||||
rbStartAppSelectByActivity = (RadioButton)findViewById(R.id.rbStartAppSelectByActivity);
|
||||
rbStartAppSelectByAction = (RadioButton)findViewById(R.id.rbStartAppSelectByAction);
|
||||
showStartProgramExamples = (Button)findViewById(R.id.showStartProgramExamples);
|
||||
rbStartAppByActivity = (RadioButton)findViewById(R.id.rbStartAppByActivity);
|
||||
rbStartAppByBroadcast = (RadioButton)findViewById(R.id.rbStartAppByBroadcast);
|
||||
|
||||
intentTypeSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ActivityManageActionStartActivity.supportedIntentTypes);
|
||||
spinnerParameterType.setAdapter(intentTypeSpinnerAdapter);
|
||||
intentTypeSpinnerAdapter.notifyDataSetChanged();
|
||||
|
||||
intentPairAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, intentPairList);
|
||||
|
||||
bSelectApp.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
int targetSdkVersion = getApplicationContext().getApplicationInfo().targetSdkVersion;
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && targetSdkVersion >= 30 && !ActivityPermissions.havePermission(Manifest.permission.QUERY_ALL_PACKAGES, ActivityManageActionStartActivity.this))// && shouldShowRequestPermissionRationale(Manifest.permission.QUERY_ALL_PACKAGES))
|
||||
{
|
||||
if(BuildConfig.FLAVOR.equals(AutomationService.flavor_name_googleplay))
|
||||
{
|
||||
// This ain't possible anymore.
|
||||
Miscellaneous.messageBox(getResources().getString(R.string.info), getResources().getString(R.string.featureNotInGooglePlayVersion) + Miscellaneous.lineSeparator + Miscellaneous.lineSeparator + getResources().getString(R.string.startActivityInsertManually), ActivityManageActionStartActivity.this).show();
|
||||
}
|
||||
else
|
||||
requestPermissions(new String[] {Manifest.permission.QUERY_ALL_PACKAGES}, requestCodeForRequestQueryAllPackagesPermission);
|
||||
}
|
||||
else
|
||||
getAppList();
|
||||
}
|
||||
});
|
||||
|
||||
bAddIntentPair.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
// type;name;value
|
||||
if(spinnerParameterType.getSelectedItem().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.selectTypeOfIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(etParameterName.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.enterNameForIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterName.getText().toString().contains(Action.intentPairSeparator))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, String.format(getResources().getString(R.string.stringNotAllowed), Action.intentPairSeparator), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterName.getText().toString().contains(";"))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, String.format(getResources().getString(R.string.stringNotAllowed), ";"), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(etParameterValue.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.enterValueForIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterValue.getText().toString().contains(Action.intentPairSeparator))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, String.format(getResources().getString(R.string.stringNotAllowed), Action.intentPairSeparator), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterValue.getText().toString().contains(";"))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, String.format(getResources().getString(R.string.stringNotAllowed), ";"), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
switch(supportedIntentTypes[spinnerParameterType.getSelectedItemPosition()])
|
||||
{
|
||||
case "int":
|
||||
case "long":
|
||||
case "short":
|
||||
if(!Miscellaneous.isNumeric(etParameterValue.getText().toString()))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.enter_a_number), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "double":
|
||||
case "float":
|
||||
if(!Miscellaneous.isNumericDecimal(etParameterValue.getText().toString()))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.enter_a_number), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
}
|
||||
|
||||
String param = supportedIntentTypes[spinnerParameterType.getSelectedItemPosition()] + Action.intentPairSeparator + etParameterName.getText().toString() + Action.intentPairSeparator + etParameterValue.getText().toString();
|
||||
intentPairList.add(param);
|
||||
|
||||
spinnerParameterType.setSelection(0);
|
||||
etParameterName.setText("");
|
||||
etParameterValue.setText("");
|
||||
|
||||
updateIntentPairList();
|
||||
|
||||
if(lvIntentPairs.getVisibility() != View.VISIBLE)
|
||||
lvIntentPairs.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
showStartProgramExamples.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlShowExamples));
|
||||
startActivity(browserIntent);
|
||||
}
|
||||
});
|
||||
|
||||
lvIntentPairs.setOnItemLongClickListener(new OnItemLongClickListener()
|
||||
{
|
||||
@Override
|
||||
public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2, long arg3)
|
||||
{
|
||||
getIntentPairDialog(arg2).show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
bSaveActionStartOtherActivity.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
if(checkInput())
|
||||
{
|
||||
Intent returnData = new Intent();
|
||||
|
||||
returnData.putExtra(ActivityManageRule.intentNameActionParameter1, rbStartAppSelectByAction.isChecked());
|
||||
|
||||
String parameter2 = "";
|
||||
|
||||
if (rbStartAppSelectByActivity.isChecked())
|
||||
parameter2 += etPackageName.getText().toString() + ";" + etActivityOrActionPath.getText().toString();
|
||||
else {
|
||||
if (etPackageName.getText().toString() != null && etPackageName.getText().toString().length() > 0)
|
||||
parameter2 += etPackageName.getText().toString() + ";" + etActivityOrActionPath.getText().toString();
|
||||
else
|
||||
parameter2 += Actions.dummyPackageString + ";" + etActivityOrActionPath.getText().toString();
|
||||
}
|
||||
|
||||
if (rbStartAppByActivity.isChecked())
|
||||
parameter2 += ";" + startByActivityString;
|
||||
else
|
||||
parameter2 += ";" + startByBroadcastString;
|
||||
|
||||
for (String s : intentPairList)
|
||||
parameter2 += ";" + s;
|
||||
|
||||
returnData.putExtra(ActivityManageRule.intentNameActionParameter2, parameter2);
|
||||
|
||||
setResult(RESULT_OK, returnData);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
lvIntentPairs.setOnTouchListener(new OnTouchListener()
|
||||
{
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event)
|
||||
{
|
||||
v.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
spinnerParameterType.setOnItemSelectedListener(new OnItemSelectedListener()
|
||||
{
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3)
|
||||
{
|
||||
if(supportedIntentTypes[arg2].equals("int") || supportedIntentTypes[arg2].equals("long") || supportedIntentTypes[arg2].equals("short"))
|
||||
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
else if(supportedIntentTypes[arg2].equals("double") || supportedIntentTypes[arg2].equals("float"))
|
||||
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
||||
else
|
||||
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> arg0)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
rbStartAppSelectByActivity.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
|
||||
{
|
||||
if(isChecked)
|
||||
bSelectApp.setEnabled(isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
rbStartAppSelectByAction.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
|
||||
{
|
||||
if(isChecked)
|
||||
bSelectApp.setEnabled(!isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
Intent i = getIntent();
|
||||
if(i.hasExtra(ActivityManageRule.intentNameActionParameter1))
|
||||
loadValuesIntoGui(i);
|
||||
}
|
||||
|
||||
private class CustomPackageInfo extends PackageInfo implements Comparable<CustomPackageInfo>
|
||||
{
|
||||
@ -76,11 +325,9 @@ public class ActivityManageActionStartActivity extends Activity
|
||||
|
||||
return name1.compareTo(name2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static List<PackageInfo> pInfos = null;
|
||||
public static Action resultingAction;
|
||||
|
||||
private static final String[] supportedIntentTypes = { "boolean", "byte", "char", "double", "float", "int", "long", "short", "String", "Uri" };
|
||||
private ArrayList<String> intentPairList = new ArrayList<String>();
|
||||
@ -331,200 +578,20 @@ public class ActivityManageActionStartActivity extends Activity
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
void getAppList()
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_action_start_activity);
|
||||
|
||||
lvIntentPairs = (ListView)findViewById(R.id.lvIntentPairs);
|
||||
etParameterName = (EditText)findViewById(R.id.etParameterName);
|
||||
etParameterValue = (EditText)findViewById(R.id.etParameterValue);
|
||||
bSelectApp = (Button)findViewById(R.id.bSelectApp);
|
||||
bAddIntentPair = (Button)findViewById(R.id.bAddIntentPair);
|
||||
bSaveActionStartOtherActivity = (Button)findViewById(R.id.bSaveActionStartOtherActivity);
|
||||
spinnerParameterType = (Spinner)findViewById(R.id.spinnerParameterType);
|
||||
etPackageName = (EditText) findViewById(R.id.etPackageName);
|
||||
etActivityOrActionPath = (EditText) findViewById(R.id.etActivityOrActionPath);
|
||||
rbStartAppSelectByActivity = (RadioButton)findViewById(R.id.rbStartAppSelectByActivity);
|
||||
rbStartAppSelectByAction = (RadioButton)findViewById(R.id.rbStartAppSelectByAction);
|
||||
showStartProgramExamples = (Button)findViewById(R.id.showStartProgramExamples);
|
||||
|
||||
rbStartAppByActivity = (RadioButton)findViewById(R.id.rbStartAppByActivity);
|
||||
rbStartAppByBroadcast = (RadioButton)findViewById(R.id.rbStartAppByBroadcast);
|
||||
|
||||
intentTypeSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ActivityManageActionStartActivity.supportedIntentTypes);
|
||||
spinnerParameterType.setAdapter(intentTypeSpinnerAdapter);
|
||||
intentTypeSpinnerAdapter.notifyDataSetChanged();
|
||||
|
||||
intentPairAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, intentPairList);
|
||||
|
||||
bSelectApp.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
GetActivityListTask getActivityListTask = new GetActivityListTask();
|
||||
getActivityListTask.execute();
|
||||
progressDialog = ProgressDialog.show(ActivityManageActionStartActivity.this, "", ActivityManageActionStartActivity.this.getResources().getString(R.string.gettingListOfInstalledApplications));
|
||||
}
|
||||
});
|
||||
|
||||
bAddIntentPair.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
// type;name;value
|
||||
if(spinnerParameterType.getSelectedItem().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.selectTypeOfIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(etParameterName.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.enterNameForIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterName.getText().toString().contains(Action.intentPairSeperator))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, String.format(getResources().getString(R.string.stringNotAllowed), Action.intentPairSeperator), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterName.getText().toString().contains(";"))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, String.format(getResources().getString(R.string.stringNotAllowed), ";"), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(etParameterValue.getText().toString().length() == 0)
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, getResources().getString(R.string.enterValueForIntentPair), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterValue.getText().toString().contains(Action.intentPairSeperator))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, String.format(getResources().getString(R.string.stringNotAllowed), Action.intentPairSeperator), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else if(etParameterValue.getText().toString().contains(";"))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionStartActivity.this, String.format(getResources().getString(R.string.stringNotAllowed), ";"), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
String param = supportedIntentTypes[spinnerParameterType.getSelectedItemPosition()] + Action.intentPairSeperator + etParameterName.getText().toString() + Action.intentPairSeperator + etParameterValue.getText().toString();
|
||||
intentPairList.add(param);
|
||||
|
||||
spinnerParameterType.setSelection(0);
|
||||
etParameterName.setText("");
|
||||
etParameterValue.setText("");
|
||||
|
||||
updateIntentPairList();
|
||||
|
||||
if(lvIntentPairs.getVisibility() != View.VISIBLE)
|
||||
lvIntentPairs.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
showStartProgramExamples.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlShowExamples));
|
||||
startActivity(browserIntent);
|
||||
}
|
||||
});
|
||||
|
||||
lvIntentPairs.setOnItemLongClickListener(new OnItemLongClickListener()
|
||||
{
|
||||
@Override
|
||||
public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2, long arg3)
|
||||
{
|
||||
getIntentPairDialog(arg2).show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
bSaveActionStartOtherActivity.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
if(saveAction())
|
||||
{
|
||||
ActivityManageActionStartActivity.this.setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
lvIntentPairs.setOnTouchListener(new OnTouchListener()
|
||||
{
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event)
|
||||
{
|
||||
v.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
spinnerParameterType.setOnItemSelectedListener(new OnItemSelectedListener()
|
||||
{
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3)
|
||||
{
|
||||
if(supportedIntentTypes[arg2].equals("double") | supportedIntentTypes[arg2].equals("float") | supportedIntentTypes[arg2].equals("int") | supportedIntentTypes[arg2].equals("long") | supportedIntentTypes[arg2].equals("short"))
|
||||
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
else
|
||||
ActivityManageActionStartActivity.this.etParameterValue.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> arg0)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
rbStartAppSelectByActivity.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
|
||||
{
|
||||
if(isChecked)
|
||||
bSelectApp.setEnabled(isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
rbStartAppSelectByAction.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
|
||||
{
|
||||
if(isChecked)
|
||||
bSelectApp.setEnabled(!isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
Intent i = getIntent();
|
||||
if(i.getBooleanExtra("edit", false) == true)
|
||||
{
|
||||
edit = true;
|
||||
loadValuesIntoGui();
|
||||
}
|
||||
GetActivityListTask getActivityListTask = new GetActivityListTask();
|
||||
getActivityListTask.execute();
|
||||
progressDialog = ProgressDialog.show(ActivityManageActionStartActivity.this, "", ActivityManageActionStartActivity.this.getResources().getString(R.string.gettingListOfInstalledApplications));
|
||||
}
|
||||
|
||||
private void loadValuesIntoGui()
|
||||
private void loadValuesIntoGui(Intent input)
|
||||
{
|
||||
boolean selectionByAction = resultingAction.getParameter1();
|
||||
boolean selectionByAction = input.getBooleanExtra(ActivityManageRule.intentNameActionParameter1, true);
|
||||
rbStartAppSelectByActivity.setChecked(!selectionByAction);
|
||||
rbStartAppSelectByAction.setChecked(selectionByAction);
|
||||
|
||||
String[] params = resultingAction.getParameter2().split(";");
|
||||
String[] params = input.getStringExtra(ActivityManageRule.intentNameActionParameter2).split(";");
|
||||
|
||||
rbStartAppByActivity.setChecked(params[2].equals(startByActivityString));
|
||||
rbStartAppByBroadcast.setChecked(params[2].equals(startByBroadcastString));
|
||||
@ -570,8 +637,8 @@ public class ActivityManageActionStartActivity extends Activity
|
||||
|
||||
intentPairAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private boolean saveAction()
|
||||
|
||||
boolean checkInput()
|
||||
{
|
||||
if(rbStartAppSelectByActivity.isChecked())
|
||||
{
|
||||
@ -594,36 +661,7 @@ public class ActivityManageActionStartActivity extends Activity
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(resultingAction == null)
|
||||
resultingAction = new Action();
|
||||
|
||||
resultingAction.setParameter1(rbStartAppSelectByAction.isChecked());
|
||||
|
||||
resultingAction.setAction(Action_Enum.startOtherActivity);
|
||||
|
||||
String parameter2 = "";
|
||||
|
||||
if(rbStartAppSelectByActivity.isChecked())
|
||||
parameter2 += etPackageName.getText().toString() + ";" + etActivityOrActionPath.getText().toString();
|
||||
else
|
||||
{
|
||||
if(etPackageName.getText().toString() != null && etPackageName.getText().toString().length() > 0)
|
||||
parameter2 += etPackageName.getText().toString() + ";" + etActivityOrActionPath.getText().toString();
|
||||
else
|
||||
parameter2 += Actions.dummyPackageString + ";" + etActivityOrActionPath.getText().toString();
|
||||
}
|
||||
|
||||
if(rbStartAppByActivity.isChecked())
|
||||
parameter2 += ";" + startByActivityString;
|
||||
else
|
||||
parameter2 += ";" + startByBroadcastString;
|
||||
|
||||
for(String s : intentPairList)
|
||||
parameter2 += ";" + s;
|
||||
|
||||
resultingAction.setParameter2(parameter2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -661,4 +699,22 @@ public class ActivityManageActionStartActivity extends Activity
|
||||
getActionStartActivityDialog1Application().show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
|
||||
{
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
if(requestCode == requestCodeForRequestQueryAllPackagesPermission)
|
||||
{
|
||||
for(int i = 0; i < permissions.length; i++)
|
||||
{
|
||||
if(permissions[i].equals(Manifest.permission.QUERY_ALL_PACKAGES) && grantResults[i] == PackageManager.PERMISSION_GRANTED)
|
||||
{
|
||||
getAppList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -47,7 +47,7 @@ public class ActivityManageActionTriggerUrl extends Activity
|
||||
chkTriggerUrlUseAuthentication = (CheckBox)findViewById(R.id.chkTriggerUrlUseAuthentication);
|
||||
lvTriggerUrlPostParameters = (ListView)findViewById(R.id.lvTriggerUrlPostParameters);
|
||||
tlTriggerUrlAuthentication = (TableLayout)findViewById(R.id.tlTriggerUrlAuthentication);
|
||||
bSaveTriggerUrl = (Button)findViewById(R.id.bSaveTriggerUrl);
|
||||
bSaveTriggerUrl = (Button)findViewById(R.id.bSaveSpeakText);
|
||||
bSaveTriggerUrl.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
|
@ -0,0 +1,99 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class ActivityManageActionWakeLock extends Activity
|
||||
{
|
||||
RadioButton rbWakeLockActivate, rbWakeLockDeactivate;
|
||||
CheckBox chkWakeLockTimeout;
|
||||
EditText etWakeLockDuration;
|
||||
Button bSaveWakelock;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_action_wakelock);
|
||||
|
||||
rbWakeLockActivate = (RadioButton)findViewById(R.id.rbWakeLockActivate);
|
||||
rbWakeLockDeactivate = (RadioButton)findViewById(R.id.rbWakeLockDeactivate);
|
||||
chkWakeLockTimeout = (CheckBox)findViewById(R.id.chkWakeLockTimeout);
|
||||
etWakeLockDuration = (EditText)findViewById(R.id.etWakeLockDuration);
|
||||
bSaveWakelock = (Button)findViewById(R.id.bSaveWakelock);
|
||||
|
||||
etWakeLockDuration.setEnabled(chkWakeLockTimeout.isChecked());
|
||||
|
||||
chkWakeLockTimeout.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean wakeLockTimeoutSet)
|
||||
{
|
||||
etWakeLockDuration.setEnabled(wakeLockTimeoutSet);
|
||||
|
||||
if(wakeLockTimeoutSet)
|
||||
etWakeLockDuration.setText(String.valueOf(Actions.wakeLockTimeoutDisabled));
|
||||
}
|
||||
});
|
||||
|
||||
if(getIntent().hasExtra(ActivityManageRule.intentNameActionParameter1))
|
||||
{
|
||||
rbWakeLockActivate.setChecked(getIntent().getBooleanExtra(ActivityManageRule.intentNameActionParameter1, true));
|
||||
rbWakeLockDeactivate.setChecked(!getIntent().getBooleanExtra(ActivityManageRule.intentNameActionParameter1, false));
|
||||
|
||||
if(getIntent().hasExtra(ActivityManageRule.intentNameActionParameter2))
|
||||
{
|
||||
if(Miscellaneous.isNumeric(getIntent().getStringExtra(ActivityManageRule.intentNameActionParameter2)))
|
||||
{
|
||||
long timeout = Long.parseLong((getIntent().getStringExtra(ActivityManageRule.intentNameActionParameter2)));
|
||||
chkWakeLockTimeout.setChecked(timeout != Actions.wakeLockTimeoutDisabled);
|
||||
etWakeLockDuration.setText(String.valueOf(timeout));
|
||||
}
|
||||
else
|
||||
{
|
||||
chkWakeLockTimeout.setChecked(false);
|
||||
etWakeLockDuration.setText(String.valueOf(Actions.wakeLockTimeoutDisabled));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bSaveWakelock.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
if(chkWakeLockTimeout.isChecked())
|
||||
{
|
||||
if((StringUtils.isEmpty(etWakeLockDuration.getText().toString()) || Integer.parseInt(etWakeLockDuration.getText().toString()) <= 0))
|
||||
{
|
||||
Toast.makeText(ActivityManageActionWakeLock.this, getResources().getString(R.string.enterAPositiveValidNonDecimalNumber), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Intent response = new Intent();
|
||||
response.putExtra(ActivityManageRule.intentNameActionParameter1, rbWakeLockActivate.isChecked());
|
||||
if(chkWakeLockTimeout.isChecked())
|
||||
response.putExtra(ActivityManageRule.intentNameActionParameter2, etWakeLockDuration.getText().toString());
|
||||
else
|
||||
response.putExtra(ActivityManageRule.intentNameActionParameter2, String.valueOf(Actions.wakeLockTimeoutDisabled));
|
||||
setResult(RESULT_OK, response);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class ActivityManageActionWifi extends Activity
|
||||
{
|
||||
CheckBox chkWifiRunAsRoot;
|
||||
RadioButton rbActionWifiOn, rbActionWifiOff;
|
||||
Button bActionWifiSave;
|
||||
TextView tvWifiExplanation1, tvWifiExplanation2;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_action_wifi);
|
||||
|
||||
chkWifiRunAsRoot = (CheckBox)findViewById(R.id.chkWifiRunAsRoot);
|
||||
rbActionWifiOn = (RadioButton) findViewById(R.id.rbActionWifiOn);
|
||||
rbActionWifiOff = (RadioButton)findViewById(R.id.rbActionWifiOff);
|
||||
bActionWifiSave = (Button) findViewById(R.id.bActionWifiSave);
|
||||
tvWifiExplanation1 = (TextView)findViewById(R.id.tvWifiExplanation1);
|
||||
tvWifiExplanation2 = (TextView)findViewById(R.id.tvWifiExplanation2);
|
||||
|
||||
Intent input = getIntent();
|
||||
if(input.hasExtra(ActivityManageRule.intentNameActionParameter1))
|
||||
rbActionWifiOn.setChecked(input.getBooleanExtra(ActivityManageRule.intentNameActionParameter1, true));
|
||||
|
||||
if(input.hasExtra(ActivityManageRule.intentNameActionParameter2))
|
||||
chkWifiRunAsRoot.setChecked(Boolean.parseBoolean(input.getStringExtra(ActivityManageRule.intentNameActionParameter2)));
|
||||
|
||||
// if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||
// Miscellaneous.messageBox(getResources().getString(R.string.app_name), getResources().getString(R.string.android10WifiToggleNotice), ActivityManageActionWifi.this).show();
|
||||
|
||||
if(getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q)
|
||||
tvWifiExplanation1.setVisibility(View.VISIBLE);
|
||||
else
|
||||
tvWifiExplanation1.setVisibility(View.GONE);
|
||||
|
||||
bActionWifiSave.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
Intent response = new Intent();
|
||||
response.putExtra(ActivityManageRule.intentNameActionParameter1, rbActionWifiOn.isChecked());
|
||||
response.putExtra(ActivityManageRule.intentNameActionParameter2, String.valueOf(chkWifiRunAsRoot.isChecked()));
|
||||
setResult(RESULT_OK, response);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -12,6 +12,7 @@ import android.location.Location;
|
||||
import android.location.LocationListener;
|
||||
import android.location.LocationManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.view.View;
|
||||
@ -33,7 +34,6 @@ public class ActivityManagePoi extends Activity
|
||||
public LocationManager myLocationManager;
|
||||
MyLocationListenerGps myLocationListenerGps = new MyLocationListenerGps();
|
||||
Location locationGps = null, locationNetwork = null;
|
||||
// Location locationWifi = null;
|
||||
MyLocationListenerNetwork myLocationListenerNetwork = new MyLocationListenerNetwork();
|
||||
Button bGetPosition, bSavePoi;
|
||||
ImageButton ibShowOnMap;
|
||||
@ -83,17 +83,17 @@ public class ActivityManagePoi extends Activity
|
||||
bSavePoi = (Button)findViewById(R.id.bSavePoi);
|
||||
bSavePoi.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
hideKeyboard();
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
hideKeyboard();
|
||||
|
||||
if(ActivityMainPoi.poiToEdit == null)
|
||||
createPoi();
|
||||
else
|
||||
changePoi();
|
||||
}
|
||||
});
|
||||
if(ActivityMainPoi.poiToEdit == null)
|
||||
createPoi();
|
||||
else
|
||||
changePoi();
|
||||
}
|
||||
});
|
||||
|
||||
ibShowOnMap.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@ -136,42 +136,45 @@ public class ActivityManagePoi extends Activity
|
||||
|
||||
private void getLocation()
|
||||
{
|
||||
Criteria critNetwork = new Criteria();
|
||||
critNetwork.setPowerRequirement(Criteria.POWER_LOW);
|
||||
critNetwork.setAltitudeRequired(false);
|
||||
critNetwork.setSpeedRequired(false);
|
||||
critNetwork.setBearingRequired(false);
|
||||
critNetwork.setCostAllowed(false);
|
||||
critNetwork.setAccuracy(Criteria.ACCURACY_COARSE);
|
||||
Criteria criteriaNetwork = new Criteria();
|
||||
criteriaNetwork.setPowerRequirement(Criteria.POWER_LOW);
|
||||
criteriaNetwork.setAltitudeRequired(false);
|
||||
criteriaNetwork.setSpeedRequired(false);
|
||||
criteriaNetwork.setBearingRequired(false);
|
||||
criteriaNetwork.setCostAllowed(false);
|
||||
criteriaNetwork.setAccuracy(Criteria.ACCURACY_COARSE);
|
||||
|
||||
Criteria criteriaGps = new Criteria();
|
||||
criteriaGps.setAltitudeRequired(false);
|
||||
criteriaGps.setSpeedRequired(false);
|
||||
criteriaGps.setBearingRequired(false);
|
||||
criteriaGps.setCostAllowed(true);
|
||||
criteriaGps.setAccuracy(Criteria.ACCURACY_FINE);
|
||||
|
||||
Criteria critGps = new Criteria();
|
||||
critGps.setAltitudeRequired(false);
|
||||
critGps.setSpeedRequired(false);
|
||||
critGps.setBearingRequired(false);
|
||||
critGps.setCostAllowed(true);
|
||||
critGps.setAccuracy(Criteria.ACCURACY_FINE);
|
||||
|
||||
String provider1 = myLocationManager.getBestProvider(critNetwork, true);
|
||||
String provider2 = myLocationManager.getBestProvider(critGps, true);
|
||||
String provider1 = myLocationManager.getBestProvider(criteriaNetwork, true);
|
||||
String provider2 = myLocationManager.getBestProvider(criteriaGps, true);
|
||||
// String provider3 = myLocationManager.getProvider("wifi");
|
||||
|
||||
if(provider1 == null | provider2 == null)
|
||||
if(provider1 == null || provider2 == null)
|
||||
{
|
||||
Toast.makeText(this, getResources().getString(R.string.logNoSuitableProvider), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(provider1.equals(provider2))
|
||||
Miscellaneous.logEvent("i", "POI Manager", "Both location providers are equal. Only one will be used.", 4);
|
||||
|
||||
locationSearchStart = Calendar.getInstance();
|
||||
startTimeout();
|
||||
|
||||
if(!Settings.privacyLocationing || !ConnectivityReceiver.isDataConnectionAvailable(AutomationService.getInstance()))
|
||||
if(!Settings.privacyLocationing && !ConnectivityReceiver.isDataConnectionAvailable(Miscellaneous.getAnyContext()) && !provider1.equals(provider2))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "POI Manager", getResources().getString(R.string.logGettingPositionWithProvider) + " " + provider1, 3);
|
||||
myLocationManager.requestLocationUpdates(provider1, 500, Settings.satisfactoryAccuracyNetwork, myLocationListenerNetwork);
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("i", "POI Manager", "Skipping network location query because private locationing is active.", 4);
|
||||
Miscellaneous.logEvent("i", "POI Manager", "Skipping network location.", 4);
|
||||
|
||||
Miscellaneous.logEvent("i", "POI Manager", getResources().getString(R.string.logGettingPositionWithProvider) + " " + provider2, 3);
|
||||
myLocationManager.requestLocationUpdates(provider2, 500, Settings.satisfactoryAccuracyGps, myLocationListenerGps);
|
||||
@ -310,7 +313,21 @@ public class ActivityManagePoi extends Activity
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
progressDialog = ProgressDialog.show(ActivityManagePoi.this, "", getResources().getString(R.string.gettingPosition), true, true);
|
||||
getLocation();
|
||||
if(Build.VERSION.SDK_INT >= 31)
|
||||
{
|
||||
AlertDialog dia = Miscellaneous.messageBox(getResources().getString(R.string.info), getResources().getString(R.string.locationNotWorkingOn12), ActivityManagePoi.this);
|
||||
dia.setOnDismissListener(new DialogInterface.OnDismissListener()
|
||||
{
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialogInterface)
|
||||
{
|
||||
getLocation();
|
||||
}
|
||||
});
|
||||
dia.show();
|
||||
}
|
||||
else
|
||||
getLocation();
|
||||
}
|
||||
};
|
||||
alertDialogBuilder.setMessage(text).setPositiveButton("Ok", dialogClickListener);
|
||||
|
@ -44,6 +44,8 @@ public class ActivityManageProfile extends Activity
|
||||
Button bChangeSoundIncomingCalls, bChangeSoundNotifications, bSaveProfile;
|
||||
TextView tvIncomingCallsRingtone, tvNotificationsRingtone;
|
||||
EditText etName;
|
||||
|
||||
boolean guiUpdate = false;
|
||||
|
||||
File incomingCallsRingtone = null, notificationsRingtone = null;
|
||||
|
||||
@ -368,6 +370,8 @@ public class ActivityManageProfile extends Activity
|
||||
|
||||
public void editProfile(Profile profileToEdit)
|
||||
{
|
||||
guiUpdate = true;
|
||||
|
||||
etName.setText(ActivityMainProfiles.profileToEdit.getName());
|
||||
checkBoxChangeSoundMode.setChecked(ActivityMainProfiles.profileToEdit.getChangeSoundMode());
|
||||
checkBoxChangeDnd.setChecked(ActivityMainProfiles.profileToEdit.getChangeDndMode());
|
||||
@ -393,6 +397,8 @@ public class ActivityManageProfile extends Activity
|
||||
|
||||
setIncomingCallsRingtone(ActivityMainProfiles.profileToEdit.getIncomingCallsRingtone());
|
||||
setNotificationsRingtone(ActivityMainProfiles.profileToEdit.getNotificationRingtone());
|
||||
|
||||
guiUpdate = false;
|
||||
}
|
||||
|
||||
private boolean loadFormValuesToVariable()
|
||||
|
@ -65,20 +65,18 @@ public class ActivityManageRule extends Activity
|
||||
static ProgressDialog progressDialog = null;
|
||||
|
||||
static Trigger_Enum triggerType;
|
||||
static boolean triggerParameter;
|
||||
static PointOfInterest triggerPoi;
|
||||
static String triggerProcess;
|
||||
static int triggerBattery;
|
||||
static double triggerSpeed;
|
||||
static double triggerNoise;
|
||||
static TimeFrame triggerTimeFrame;
|
||||
static String triggerWifiName;
|
||||
|
||||
static Rule ruleToEdit;
|
||||
|
||||
static boolean newRule;
|
||||
|
||||
static Trigger newTrigger;
|
||||
static Action newAction;
|
||||
|
||||
Rule ruleToEdit = null;
|
||||
|
||||
ArrayAdapter<Trigger> triggerListViewAdapter;
|
||||
ArrayAdapter<Action> actionListViewAdapter;
|
||||
@ -102,7 +100,7 @@ public class ActivityManageRule extends Activity
|
||||
final static int requestCodeTriggerDeviceOrientationAdd = 301;
|
||||
final static int requestCodeTriggerDeviceOrientationEdit = 302;
|
||||
final static int requestCodeTriggerNotificationAdd = 8000;
|
||||
final static int requestCodeTriggerNfcNotificationEdit = 8001;
|
||||
final static int requestCodeTriggerNotificationEdit = 8001;
|
||||
final static int requestCodeActionPlaySoundAdd = 501;
|
||||
final static int requestCodeActionPlaySoundEdit = 502;
|
||||
final static int requestCodeTriggerPhoneCallAdd = 601;
|
||||
@ -115,7 +113,27 @@ public class ActivityManageRule extends Activity
|
||||
final static int requestCodeActionSendTextMessageEdit = 5002;
|
||||
final static int requestCodeActionVibrateAdd = 801;
|
||||
final static int requestCodeActionVibrateEdit = 802;
|
||||
|
||||
final static int requestCodeActionCreateNotificationAdd = 803;
|
||||
final static int requestCodeActionCreateNotificationEdit = 804;
|
||||
final static int requestCodeActionCloseNotificationAdd = 805;
|
||||
final static int requestCodeActionCloseNotificationEdit = 806;
|
||||
final static int requestCodeActionControlMediaAdd = 807;
|
||||
final static int requestCodeActionControlMediaEdit = 808;
|
||||
final static int requestCodeTriggerBroadcastReceivedAdd = 809;
|
||||
final static int requestCodeTriggerBroadcastReceivedEdit = 810;
|
||||
final static int requestCodeActionSendBroadcastAdd = 811;
|
||||
final static int requestCodeActionSendBroadcastEdit = 812;
|
||||
final static int requestCodeActionRunExecutableAdd = 813;
|
||||
final static int requestCodeActionRunExecutableEdit = 814;
|
||||
final static int requestCodeActionSetWifiAdd = 815;
|
||||
final static int requestCodeActionSetWifiEdit = 816;
|
||||
final static int requestCodeTriggerTetheringAdd = 817;
|
||||
final static int requestCodeTriggerTetheringEdit = 818;
|
||||
final static int requestCodeActionWakeLockAdd = 819;
|
||||
final static int requestCodeActionWakeLockEdit = 820;
|
||||
final static int requestCodeTriggerSubSystemStateAdd = 821;
|
||||
final static int requestCodeTriggerSubSystemStateEdit = 822;
|
||||
|
||||
public static ActivityManageRule getInstance()
|
||||
{
|
||||
if(instance == null)
|
||||
@ -127,10 +145,10 @@ public class ActivityManageRule extends Activity
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
context = this;
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_specific_rule);
|
||||
|
||||
|
||||
context = this;
|
||||
instance = this;
|
||||
|
||||
cmdTriggerAdd = (Button)findViewById(R.id.cmdTriggerAdd);
|
||||
@ -144,7 +162,17 @@ public class ActivityManageRule extends Activity
|
||||
imageHelpButton = (ImageView)findViewById(R.id.imageHelpButton);
|
||||
|
||||
//decide if it will be created anew or loaded to edit an existing one
|
||||
if(ActivityMainRules.ruleToEdit == null)
|
||||
if(getIntent().hasExtra(ActivityMainRules.intentNameRuleName))
|
||||
{
|
||||
// change existing rule
|
||||
Miscellaneous.logEvent("i", "Rule", "Cache not empty, assuming change request.", 3);
|
||||
newRule = false;
|
||||
ruleToEdit = Rule.getByName(getIntent().getStringExtra(ActivityMainRules.intentNameRuleName));
|
||||
triggerListViewAdapter = new ArrayAdapter<Trigger>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ruleToEdit.getTriggerSet());
|
||||
actionListViewAdapter = new ArrayAdapter<Action>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ruleToEdit.getActionSet());
|
||||
loadVariablesIntoGui();
|
||||
}
|
||||
else
|
||||
{
|
||||
// new rule
|
||||
Miscellaneous.logEvent("i", "Rule", "Cache empty, assuming create request.", 3);
|
||||
@ -155,16 +183,6 @@ public class ActivityManageRule extends Activity
|
||||
triggerListViewAdapter = new ArrayAdapter<Trigger>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ruleToEdit.getTriggerSet());
|
||||
actionListViewAdapter = new ArrayAdapter<Action>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ruleToEdit.getActionSet());
|
||||
}
|
||||
else
|
||||
{
|
||||
// change existing rule
|
||||
Miscellaneous.logEvent("i", "Rule", "Cache not empty, assuming change request.", 3);
|
||||
newRule = false;
|
||||
ruleToEdit = ActivityMainRules.ruleToEdit;
|
||||
triggerListViewAdapter = new ArrayAdapter<Trigger>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ruleToEdit.getTriggerSet());
|
||||
actionListViewAdapter = new ArrayAdapter<Action>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ruleToEdit.getActionSet());
|
||||
loadVariablesIntoGui();
|
||||
}
|
||||
|
||||
cmdTriggerAdd.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@ -253,8 +271,9 @@ public class ActivityManageRule extends Activity
|
||||
switch(selectedTrigger.getTriggerType())
|
||||
{
|
||||
case timeFrame:
|
||||
ActivityManageTriggerTimeFrame.editedTimeFrameTrigger = selectedTrigger;
|
||||
Intent timeFrameEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerTimeFrame.class);
|
||||
timeFrameEditor.putExtra(intentNameTriggerParameter1, selectedTrigger.getTriggerParameter());
|
||||
timeFrameEditor.putExtra(intentNameTriggerParameter2, selectedTrigger.getTriggerParameter2());
|
||||
startActivityForResult(timeFrameEditor, requestCodeTriggerTimeframeEdit);
|
||||
break;
|
||||
case bluetoothConnection:
|
||||
@ -266,7 +285,7 @@ public class ActivityManageRule extends Activity
|
||||
ActivityManageTriggerNotification.editedNotificationTrigger = selectedTrigger;
|
||||
Intent notificationEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerNotification.class);
|
||||
notificationEditor.putExtra("edit", true);
|
||||
startActivityForResult(notificationEditor, requestCodeTriggerNfcNotificationEdit);
|
||||
startActivityForResult(notificationEditor, requestCodeTriggerNotificationEdit);
|
||||
break;
|
||||
case phoneCall:
|
||||
ActivityManageTriggerPhoneCall.editedPhoneCallTrigger = selectedTrigger;
|
||||
@ -293,6 +312,24 @@ public class ActivityManageRule extends Activity
|
||||
devicePositionEditor.putExtra(ActivityManageTriggerDeviceOrientation.vectorFieldName, selectedTrigger.getTriggerParameter2());
|
||||
startActivityForResult(devicePositionEditor, requestCodeTriggerDeviceOrientationEdit);
|
||||
break;
|
||||
case broadcastReceived:
|
||||
Intent broadcastEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerBroadcast.class);
|
||||
broadcastEditor.putExtra(intentNameTriggerParameter1, selectedTrigger.getTriggerParameter());
|
||||
broadcastEditor.putExtra(intentNameTriggerParameter2, selectedTrigger.getTriggerParameter2());
|
||||
startActivityForResult(broadcastEditor, requestCodeTriggerBroadcastReceivedEdit);
|
||||
break;
|
||||
case tethering:
|
||||
Intent tetheringEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerTethering.class);
|
||||
tetheringEditor.putExtra(intentNameTriggerParameter1, selectedTrigger.getTriggerParameter());
|
||||
tetheringEditor.putExtra(intentNameTriggerParameter2, selectedTrigger.getTriggerParameter2());
|
||||
startActivityForResult(tetheringEditor, requestCodeTriggerTetheringEdit);
|
||||
break;
|
||||
case subSystemState:
|
||||
Intent subSystemStateEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerSubSystemState.class);
|
||||
subSystemStateEditor.putExtra(intentNameTriggerParameter1, selectedTrigger.getTriggerParameter());
|
||||
subSystemStateEditor.putExtra(intentNameTriggerParameter2, selectedTrigger.getTriggerParameter2());
|
||||
startActivityForResult(subSystemStateEditor, requestCodeTriggerSubSystemStateEdit);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -328,8 +365,8 @@ public class ActivityManageRule extends Activity
|
||||
{
|
||||
case startOtherActivity:
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionStartActivity.class);
|
||||
ActivityManageActionStartActivity.resultingAction = a;
|
||||
intent.putExtra("edit", true);
|
||||
intent.putExtra(intentNameActionParameter1, a.getParameter1());
|
||||
intent.putExtra(intentNameActionParameter2, a.getParameter2());
|
||||
startActivityForResult(intent, requestCodeActionStartActivityEdit);
|
||||
break;
|
||||
case triggerUrl:
|
||||
@ -353,8 +390,8 @@ public class ActivityManageRule extends Activity
|
||||
break;
|
||||
case setScreenBrightness:
|
||||
Intent activityEditScreenBrightnessIntent = new Intent(ActivityManageRule.this, ActivityManageActionBrightnessSetting.class);
|
||||
activityEditScreenBrightnessIntent.putExtra("autoBrightness", a.getParameter1());
|
||||
activityEditScreenBrightnessIntent.putExtra("brightnessValue", Integer.parseInt(a.getParameter2()));
|
||||
activityEditScreenBrightnessIntent.putExtra(ActivityManageActionBrightnessSetting.intentNameAutoBrightness, a.getParameter1());
|
||||
activityEditScreenBrightnessIntent.putExtra(ActivityManageActionBrightnessSetting.intentNameBrightnessValue, Integer.parseInt(a.getParameter2()));
|
||||
startActivityForResult(activityEditScreenBrightnessIntent, requestCodeActionScreenBrightnessEdit);
|
||||
break;
|
||||
case vibrate:
|
||||
@ -362,6 +399,46 @@ public class ActivityManageRule extends Activity
|
||||
activityEditVibrateIntent.putExtra("vibratePattern", a.getParameter2());
|
||||
startActivityForResult(activityEditVibrateIntent, requestCodeActionVibrateEdit);
|
||||
break;
|
||||
case sendBroadcast:
|
||||
Intent activityEditSendBroadcastIntent = new Intent(ActivityManageRule.this, ActivityManageActionSendBroadcast.class);
|
||||
activityEditSendBroadcastIntent.putExtra(intentNameActionParameter2, a.getParameter2());
|
||||
startActivityForResult(activityEditSendBroadcastIntent, requestCodeActionSendBroadcastEdit);
|
||||
break;
|
||||
case wakelock:
|
||||
Intent activityEditWakeLockIntent = new Intent(ActivityManageRule.this, ActivityManageActionWakeLock.class);
|
||||
activityEditWakeLockIntent.putExtra(intentNameActionParameter1, a.getParameter1());
|
||||
activityEditWakeLockIntent.putExtra(intentNameActionParameter2, a.getParameter2());
|
||||
startActivityForResult(activityEditWakeLockIntent, requestCodeActionWakeLockEdit);
|
||||
break;
|
||||
case runExecutable:
|
||||
Intent activityEditRunExecutableIntent = new Intent(ActivityManageRule.this, ActivityManageActionRunExecutable.class);
|
||||
activityEditRunExecutableIntent.putExtra(intentNameActionParameter1, a.getParameter1());
|
||||
activityEditRunExecutableIntent.putExtra(intentNameActionParameter2, a.getParameter2());
|
||||
startActivityForResult(activityEditRunExecutableIntent, requestCodeActionRunExecutableEdit);
|
||||
break;
|
||||
case setWifi:
|
||||
Intent activityEditSetWifiIntent = new Intent(ActivityManageRule.this, ActivityManageActionWifi.class);
|
||||
activityEditSetWifiIntent.putExtra(intentNameActionParameter1, a.getParameter1());
|
||||
activityEditSetWifiIntent.putExtra(intentNameActionParameter2, a.getParameter2());
|
||||
startActivityForResult(activityEditSetWifiIntent, requestCodeActionSetWifiEdit);
|
||||
break;
|
||||
case controlMediaPlayback:
|
||||
Intent activityEditControlMediaIntent = new Intent(ActivityManageRule.this, ActivityManageActionControlMedia.class);
|
||||
activityEditControlMediaIntent.putExtra(ActivityManageRule.intentNameActionParameter2, a.getParameter2());
|
||||
startActivityForResult(activityEditControlMediaIntent, requestCodeActionControlMediaEdit);
|
||||
break;
|
||||
case createNotification:
|
||||
Intent activityEditCreateNotificationIntent = new Intent(ActivityManageRule.this, ActivityManageActionCreateNotification.class);
|
||||
String[] elements = a.getParameter2().split(Action.actionParameter2Split);
|
||||
activityEditCreateNotificationIntent.putExtra(ActivityManageActionCreateNotification.intentNameNotificationTitle, elements[0]);
|
||||
activityEditCreateNotificationIntent.putExtra(ActivityManageActionCreateNotification.intentNameNotificationText, elements[1]);
|
||||
startActivityForResult(activityEditCreateNotificationIntent, requestCodeActionCreateNotificationEdit);
|
||||
break;
|
||||
case closeNotification:
|
||||
Intent activityEditCloseNotificationIntent = new Intent(ActivityManageRule.this, ActivityManageActionCloseNotification.class);
|
||||
activityEditCloseNotificationIntent.putExtra(intentNameActionParameter2, a.getParameter2());
|
||||
startActivityForResult(activityEditCloseNotificationIntent, requestCodeActionCloseNotificationEdit);
|
||||
break;
|
||||
case playSound:
|
||||
Intent actionPlaySoundIntent = new Intent(context, ActivityManageActionPlaySound.class);
|
||||
actionPlaySoundIntent.putExtra("edit", true);
|
||||
@ -464,7 +541,6 @@ public class ActivityManageRule extends Activity
|
||||
|
||||
for(int i=0; i<types.length; i++)
|
||||
{
|
||||
//pointOfInterest, timeFrame, charging, batteryLevel, usb_host_connection, speed, noiseLevel, wifiConnection, process_started_stopped;
|
||||
if(types[i].toString().equals(Trigger_Enum.pointOfInterest.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.compass_small));
|
||||
else if(types[i].toString().equals(Trigger_Enum.timeFrame.toString()))
|
||||
@ -487,9 +563,10 @@ public class ActivityManageRule extends Activity
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.plane));
|
||||
else if(types[i].toString().equals(Trigger_Enum.roaming.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.roaming));
|
||||
else if(types[i].toString().equals(Trigger_Enum.broadcastReceived.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.megaphone));
|
||||
else if(types[i].toString().equals(Trigger_Enum.phoneCall.toString()))
|
||||
{
|
||||
// if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageSpecificRule.this, "android.permission.SEND_SMS") && !Miscellaneous.isGooglePlayInstalled(ActivityManageSpecificRule.this))
|
||||
if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageRule.this, "android.permission.SEND_SMS"))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.phone));
|
||||
}
|
||||
@ -507,6 +584,18 @@ public class ActivityManageRule extends Activity
|
||||
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 if(types[i].toString().equals(Trigger_Enum.musicPlaying.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.sound));
|
||||
else if(types[i].toString().equals(Trigger_Enum.screenState.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.smartphone));
|
||||
else if(types[i].toString().equals(Trigger_Enum.deviceStarts.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.alarm));
|
||||
else if(types[i].toString().equals(Trigger_Enum.serviceStarts.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.alarm));
|
||||
else if(types[i].toString().equals(Trigger_Enum.tethering.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.router));
|
||||
else if(types[i].toString().equals(Trigger_Enum.subSystemState.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.subsystemstate));
|
||||
else
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.placeholder));
|
||||
}
|
||||
@ -567,11 +656,11 @@ public class ActivityManageRule extends Activity
|
||||
startActivityForResult(timeFrameEditor, requestCodeTriggerTimeframeAdd);
|
||||
return;
|
||||
}
|
||||
else if(triggerType == Trigger_Enum.charging)
|
||||
else if(triggerType == Trigger_Enum.charging || triggerType == Trigger_Enum.musicPlaying)
|
||||
booleanChoices = new String[]{getResources().getString(R.string.started), getResources().getString(R.string.stopped)};
|
||||
else if(triggerType == Trigger_Enum.usb_host_connection)
|
||||
booleanChoices = new String[]{getResources().getString(R.string.connected), getResources().getString(R.string.disconnected)};
|
||||
else if(triggerType == Trigger_Enum.speed | triggerType == Trigger_Enum.noiseLevel | triggerType == Trigger_Enum.batteryLevel)
|
||||
else if(triggerType == Trigger_Enum.speed || triggerType == Trigger_Enum.noiseLevel || triggerType == Trigger_Enum.batteryLevel)
|
||||
booleanChoices = new String[]{getResources().getString(R.string.exceeds), getResources().getString(R.string.dropsBelow)};
|
||||
else if(triggerType == Trigger_Enum.wifiConnection)
|
||||
{
|
||||
@ -588,7 +677,9 @@ public class ActivityManageRule extends Activity
|
||||
return;
|
||||
}
|
||||
else if(triggerType == Trigger_Enum.process_started_stopped)
|
||||
{
|
||||
booleanChoices = new String[]{getResources().getString(R.string.started), getResources().getString(R.string.stopped)};
|
||||
}
|
||||
else if(triggerType == Trigger_Enum.notification)
|
||||
{
|
||||
newTrigger.setTriggerType(Trigger_Enum.notification);
|
||||
@ -659,15 +750,41 @@ public class ActivityManageRule extends Activity
|
||||
}
|
||||
else if(triggerType == Trigger_Enum.bluetoothConnection)
|
||||
{
|
||||
if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH))
|
||||
Miscellaneous.messageBox("Bluetooth", getResources().getString(R.string.deviceDoesNotHaveBluetooth), ActivityManageRule.this).show();;
|
||||
// if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH))
|
||||
// //Miscellaneous.messageBox("Bluetooth", getResources().getString(R.string.deviceDoesNotHaveBluetooth), ActivityManageRule.this).show();
|
||||
// Toast.makeText(ActivityManageRule.this, getResources().getString(R.string.deviceDoesNotHaveBluetooth), Toast.LENGTH_LONG).show();
|
||||
|
||||
newTrigger.setTriggerType(Trigger_Enum.bluetoothConnection);
|
||||
ActivityManageTriggerBluetooth.editedBluetoothTrigger = newTrigger;
|
||||
Intent bluetoothEditor = new Intent(myContext, ActivityManageTriggerBluetooth.class);
|
||||
startActivityForResult(bluetoothEditor, requestCodeTriggerBluetoothAdd);
|
||||
|
||||
return;
|
||||
}
|
||||
else if(triggerType == Trigger_Enum.screenState)
|
||||
{
|
||||
newTrigger.setTriggerType(Trigger_Enum.screenState);
|
||||
getTriggerScreenStateDialog().show();
|
||||
Miscellaneous.messageBox(getResources().getString(R.string.info), getResources().getString(R.string.lockedCommentScreenMustBeOff), ActivityManageRule.this).show();
|
||||
return;
|
||||
}
|
||||
/*else if(triggerType == Trigger_Enum.deviceStarts)
|
||||
{
|
||||
newTrigger.setTriggerType(Trigger_Enum.deviceStarts);
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
refreshTriggerList();
|
||||
return;
|
||||
}*/
|
||||
else if(triggerType == Trigger_Enum.deviceStarts || triggerType == Trigger_Enum.serviceStarts)
|
||||
{
|
||||
// newTrigger.setTriggerType(Trigger_Enum.serviceStarts);
|
||||
// ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
|
||||
booleanChoices = new String[]{getResources().getString(R.string.yes), getResources().getString(R.string.no)};
|
||||
|
||||
// refreshTriggerList();
|
||||
// return;
|
||||
}
|
||||
else if(triggerType == Trigger_Enum.headsetPlugged)
|
||||
booleanChoices = new String[]{getResources().getString(R.string.connected), getResources().getString(R.string.disconnected)};
|
||||
|
||||
@ -676,8 +793,32 @@ public class ActivityManageRule extends Activity
|
||||
if (NfcReceiver.checkNfcRequirements(ActivityManageRule.this, true))
|
||||
getTriggerParameterDialog(context, booleanChoices).show();
|
||||
}
|
||||
else if(triggerType == Trigger_Enum.broadcastReceived)
|
||||
{
|
||||
newTrigger.setTriggerType(Trigger_Enum.broadcastReceived);
|
||||
Intent broadcastTriggerEditor = new Intent(myContext, ActivityManageTriggerBroadcast.class);
|
||||
startActivityForResult(broadcastTriggerEditor, requestCodeTriggerBroadcastReceivedAdd);
|
||||
return;
|
||||
}
|
||||
else if(triggerType == Trigger_Enum.tethering)
|
||||
{
|
||||
newTrigger.setTriggerType(Trigger_Enum.tethering);
|
||||
Intent tetheringTriggerEditor = new Intent(myContext, ActivityManageTriggerTethering.class);
|
||||
startActivityForResult(tetheringTriggerEditor, requestCodeTriggerTetheringAdd);
|
||||
return;
|
||||
}
|
||||
else if(triggerType == Trigger_Enum.subSystemState)
|
||||
{
|
||||
newTrigger.setTriggerType(Trigger_Enum.subSystemState);
|
||||
Intent subSystemStateTriggerEditor = new Intent(myContext, ActivityManageTriggerSubSystemState.class);
|
||||
startActivityForResult(subSystemStateTriggerEditor, requestCodeTriggerSubSystemStateAdd);
|
||||
return;
|
||||
}
|
||||
else
|
||||
getTriggerParameterDialog(context, booleanChoices).show();
|
||||
|
||||
if(triggerType.equals(Trigger_Enum.process_started_stopped))
|
||||
Miscellaneous.messageBox(getResources().getString(R.string.info), String.format(getResources().getString(R.string.featureCeasedToWorkLastWorkingAndroidVersion), "7"), ActivityManageRule.this).show();
|
||||
}
|
||||
});
|
||||
|
||||
@ -687,7 +828,7 @@ public class ActivityManageRule extends Activity
|
||||
private AlertDialog getTriggerParameterDialog(final Context myContext, final String[] choices)
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectTypeOfTrigger));
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.selectParameters));
|
||||
alertDialogBuilder.setItems(choices, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
@ -764,6 +905,7 @@ public class ActivityManageRule extends Activity
|
||||
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
private AlertDialog getTriggerBatteryDialog(final Context myContext, final String[] choices)
|
||||
{
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
|
||||
@ -778,6 +920,7 @@ public class ActivityManageRule extends Activity
|
||||
triggerBattery = (which+1);
|
||||
newTrigger.setTriggerType(Trigger_Enum.batteryLevel);
|
||||
newTrigger.setBatteryLevel(triggerBattery);
|
||||
newTrigger.setTriggerParameter2(String.valueOf(triggerBattery));
|
||||
// Log.i("test", newTrigger.toString());
|
||||
// Log.i("test", String.valueOf(newTrigger.getBatteryLevel()));
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
@ -999,6 +1142,36 @@ public class ActivityManageRule extends Activity
|
||||
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
private AlertDialog getTriggerScreenStateDialog()
|
||||
{
|
||||
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
|
||||
|
||||
alertDialog.setTitle(Miscellaneous.getAnyContext().getResources().getString(R.string.selectDesiredState));
|
||||
|
||||
String[] choices = {
|
||||
Miscellaneous.getAnyContext().getResources().getString(R.string.off),
|
||||
Miscellaneous.getAnyContext().getResources().getString(R.string.on),
|
||||
Miscellaneous.getAnyContext().getResources().getString(R.string.unlocked),
|
||||
Miscellaneous.getAnyContext().getResources().getString(R.string.lockedWithoutSecurity),
|
||||
Miscellaneous.getAnyContext().getResources().getString(R.string.lockedWithSecurity)
|
||||
};
|
||||
|
||||
alertDialog.setItems(choices, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
newTrigger.setTriggerParameter(true);
|
||||
newTrigger.setTriggerParameter2(String.valueOf(which));
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
refreshTriggerList();
|
||||
}
|
||||
});
|
||||
|
||||
return alertDialog.create();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
private AlertDialog getTriggerActivityDetectionDialog()
|
||||
{
|
||||
@ -1088,9 +1261,6 @@ public class ActivityManageRule extends Activity
|
||||
});
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
// Log.i("Amount of Applications", String.valueOf(applicationArray.length));
|
||||
// Log.i("Amount of Packages", String.valueOf(ActivityManageStartActivity.getPackageListString(myContext).length));
|
||||
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@ -1127,6 +1297,7 @@ public class ActivityManageRule extends Activity
|
||||
triggerProcess = activityArray[which];
|
||||
newTrigger.setTriggerType(Trigger_Enum.process_started_stopped);
|
||||
newTrigger.setProcessName(triggerProcess);
|
||||
newTrigger.setTriggerParameter2(packageName + Trigger.triggerParameter2Split + triggerProcess);
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
refreshTriggerList();
|
||||
}
|
||||
@ -1174,9 +1345,15 @@ public class ActivityManageRule extends Activity
|
||||
else if(requestCode == requestCodeTriggerTimeframeEdit)
|
||||
{
|
||||
//edit TimeFrame
|
||||
if(resultCode == RESULT_OK && ActivityManageTriggerTimeFrame.editedTimeFrameTrigger != null)
|
||||
if(resultCode == RESULT_OK && data.hasExtra(intentNameTriggerParameter2))
|
||||
{
|
||||
ActivityManageTriggerTimeFrame.editedTimeFrameTrigger.setParentRule(ruleToEdit);
|
||||
Trigger responseTimeFrame = new Trigger();
|
||||
responseTimeFrame.setTriggerType(Trigger_Enum.timeFrame);
|
||||
responseTimeFrame.setTriggerParameter(data.getBooleanExtra(intentNameTriggerParameter1, true));
|
||||
responseTimeFrame.setTriggerParameter2(data.getStringExtra(intentNameTriggerParameter2));
|
||||
responseTimeFrame.setTimeFrame(new TimeFrame(data.getStringExtra(intentNameTriggerParameter2)));
|
||||
responseTimeFrame.setParentRule(ruleToEdit);
|
||||
ruleToEdit.getTriggerSet().set(editIndex, responseTimeFrame);
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
else
|
||||
@ -1211,8 +1388,10 @@ public class ActivityManageRule extends Activity
|
||||
// manage start of other activity
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction = ActivityManageActionStartActivity.resultingAction;
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
newAction.setAction(Action_Enum.startOtherActivity);
|
||||
newAction.setParameter1(data.getBooleanExtra(intentNameActionParameter1, true));
|
||||
newAction.setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
@ -1222,9 +1401,14 @@ public class ActivityManageRule extends Activity
|
||||
// manage start of other activity
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction = ActivityManageActionStartActivity.resultingAction;
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
// ruleToEdit.getActionSet().add(newAction);
|
||||
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
|
||||
|
||||
if(data.hasExtra(intentNameActionParameter1))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra(intentNameActionParameter1, true));
|
||||
|
||||
if(data.hasExtra(intentNameActionParameter2))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
@ -1260,12 +1444,22 @@ public class ActivityManageRule extends Activity
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeTriggerNfcNotificationEdit)
|
||||
else if(requestCode == requestCodeTriggerNotificationEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newTrigger = ActivityManageTriggerNotification.resultingTrigger;
|
||||
newTrigger.setParentRule(ruleToEdit);
|
||||
Trigger editedTrigger = new Trigger();
|
||||
editedTrigger.setTriggerType(Trigger_Enum.notification);
|
||||
editedTrigger.setTriggerParameter(data.getBooleanExtra(ActivityManageTriggerNotification.intentNameNotificationDirection, false));
|
||||
editedTrigger.setTriggerParameter2(
|
||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationApp) + Trigger.triggerParameter2Split +
|
||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationTitleDir) + Trigger.triggerParameter2Split +
|
||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationTitle) + Trigger.triggerParameter2Split +
|
||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationTextDir) + Trigger.triggerParameter2Split +
|
||||
data.getStringExtra(ActivityManageTriggerNotification.intentNameNotificationText)
|
||||
);
|
||||
editedTrigger.setParentRule(ruleToEdit);
|
||||
ruleToEdit.getTriggerSet().set(editIndex, editedTrigger);
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
}
|
||||
@ -1275,7 +1469,7 @@ public class ActivityManageRule extends Activity
|
||||
{
|
||||
newTrigger.setParentRule(ruleToEdit);
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
newTrigger.setTriggerParameter2(data.getStringExtra("triggerParameter2"));
|
||||
newTrigger.setTriggerParameter2(data.getStringExtra(intentNameTriggerParameter2));
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
}
|
||||
@ -1335,8 +1529,8 @@ public class ActivityManageRule extends Activity
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction.setParameter1(data.getBooleanExtra("autoBrightness", false));
|
||||
newAction.setParameter2(String.valueOf(data.getIntExtra("brightnessValue", 0)));
|
||||
newAction.setParameter1(data.getBooleanExtra(ActivityManageActionBrightnessSetting.intentNameAutoBrightness, false));
|
||||
newAction.setParameter2(String.valueOf(data.getIntExtra(ActivityManageActionBrightnessSetting.intentNameBrightnessValue, 0)));
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
@ -1346,11 +1540,11 @@ public class ActivityManageRule extends Activity
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
if(data.hasExtra("autoBrightness"))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra("autoBrightness", false));
|
||||
if(data.hasExtra(ActivityManageActionBrightnessSetting.intentNameAutoBrightness))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra(ActivityManageActionBrightnessSetting.intentNameAutoBrightness, false));
|
||||
|
||||
if(data.hasExtra("brightnessValue"))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(String.valueOf(data.getIntExtra("brightnessValue", 0)));
|
||||
if(data.hasExtra(ActivityManageActionBrightnessSetting.intentNameBrightnessValue))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(String.valueOf(data.getIntExtra(ActivityManageActionBrightnessSetting.intentNameBrightnessValue, 0)));
|
||||
|
||||
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
|
||||
|
||||
@ -1367,6 +1561,83 @@ public class ActivityManageRule extends Activity
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionSendBroadcastAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
newAction.setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionRunExecutableAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
newAction.setParameter1(data.getBooleanExtra(intentNameActionParameter1, false));
|
||||
newAction.setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionWakeLockAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
newAction.setParameter1(data.getBooleanExtra(intentNameActionParameter1, false));
|
||||
newAction.setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionControlMediaAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
newAction.setParameter2(data.getStringExtra(ActivityManageRule.intentNameActionParameter2));
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionSetWifiAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
newAction.setParameter1(data.getBooleanExtra(ActivityManageRule.intentNameActionParameter1, true));
|
||||
newAction.setParameter2(data.getStringExtra(ActivityManageRule.intentNameActionParameter2));
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionCreateNotificationAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
newAction.setParameter2(
|
||||
data.getStringExtra(ActivityManageActionCreateNotification.intentNameNotificationTitle)
|
||||
+ Action.actionParameter2Split +
|
||||
data.getStringExtra(ActivityManageActionCreateNotification.intentNameNotificationText)
|
||||
);
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionCloseNotificationAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newAction.setParentRule(ruleToEdit);
|
||||
newAction.setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
ruleToEdit.getActionSet().add(newAction);
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionVibrateEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
@ -1379,6 +1650,103 @@ public class ActivityManageRule extends Activity
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionSendBroadcastEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
|
||||
|
||||
if(data.hasExtra(intentNameActionParameter2))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionWakeLockEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
|
||||
|
||||
if(data.hasExtra(intentNameActionParameter1))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra(intentNameActionParameter1, true));
|
||||
|
||||
if(data.hasExtra(intentNameActionParameter2))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionRunExecutableEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
|
||||
|
||||
if(data.hasExtra(intentNameActionParameter1) && data.hasExtra(intentNameActionParameter2))
|
||||
{
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra(intentNameActionParameter1, false));
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
}
|
||||
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionSetWifiEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
|
||||
|
||||
if(data.hasExtra(intentNameActionParameter1) && data.hasExtra(intentNameActionParameter2))
|
||||
{
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra(intentNameActionParameter1, false));
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
}
|
||||
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionControlMediaEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
|
||||
|
||||
if(data.hasExtra(intentNameActionParameter2))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionCreateNotificationEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
|
||||
|
||||
if(data.hasExtra(ActivityManageActionCreateNotification.intentNameNotificationTitle))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(
|
||||
data.getStringExtra(ActivityManageActionCreateNotification.intentNameNotificationTitle)
|
||||
+ Action.actionParameter2Split +
|
||||
data.getStringExtra(ActivityManageActionCreateNotification.intentNameNotificationText)
|
||||
);
|
||||
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionCloseNotificationEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
|
||||
|
||||
if(data.hasExtra(intentNameActionParameter2))
|
||||
ruleToEdit.getActionSet().get(editIndex).setParameter2(data.getStringExtra(intentNameActionParameter2));
|
||||
|
||||
this.refreshActionList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeActionPlaySoundAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
@ -1472,6 +1840,78 @@ public class ActivityManageRule extends Activity
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeTriggerBroadcastReceivedAdd)
|
||||
{
|
||||
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 == requestCodeTriggerBroadcastReceivedEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
Trigger editedTrigger = new Trigger();
|
||||
editedTrigger.setTriggerType(Trigger_Enum.broadcastReceived);
|
||||
editedTrigger.setTriggerParameter(data.getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true));
|
||||
editedTrigger.setTriggerParameter2(data.getStringExtra(ActivityManageRule.intentNameTriggerParameter2));
|
||||
editedTrigger.setParentRule(ruleToEdit);
|
||||
ruleToEdit.getTriggerSet().set(editIndex, editedTrigger);
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeTriggerTetheringAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newTrigger.setTriggerParameter(data.getBooleanExtra(intentNameTriggerParameter1, true));
|
||||
newTrigger.setTriggerParameter2(data.getStringExtra(intentNameTriggerParameter2));
|
||||
newTrigger.setParentRule(ruleToEdit);
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeTriggerSubSystemStateAdd)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
newTrigger.setTriggerParameter(data.getBooleanExtra(intentNameTriggerParameter1, true));
|
||||
newTrigger.setTriggerParameter2(data.getStringExtra(intentNameTriggerParameter2));
|
||||
newTrigger.setParentRule(ruleToEdit);
|
||||
ruleToEdit.getTriggerSet().add(newTrigger);
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeTriggerTetheringEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
Trigger editedTrigger = new Trigger();
|
||||
editedTrigger.setTriggerType(Trigger_Enum.tethering);
|
||||
editedTrigger.setTriggerParameter(data.getBooleanExtra(intentNameTriggerParameter1, true));
|
||||
editedTrigger.setTriggerParameter2(data.getStringExtra(intentNameTriggerParameter2));
|
||||
editedTrigger.setParentRule(ruleToEdit);
|
||||
ruleToEdit.getTriggerSet().set(editIndex, editedTrigger);
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
}
|
||||
else if(requestCode == requestCodeTriggerSubSystemStateEdit)
|
||||
{
|
||||
if(resultCode == RESULT_OK)
|
||||
{
|
||||
Trigger editedTrigger = new Trigger();
|
||||
editedTrigger.setTriggerType(Trigger_Enum.subSystemState);
|
||||
editedTrigger.setTriggerParameter(data.getBooleanExtra(intentNameTriggerParameter1, true));
|
||||
editedTrigger.setTriggerParameter2(data.getStringExtra(intentNameTriggerParameter2));
|
||||
editedTrigger.setParentRule(ruleToEdit);
|
||||
ruleToEdit.getTriggerSet().set(editIndex, editedTrigger);
|
||||
this.refreshTriggerList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected AlertDialog getActionTypeDialog()
|
||||
@ -1513,12 +1953,24 @@ public class ActivityManageRule extends Activity
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.talking));
|
||||
else if(types[i].toString().equals(Action_Enum.playMusic.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.tune));
|
||||
else if(types[i].toString().equals(Action_Enum.controlMediaPlayback.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.tune));
|
||||
else if(types[i].toString().equals(Action_Enum.setScreenBrightness.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.brightness));
|
||||
else if(types[i].toString().equals(Action_Enum.playSound.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.sound));
|
||||
else if(types[i].toString().equals(Action_Enum.vibrate.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.vibrate));
|
||||
else if(types[i].toString().equals(Action_Enum.createNotification.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.notification));
|
||||
else if(types[i].toString().equals(Action_Enum.closeNotification.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.notification));
|
||||
else if(types[i].toString().equals(Action_Enum.sendBroadcast.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.megaphone));
|
||||
else if(types[i].toString().equals(Action_Enum.wakelock.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.coffee));
|
||||
else if(types[i].toString().equals(Action_Enum.runExecutable.toString()))
|
||||
items.add(new Item(typesLong[i].toString(), R.drawable.script));
|
||||
else if(types[i].toString().equals(Action_Enum.sendTextMessage.toString()))
|
||||
{
|
||||
// if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageSpecificRule.this, "android.permission.SEND_SMS") && !Miscellaneous.isGooglePlayInstalled(ActivityManageSpecificRule.this))
|
||||
@ -1568,10 +2020,8 @@ public class ActivityManageRule extends Activity
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setWifi.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.setWifi);
|
||||
getActionParameter1Dialog(ActivityManageRule.this).show();
|
||||
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||
Miscellaneous.messageBox(context.getResources().getString(R.string.app_name), context.getResources().getString(R.string.android10WifiToggleNotice), context).show();
|
||||
Intent editSetWifiIntent = new Intent(context, ActivityManageActionWifi.class);
|
||||
startActivityForResult(editSetWifiIntent, requestCodeActionSetWifiAdd);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setBluetooth.toString()))
|
||||
{
|
||||
@ -1681,6 +2131,42 @@ public class ActivityManageRule extends Activity
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionVibrate.class);
|
||||
startActivityForResult(intent, requestCodeActionVibrateAdd);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.sendBroadcast.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.sendBroadcast);
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionSendBroadcast.class);
|
||||
startActivityForResult(intent, requestCodeActionSendBroadcastAdd);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.runExecutable.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.runExecutable);
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionRunExecutable.class);
|
||||
startActivityForResult(intent, requestCodeActionRunExecutableAdd);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.wakelock.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.wakelock);
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionWakeLock.class);
|
||||
startActivityForResult(intent, requestCodeActionWakeLockAdd);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.controlMediaPlayback.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.controlMediaPlayback);
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionControlMedia.class);
|
||||
startActivityForResult(intent, requestCodeActionControlMediaAdd);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.createNotification.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.createNotification);
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionCreateNotification.class);
|
||||
startActivityForResult(intent, requestCodeActionCreateNotificationAdd);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.closeNotification.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.closeNotification);
|
||||
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionCloseNotification.class);
|
||||
startActivityForResult(intent, requestCodeActionCloseNotificationAdd);
|
||||
}
|
||||
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setScreenBrightness.toString()))
|
||||
{
|
||||
newAction.setAction(Action_Enum.setScreenBrightness);
|
||||
@ -1904,8 +2390,8 @@ public class ActivityManageRule extends Activity
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void refreshTriggerList()
|
||||
{
|
||||
Miscellaneous.logEvent("i", "ListView", "Attempting to update TriggerListView", 4);
|
||||
@ -1951,4 +2437,4 @@ public class ActivityManageRule extends Activity
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@ -12,6 +13,7 @@ import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.jens.automation2.receivers.BluetoothReceiver;
|
||||
@ -22,6 +24,7 @@ public class ActivityManageTriggerBluetooth extends Activity
|
||||
RadioButton radioAnyBluetoothDevice, radioNoDevice, radioDeviceFromList, radioBluetoothConnected, radioBluetoothDisconnected, radioBluetoothInRange, radioBluetoothOutRange;
|
||||
Button bSaveBluetoothTrigger;
|
||||
Spinner spinnerBluetoothDevices;
|
||||
TextView tvBluetoothNotPresentNotice;
|
||||
|
||||
ArrayAdapter<String> bluetoothDevicesSpinnerAdapter;
|
||||
|
||||
@ -40,9 +43,15 @@ public class ActivityManageTriggerBluetooth extends Activity
|
||||
radioBluetoothOutRange = (RadioButton)findViewById(R.id.radioBluetoothOutRange);
|
||||
bSaveBluetoothTrigger = (Button)findViewById(R.id.bSaveBluetoothTrigger);
|
||||
spinnerBluetoothDevices = (Spinner)findViewById(R.id.spinnerBluetoothDevices);
|
||||
tvBluetoothNotPresentNotice = (TextView)findViewById(R.id.tvBluetoothNotPresentNotice);
|
||||
|
||||
bluetoothDevicesSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, BluetoothReceiver.getAllPairedBluetoothDevicesStrings());
|
||||
|
||||
|
||||
if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH))
|
||||
tvBluetoothNotPresentNotice.setVisibility(View.VISIBLE);
|
||||
else
|
||||
tvBluetoothNotPresentNotice.setVisibility(View.GONE);
|
||||
|
||||
radioDeviceFromList.setOnCheckedChangeListener(new OnCheckedChangeListener()
|
||||
{
|
||||
@Override
|
||||
|
@ -0,0 +1,421 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class ActivityManageTriggerBroadcast extends Activity
|
||||
{
|
||||
RadioButton rbBroadcastReceived, rbBroadcastNotReceived;
|
||||
EditText etBroadcastTriggerAction;
|
||||
Button bBroadcastShowSuggestions, bSaveTriggerBroadcast;
|
||||
TextView tvBroadcastUrl;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_trigger_broadcasts);
|
||||
|
||||
bBroadcastShowSuggestions = findViewById(R.id.bBroadcastShowSuggestions);
|
||||
bSaveTriggerBroadcast = findViewById(R.id.bSaveTriggerBroadcast);
|
||||
etBroadcastTriggerAction = findViewById(R.id.etBroadcastTriggerAction);
|
||||
rbBroadcastReceived = findViewById(R.id.rbBroadcastReceived);
|
||||
rbBroadcastNotReceived = findViewById(R.id.rbBroadcastNotReceived);
|
||||
tvBroadcastUrl = findViewById(R.id.tvBroadcastUrl);
|
||||
|
||||
if(getIntent().hasExtra(ActivityManageRule.intentNameTriggerParameter1) && getIntent().hasExtra(ActivityManageRule.intentNameTriggerParameter2))
|
||||
{
|
||||
if(getIntent().getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true))
|
||||
rbBroadcastReceived.setChecked(true);
|
||||
else
|
||||
rbBroadcastNotReceived.setChecked(true);
|
||||
|
||||
etBroadcastTriggerAction.setText(getIntent().getStringExtra(ActivityManageRule.intentNameTriggerParameter2));
|
||||
}
|
||||
|
||||
tvBroadcastUrl.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getResources().getString(R.string.broadcastListUrl)));
|
||||
startActivity(browserIntent);
|
||||
}
|
||||
});
|
||||
|
||||
bBroadcastShowSuggestions.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(ActivityManageTriggerBroadcast.this);
|
||||
builder.setTitle(getResources().getString(R.string.selectBroadcast));
|
||||
builder.setItems(broadcastSuggestions, new DialogInterface.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int which)
|
||||
{
|
||||
etBroadcastTriggerAction.setText(broadcastSuggestions[which]);
|
||||
}
|
||||
});
|
||||
builder.create().show();
|
||||
}
|
||||
});
|
||||
|
||||
bSaveTriggerBroadcast.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
if(etBroadcastTriggerAction.getText() != null && !StringUtils.isEmpty(etBroadcastTriggerAction.getText().toString()))
|
||||
{
|
||||
Intent data = new Intent();
|
||||
data.putExtra(ActivityManageRule.intentNameTriggerParameter1, rbBroadcastReceived.isChecked());
|
||||
data.putExtra(ActivityManageRule.intentNameTriggerParameter2, etBroadcastTriggerAction.getText().toString());
|
||||
ActivityManageTriggerBroadcast.this.setResult(RESULT_OK, data);
|
||||
|
||||
finish();
|
||||
}
|
||||
else
|
||||
Toast.makeText(ActivityManageTriggerBroadcast.this, getResources().getString(R.string.enterText), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static String[] broadcastSuggestions = {
|
||||
"android.accounts.LOGIN_ACCOUNTS_CHANGED",
|
||||
"android.accounts.action.ACCOUNT_REMOVED",
|
||||
"android.app.action.ACTION_PASSWORD_CHANGED",
|
||||
"android.app.action.ACTION_PASSWORD_EXPIRING",
|
||||
"android.app.action.ACTION_PASSWORD_FAILED",
|
||||
"android.app.action.ACTION_PASSWORD_SUCCEEDED",
|
||||
"android.app.action.AFFILIATED_PROFILE_TRANSFER_OWNERSHIP_COMPLETE",
|
||||
"android.app.action.APPLICATION_DELEGATION_SCOPES_CHANGED",
|
||||
"android.app.action.APP_BLOCK_STATE_CHANGED",
|
||||
"android.app.action.AUTOMATIC_ZEN_RULE_STATUS_CHANGED",
|
||||
"android.app.action.BUGREPORT_FAILED",
|
||||
"android.app.action.BUGREPORT_SHARE",
|
||||
"android.app.action.BUGREPORT_SHARING_DECLINED",
|
||||
"android.app.action.DATA_SHARING_RESTRICTION_APPLIED",
|
||||
"android.app.action.DATA_SHARING_RESTRICTION_CHANGED",
|
||||
"android.app.action.DEVICE_ADMIN_DISABLED",
|
||||
"android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED",
|
||||
"android.app.action.DEVICE_ADMIN_ENABLED",
|
||||
"android.app.action.DEVICE_OWNER_CHANGED",
|
||||
"android.app.action.INTERRUPTION_FILTER_CHANGED",
|
||||
"android.app.action.INTERRUPTION_FILTER_CHANGED_INTERNAL",
|
||||
"android.app.action.LOCK_TASK_ENTERING",
|
||||
"android.app.action.LOCK_TASK_EXITING",
|
||||
"android.app.action.MANAGED_USER_CREATED",
|
||||
"android.app.action.NETWORK_LOGS_AVAILABLE",
|
||||
"android.app.action.NEXT_ALARM_CLOCK_CHANGED",
|
||||
"android.app.action.NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED",
|
||||
"android.app.action.NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED",
|
||||
"android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED",
|
||||
"android.app.action.NOTIFICATION_POLICY_CHANGED",
|
||||
"android.app.action.NOTIFY_PENDING_SYSTEM_UPDATE",
|
||||
"android.app.action.PROFILE_OWNER_CHANGED",
|
||||
"android.app.action.PROFILE_PROVISIONING_COMPLETE",
|
||||
"android.app.action.SECURITY_LOGS_AVAILABLE",
|
||||
"android.app.action.SYSTEM_UPDATE_POLICY_CHANGED",
|
||||
"android.app.action.TRANSFER_OWNERSHIP_COMPLETE",
|
||||
"android.app.action.USER_ADDED",
|
||||
"android.app.action.USER_REMOVED",
|
||||
"android.app.action.USER_STARTED",
|
||||
"android.app.action.USER_STOPPED",
|
||||
"android.app.action.USER_SWITCHED",
|
||||
"android.appwidget.action.APPWIDGET_DELETED",
|
||||
"android.appwidget.action.APPWIDGET_DISABLED",
|
||||
"android.appwidget.action.APPWIDGET_ENABLED",
|
||||
"android.appwidget.action.APPWIDGET_HOST_RESTORED",
|
||||
"android.appwidget.action.APPWIDGET_RESTORED",
|
||||
"android.appwidget.action.APPWIDGET_UPDATE",
|
||||
"android.appwidget.action.APPWIDGET_UPDATE_OPTIONS",
|
||||
"android.bluetooth.a2dp.profile.action.ACTIVE_DEVICE_CHANGED",
|
||||
"android.bluetooth.a2dp.profile.action.AVRCP_CONNECTION_STATE_CHANGED",
|
||||
"android.bluetooth.a2dp.profile.action.CODEC_CONFIG_CHANGED",
|
||||
"android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED",
|
||||
"android.bluetooth.a2dp.profile.action.PLAYING_STATE_CHANGED",
|
||||
"android.bluetooth.adapter.action.CONNECTION_STATE_CHANGED",
|
||||
"android.bluetooth.adapter.action.DISCOVERY_FINISHED",
|
||||
"android.bluetooth.adapter.action.DISCOVERY_STARTED",
|
||||
"android.bluetooth.adapter.action.LOCAL_NAME_CHANGED",
|
||||
"android.bluetooth.adapter.action.SCAN_MODE_CHANGED",
|
||||
"android.bluetooth.adapter.action.STATE_CHANGED",
|
||||
"android.bluetooth.device.action.ACL_CONNECTED",
|
||||
"android.bluetooth.device.action.ACL_DISCONNECTED",
|
||||
"android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED",
|
||||
"android.bluetooth.device.action.ALIAS_CHANGED",
|
||||
"android.bluetooth.device.action.BATTERY_LEVEL_CHANGED",
|
||||
"android.bluetooth.device.action.BOND_STATE_CHANGED",
|
||||
"android.bluetooth.device.action.CLASS_CHANGED",
|
||||
"android.bluetooth.device.action.CONNECTION_ACCESS_CANCEL",
|
||||
"android.bluetooth.device.action.CONNECTION_ACCESS_REPLY",
|
||||
"android.bluetooth.device.action.CONNECTION_ACCESS_REQUEST",
|
||||
"android.bluetooth.device.action.FOUND",
|
||||
"android.bluetooth.device.action.MAS_INSTANCE",
|
||||
"android.bluetooth.device.action.NAME_CHANGED",
|
||||
"android.bluetooth.device.action.NAME_FAILED",
|
||||
"android.bluetooth.device.action.PAIRING_CANCEL",
|
||||
"android.bluetooth.device.action.PAIRING_REQUEST",
|
||||
"android.bluetooth.device.action.SDP_RECORD",
|
||||
"android.bluetooth.device.action.SILENCE_MODE_CHANGED",
|
||||
"android.bluetooth.device.action.UUID",
|
||||
"android.bluetooth.devicepicker.action.DEVICE_SELECTED",
|
||||
"android.bluetooth.devicepicker.action.LAUNCH",
|
||||
"android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT",
|
||||
"android.bluetooth.headset.profile.action.ACTIVE_DEVICE_CHANGED",
|
||||
"android.bluetooth.headset.profile.action.AUDIO_STATE_CHANGED",
|
||||
"android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED",
|
||||
"android.bluetooth.hearingaid.profile.action.ACTIVE_DEVICE_CHANGED",
|
||||
"android.bluetooth.hearingaid.profile.action.CONNECTION_STATE_CHANGED",
|
||||
"android.bluetooth.hiddevice.profile.action.CONNECTION_STATE_CHANGED",
|
||||
"android.bluetooth.input.profile.action.CONNECTION_STATE_CHANGED",
|
||||
"android.bluetooth.input.profile.action.HANDSHAKE",
|
||||
"android.bluetooth.input.profile.action.IDLE_TIME_CHANGED",
|
||||
"android.bluetooth.input.profile.action.PROTOCOL_MODE_CHANGED",
|
||||
"android.bluetooth.input.profile.action.REPORT",
|
||||
"android.bluetooth.input.profile.action.VIRTUAL_UNPLUG_STATUS",
|
||||
"android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED",
|
||||
"android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED",
|
||||
"android.content.pm.action.SESSION_COMMITTED",
|
||||
"android.content.pm.action.SESSION_UPDATED",
|
||||
"android.hardware.action.NEW_PICTURE",
|
||||
"android.hardware.action.NEW_VIDEO",
|
||||
"android.hardware.hdmi.action.OSD_MESSAGE",
|
||||
"android.hardware.input.action.QUERY_KEYBOARD_LAYOUTS",
|
||||
"android.hardware.usb.action.USB_ACCESSORY_ATTACHED",
|
||||
"android.hardware.usb.action.USB_ACCESSORY_DETACHED",
|
||||
"android.hardware.usb.action.USB_DEVICE_ATTACHED",
|
||||
"android.hardware.usb.action.USB_DEVICE_DETACHED",
|
||||
"android.intent.action.ACTION_IDLE_MAINTENANCE_END",
|
||||
"android.intent.action.ACTION_IDLE_MAINTENANCE_START",
|
||||
"android.intent.action.ACTION_POWER_CONNECTED",
|
||||
"android.intent.action.ACTION_POWER_DISCONNECTED",
|
||||
"android.intent.action.ACTION_PREFERRED_ACTIVITY_CHANGED",
|
||||
"android.intent.action.ACTION_SHUTDOWN",
|
||||
"android.intent.action.AIRPLANE_MODE",
|
||||
"android.intent.action.ALARM_CHANGED",
|
||||
"android.intent.action.APPLICATION_RESTRICTIONS_CHANGED",
|
||||
"android.intent.action.BATTERY_CHANGED",
|
||||
"android.intent.action.BATTERY_LOW",
|
||||
"android.intent.action.BATTERY_OKAY",
|
||||
"android.intent.action.BOOT_COMPLETED",
|
||||
"android.intent.action.CALL_DISCONNECT_CAUSE",
|
||||
"android.intent.action.CAMERA_BUTTON",
|
||||
"android.intent.action.CANCEL_ENABLE_ROLLBACK",
|
||||
"android.intent.action.CLEAR_DNS_CACHE",
|
||||
"android.intent.action.CLOSE_SYSTEM_DIALOGS",
|
||||
"android.intent.action.CONFIGURATION_CHANGED",
|
||||
"android.intent.action.CONTENT_CHANGED",
|
||||
"android.intent.action.DATA_SMS_RECEIVED",
|
||||
"android.intent.action.DATA_STALL_DETECTED",
|
||||
"android.intent.action.DATE_CHANGED",
|
||||
"android.intent.action.DEVICE_STORAGE_FULL",
|
||||
"android.intent.action.DEVICE_STORAGE_LOW",
|
||||
"android.intent.action.DEVICE_STORAGE_NOT_FULL",
|
||||
"android.intent.action.DEVICE_STORAGE_OK",
|
||||
"android.intent.action.DISTRACTING_PACKAGES_CHANGED",
|
||||
"android.intent.action.DOCK_EVENT",
|
||||
"android.intent.action.DOWNLOAD_COMPLETE",
|
||||
"android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED",
|
||||
"android.intent.action.DREAMING_STARTED",
|
||||
"android.intent.action.DREAMING_STOPPED",
|
||||
"android.intent.action.DROPBOX_ENTRY_ADDED",
|
||||
"android.intent.action.DYNAMIC_SENSOR_CHANGED",
|
||||
"android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED",
|
||||
"android.intent.action.EMERGENCY_CALL_STATE_CHANGED",
|
||||
"android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE",
|
||||
"android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE",
|
||||
"android.intent.action.FACTORY_RESET",
|
||||
"android.intent.action.FETCH_VOICEMAIL",
|
||||
"android.intent.action.GTALK_CONNECTED",
|
||||
"android.intent.action.GTALK_DISCONNECTED",
|
||||
"android.intent.action.HEADSET_PLUG",
|
||||
"android.intent.action.HEADSET_PLUG",
|
||||
"android.intent.action.INPUT_METHOD_CHANGED",
|
||||
"android.intent.action.INTENT_FILTER_NEEDS_VERIFICATION",
|
||||
"android.intent.action.LOCALE_CHANGED",
|
||||
"android.intent.action.LOCKED_BOOT_COMPLETED",
|
||||
"android.intent.action.MANAGE_PACKAGE_STORAGE",
|
||||
"android.intent.action.MASTER_CLEAR_NOTIFICATION",
|
||||
"android.intent.action.MEDIA_BAD_REMOVAL",
|
||||
"android.intent.action.MEDIA_BUTTON",
|
||||
"android.intent.action.MEDIA_CHECKING",
|
||||
"android.intent.action.MEDIA_EJECT",
|
||||
"android.intent.action.MEDIA_MOUNTED",
|
||||
"android.intent.action.MEDIA_NOFS",
|
||||
"android.intent.action.MEDIA_REMOVED",
|
||||
"android.intent.action.MEDIA_SCANNER_FINISHED",
|
||||
"android.intent.action.MEDIA_SCANNER_SCAN_FILE",
|
||||
"android.intent.action.MEDIA_SCANNER_STARTED",
|
||||
"android.intent.action.MEDIA_SHARED",
|
||||
"android.intent.action.MEDIA_UNMOUNTABLE",
|
||||
"android.intent.action.MEDIA_UNMOUNTED",
|
||||
"android.intent.action.MY_PACKAGE_REPLACED",
|
||||
"android.intent.action.MY_PACKAGE_SUSPENDED",
|
||||
"android.intent.action.MY_PACKAGE_UNSUSPENDED",
|
||||
"android.intent.action.NEW_OUTGOING_CALL",
|
||||
"android.intent.action.NEW_VOICEMAIL",
|
||||
"android.intent.action.PACKAGES_SUSPENDED",
|
||||
"android.intent.action.PACKAGES_UNSUSPENDED",
|
||||
"android.intent.action.PACKAGE_ADDED",
|
||||
"android.intent.action.PACKAGE_CHANGED",
|
||||
"android.intent.action.PACKAGE_DATA_CLEARED",
|
||||
"android.intent.action.PACKAGE_ENABLE_ROLLBACK",
|
||||
"android.intent.action.PACKAGE_FIRST_LAUNCH",
|
||||
"android.intent.action.PACKAGE_FULLY_REMOVED",
|
||||
"android.intent.action.PACKAGE_INSTALL",
|
||||
"android.intent.action.PACKAGE_NEEDS_INTEGRITY_VERIFICATION",
|
||||
"android.intent.action.PACKAGE_NEEDS_VERIFICATION",
|
||||
"android.intent.action.PACKAGE_REMOVED",
|
||||
"android.intent.action.PACKAGE_REPLACED",
|
||||
"android.intent.action.PACKAGE_RESTARTED",
|
||||
"android.intent.action.PACKAGE_UNSUSPENDED_MANUALLY",
|
||||
"android.intent.action.PACKAGE_VERIFIED",
|
||||
"android.intent.action.PHONE_STATE",
|
||||
"android.intent.action.PROVIDER_CHANGED",
|
||||
"android.intent.action.PROXY_CHANGE",
|
||||
"android.intent.action.QUERY_PACKAGE_RESTART",
|
||||
"android.intent.action.REBOOT",
|
||||
"android.intent.action.ROLLBACK_COMMITTED",
|
||||
"android.intent.action.SCREEN_OFF",
|
||||
"android.intent.action.SCREEN_ON",
|
||||
"android.intent.action.SERVICE_STATE",
|
||||
"android.intent.action.SIM_STATE_CHANGED",
|
||||
"android.intent.action.SPLIT_CONFIGURATION_CHANGED",
|
||||
"android.intent.action.SUB_DEFAULT_CHANGED",
|
||||
"android.intent.action.TIMEZONE_CHANGED",
|
||||
"android.intent.action.TIME_SET",
|
||||
"android.intent.action.TIME_TICK",
|
||||
"android.intent.action.UID_REMOVED",
|
||||
"android.intent.action.UMS_CONNECTED",
|
||||
"android.intent.action.UMS_DISCONNECTED",
|
||||
"android.intent.action.USER_PRESENT",
|
||||
"android.intent.action.USER_UNLOCKED",
|
||||
"android.intent.action.WALLPAPER_CHANGED",
|
||||
"android.media.ACTION_SCO_AUDIO_STATE_UPDATED",
|
||||
"android.media.AUDIO_BECOMING_NOISY",
|
||||
"android.media.INTERNAL_RINGER_MODE_CHANGED_ACTION",
|
||||
"android.media.MASTER_MUTE_CHANGED_ACTION",
|
||||
"android.media.RINGER_MODE_CHANGED",
|
||||
"android.media.SCO_AUDIO_STATE_CHANGED",
|
||||
"android.media.STREAM_DEVICES_CHANGED_ACTION",
|
||||
"android.media.STREAM_MUTE_CHANGED_ACTION",
|
||||
"android.media.VIBRATE_SETTING_CHANGED",
|
||||
"android.media.VOLUME_CHANGED_ACTION",
|
||||
"android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION",
|
||||
"android.media.action.HDMI_AUDIO_PLUG",
|
||||
"android.media.action.MICROPHONE_MUTE_CHANGED",
|
||||
"android.media.action.OPEN_AUDIO_EFFECT_CONTROL_SESSION",
|
||||
"android.media.action.SPEAKERPHONE_STATE_CHANGED",
|
||||
"android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED",
|
||||
"android.media.tv.action.INITIALIZE_PROGRAMS",
|
||||
"android.media.tv.action.PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT",
|
||||
"android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED",
|
||||
"android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED",
|
||||
"android.net.conn.BACKGROUND_DATA_SETTING_CHANGED",
|
||||
"android.net.conn.CAPTIVE_PORTAL_TEST_COMPLETED",
|
||||
"android.net.conn.CONNECTIVITY_CHANGE",
|
||||
"android.net.conn.DATA_ACTIVITY_CHANGE",
|
||||
"android.net.conn.INET_CONDITION_ACTION",
|
||||
"android.net.conn.RESTRICT_BACKGROUND_CHANGED",
|
||||
"android.net.conn.TETHER_STATE_CHANGED",
|
||||
"android.net.nsd.STATE_CHANGED",
|
||||
"android.net.scoring.SCORER_CHANGED",
|
||||
"android.net.scoring.SCORE_NETWORKS",
|
||||
"android.net.sip.action.SIP_CALL_OPTION_CHANGED",
|
||||
"android.net.sip.action.SIP_INCOMING_CALL",
|
||||
"android.net.sip.action.SIP_REMOVE_PROFILE",
|
||||
"android.net.sip.action.SIP_SERVICE_UP",
|
||||
"android.net.sip.action.START_SIP",
|
||||
"android.net.wifi.BATCHED_RESULTS",
|
||||
"android.net.wifi.NETWORK_IDS_CHANGED",
|
||||
"android.net.wifi.RSSI_CHANGED",
|
||||
"android.net.wifi.SCAN_RESULTS",
|
||||
"android.net.wifi.STATE_CHANGE",
|
||||
"android.net.wifi.WIFI_STATE_CHANGED",
|
||||
"android.net.wifi.action.WIFI_NETWORK_SUGGESTION_POST_CONNECTION",
|
||||
"android.net.wifi.action.WIFI_SCAN_AVAILABILITY_CHANGED",
|
||||
"android.net.wifi.aware.action.WIFI_AWARE_STATE_CHANGED",
|
||||
"android.net.wifi.p2p.CONNECTION_STATE_CHANGE",
|
||||
"android.net.wifi.p2p.DISCOVERY_STATE_CHANGE",
|
||||
"android.net.wifi.p2p.PEERS_CHANGED",
|
||||
"android.net.wifi.p2p.STATE_CHANGED",
|
||||
"android.net.wifi.p2p.THIS_DEVICE_CHANGED",
|
||||
"android.net.wifi.rtt.action.WIFI_RTT_STATE_CHANGED",
|
||||
"android.net.wifi.supplicant.CONNECTION_CHANGE",
|
||||
"android.net.wifi.supplicant.STATE_CHANGE",
|
||||
"android.nfc.action.ADAPTER_STATE_CHANGED",
|
||||
"android.nfc.action.PREFERRED_PAYMENT_CHANGED",
|
||||
"android.nfc.action.TRANSACTION_DETECTED",
|
||||
"android.os.action.ACTION_EFFECTS_SUPPRESSOR_CHANGED",
|
||||
"android.os.action.DEVICE_IDLE_MODE_CHANGED",
|
||||
"android.os.action.LIGHT_DEVICE_IDLE_MODE_CHANGED",
|
||||
"android.os.action.POWER_SAVE_MODE_CHANGED",
|
||||
"android.os.action.POWER_SAVE_MODE_CHANGED_INTERNAL",
|
||||
"android.os.action.POWER_SAVE_MODE_CHANGING",
|
||||
"android.os.action.POWER_SAVE_TEMP_WHITELIST_CHANGED",
|
||||
"android.os.action.POWER_SAVE_WHITELIST_CHANGED",
|
||||
"android.os.action.UPDATE_EMERGENCY_NUMBER_DB",
|
||||
"android.provider.Telephony.MMS_DOWNLOADED",
|
||||
"android.provider.Telephony.SECRET_CODE",
|
||||
"android.provider.Telephony.SIM_FULL",
|
||||
"android.provider.Telephony.SMS_CARRIER_PROVISION",
|
||||
"android.provider.Telephony.SMS_CB_RECEIVED",
|
||||
"android.provider.Telephony.SMS_DELIVER",
|
||||
"android.provider.Telephony.SMS_RECEIVED",
|
||||
"android.provider.Telephony.SMS_REJECTED",
|
||||
"android.provider.Telephony.SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED",
|
||||
"android.provider.Telephony.WAP_PUSH_DELIVER",
|
||||
"android.provider.Telephony.WAP_PUSH_RECEIVED",
|
||||
"android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED",
|
||||
"android.provider.action.EXTERNAL_PROVIDER_CHANGE",
|
||||
"android.provider.action.SMS_EMERGENCY_CB_RECEIVED",
|
||||
"android.provider.action.SMS_MMS_DB_CREATED",
|
||||
"android.provider.action.SMS_MMS_DB_LOST",
|
||||
"android.provider.action.SYNC_VOICEMAIL",
|
||||
"android.security.STORAGE_CHANGED",
|
||||
"android.security.action.KEYCHAIN_CHANGED",
|
||||
"android.security.action.KEY_ACCESS_CHANGED",
|
||||
"android.security.action.TRUST_STORE_CHANGED",
|
||||
"android.service.controls.action.ADD_CONTROL",
|
||||
"android.settings.ENABLE_MMS_DATA_REQUEST",
|
||||
"android.speech.tts.TTS_QUEUE_PROCESSING_COMPLETED",
|
||||
"android.speech.tts.engine.TTS_DATA_INSTALLED",
|
||||
"android.telephony.action.AREA_INFO_UPDATED",
|
||||
"android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED",
|
||||
"android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED",
|
||||
"android.telephony.action.PRIMARY_SUBSCRIPTION_LIST_CHANGED",
|
||||
"android.telephony.action.REFRESH_SUBSCRIPTION_PLANS",
|
||||
"android.telephony.action.SECRET_CODE",
|
||||
"android.telephony.action.SERVICE_PROVIDERS_UPDATED",
|
||||
"android.telephony.action.SIM_APPLICATION_STATE_CHANGED",
|
||||
"android.telephony.action.SIM_CARD_STATE_CHANGED",
|
||||
"android.telephony.action.SIM_SLOT_STATUS_CHANGED",
|
||||
"android.telephony.action.SUBSCRIPTION_CARRIER_IDENTITY_CHANGED",
|
||||
"android.telephony.action.SUBSCRIPTION_PLANS_CHANGED",
|
||||
"android.telephony.action.SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED",
|
||||
"android.telephony.euicc.action.NOTIFY_CARRIER_SETUP_INCOMPLETE",
|
||||
"android.telephony.euicc.action.OTA_STATUS_CHANGED",
|
||||
"android.telephony.ims.action.WFC_IMS_REGISTRATION_ERROR",
|
||||
"com.android.intent.action.DISMISS_KEYBOARD_SHORTCUTS",
|
||||
"com.android.intent.action.SHOW_KEYBOARD_SHORTCUTS",
|
||||
"com.android.internal.intent.action.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION",
|
||||
"com.android.internal.provider.action.VOICEMAIL_SMS_RECEIVED"
|
||||
};
|
||||
}
|
@ -263,7 +263,7 @@ public class ActivityManageTriggerNotification extends Activity
|
||||
etNotificationTitle = (EditText)findViewById(R.id.etNotificationTitle);
|
||||
etNotificationText = (EditText)findViewById(R.id.etNotificationText);
|
||||
bSelectApp = (Button)findViewById(R.id.bSelectApp);
|
||||
bSaveTriggerNotification = (Button)findViewById(R.id.bSaveTriggerNotification);
|
||||
bSaveTriggerNotification = (Button)findViewById(R.id.bSaveActionCloseNotification);
|
||||
spinnerTitleDirection = (Spinner)findViewById(R.id.spinnerTitleDirection);
|
||||
spinnerTextDirection = (Spinner)findViewById(R.id.spinnerTextDirection);
|
||||
tvSelectedApplication = (TextView)findViewById(R.id.etActivityOrActionPath);
|
||||
@ -272,6 +272,7 @@ public class ActivityManageTriggerNotification extends Activity
|
||||
directions = new String[] {
|
||||
getResources().getString(R.string.directionStringEquals),
|
||||
getResources().getString(R.string.directionStringContains),
|
||||
getResources().getString(R.string.directionStringDoesNotContain),
|
||||
getResources().getString(R.string.directionStringStartsWith),
|
||||
getResources().getString(R.string.directionStringEndsWith),
|
||||
getResources().getString(R.string.directionStringNotEquals)
|
||||
@ -312,7 +313,7 @@ public class ActivityManageTriggerNotification extends Activity
|
||||
{
|
||||
String app;
|
||||
if(tvSelectedApplication.getText().toString().equalsIgnoreCase(getResources().getString(R.string.anyApp)))
|
||||
app = "-1";
|
||||
app = Trigger.anyAppString;
|
||||
else
|
||||
app = tvSelectedApplication.getText().toString();
|
||||
|
||||
@ -321,23 +322,14 @@ public class ActivityManageTriggerNotification extends Activity
|
||||
String textDir = Trigger.getMatchCode(spinnerTextDirection.getSelectedItem().toString());
|
||||
String text = etNotificationText.getText().toString();
|
||||
|
||||
if(edit)
|
||||
{
|
||||
editedNotificationTrigger.setTriggerParameter(chkNotificationDirection.isChecked());
|
||||
editedNotificationTrigger.setTriggerParameter2(app + triggerParameter2Split + titleDir + triggerParameter2Split + title + triggerParameter2Split + textDir + triggerParameter2Split + text);
|
||||
ActivityManageTriggerNotification.this.setResult(RESULT_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
Intent data = new Intent();
|
||||
data.putExtra(intentNameNotificationDirection, chkNotificationDirection.isChecked());
|
||||
data.putExtra(intentNameNotificationApp, app);
|
||||
data.putExtra(intentNameNotificationTitleDir, titleDir);
|
||||
data.putExtra(intentNameNotificationTitle, title);
|
||||
data.putExtra(intentNameNotificationTextDir, textDir);
|
||||
data.putExtra(intentNameNotificationText, text);
|
||||
ActivityManageTriggerNotification.this.setResult(RESULT_OK, data);
|
||||
}
|
||||
Intent data = new Intent();
|
||||
data.putExtra(intentNameNotificationDirection, chkNotificationDirection.isChecked());
|
||||
data.putExtra(intentNameNotificationApp, app);
|
||||
data.putExtra(intentNameNotificationTitleDir, titleDir);
|
||||
data.putExtra(intentNameNotificationTitle, title);
|
||||
data.putExtra(intentNameNotificationTextDir, textDir);
|
||||
data.putExtra(intentNameNotificationText, text);
|
||||
ActivityManageTriggerNotification.this.setResult(RESULT_OK, data);
|
||||
|
||||
finish();
|
||||
}
|
||||
@ -367,7 +359,7 @@ public class ActivityManageTriggerNotification extends Activity
|
||||
else
|
||||
text = "";
|
||||
|
||||
if(!app.equals("-1"))
|
||||
if(!app.equals(Trigger.anyAppString))
|
||||
tvSelectedApplication.setText(app);
|
||||
|
||||
for(int i = 0; i < directions.length; i++)
|
||||
|
@ -86,8 +86,8 @@ public class ActivityManageTriggerPhoneCall extends Activity
|
||||
else
|
||||
{
|
||||
Intent data = new Intent();
|
||||
data.putExtra("triggerParameter", false);
|
||||
data.putExtra("triggerParameter2", tp2Result);
|
||||
data.putExtra(ActivityManageRule.intentNameTriggerParameter1, false);
|
||||
data.putExtra(ActivityManageRule.intentNameTriggerParameter2, tp2Result);
|
||||
ActivityManageTriggerPhoneCall.this.setResult(RESULT_OK, data);
|
||||
}
|
||||
|
||||
|
@ -66,14 +66,21 @@ public class ActivityManageTriggerProfile extends Activity
|
||||
String profileName = values[0];
|
||||
|
||||
List<Profile> profileList = Profile.getProfileCollection();
|
||||
|
||||
boolean found = false;
|
||||
|
||||
for(int i = 0; i < profileList.size(); i++)
|
||||
{
|
||||
if(profileList.get(i).getName().equals(profileName))
|
||||
{
|
||||
spinnerProfiles.setSelection(i);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!found)
|
||||
Miscellaneous.messageBox(getResources().getString(R.string.info), getResources().getString(R.string.profileWasNotFound), ActivityManageTriggerProfile.this).show();
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
|
@ -0,0 +1,72 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.RadioButton;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.jens.automation2.Trigger.subSystemStates;
|
||||
|
||||
public class ActivityManageTriggerSubSystemState extends Activity
|
||||
{
|
||||
RadioButton rbSubSystemStateWifi, rbSubSystemStateBluetooth;
|
||||
RadioButton rbSubSystemStateEnabled, rbSubSystemStateDisabled;
|
||||
Button bSubSystemStateSave;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_trigger_subsystemstate);
|
||||
|
||||
rbSubSystemStateWifi = (RadioButton)findViewById(R.id.rbSubSystemStateWifi);
|
||||
rbSubSystemStateBluetooth = (RadioButton)findViewById(R.id.rbSubSystemStateBluetooth);
|
||||
rbSubSystemStateEnabled = (RadioButton)findViewById(R.id.rbSubSystemStateEnabled);
|
||||
rbSubSystemStateDisabled = (RadioButton)findViewById(R.id.rbSubSystemStateDisabled);
|
||||
bSubSystemStateSave = (Button)findViewById(R.id.bSubSystemStateSave);
|
||||
|
||||
if(getIntent().hasExtra(ActivityManageRule.intentNameTriggerParameter1) && getIntent().hasExtra(ActivityManageRule.intentNameTriggerParameter2))
|
||||
{
|
||||
subSystemStates desiredState = subSystemStates.valueOf(getIntent().getStringExtra(ActivityManageRule.intentNameTriggerParameter2));
|
||||
|
||||
switch(desiredState)
|
||||
{
|
||||
case wifi:
|
||||
rbSubSystemStateWifi.setChecked(true);
|
||||
break;
|
||||
case bluetooth:
|
||||
rbSubSystemStateBluetooth.setChecked(true);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
if(getIntent().getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true))
|
||||
rbSubSystemStateEnabled.setChecked(true);
|
||||
else
|
||||
rbSubSystemStateDisabled.setChecked(true);
|
||||
}
|
||||
|
||||
bSubSystemStateSave.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
Intent data = new Intent();
|
||||
|
||||
data.putExtra(ActivityManageRule.intentNameTriggerParameter1, rbSubSystemStateEnabled.isChecked());
|
||||
|
||||
if(rbSubSystemStateWifi.isChecked())
|
||||
data.putExtra(ActivityManageRule.intentNameTriggerParameter2, subSystemStates.wifi.name());
|
||||
else if(rbSubSystemStateBluetooth.isChecked())
|
||||
data.putExtra(ActivityManageRule.intentNameTriggerParameter2, subSystemStates.bluetooth.name());
|
||||
|
||||
ActivityManageTriggerSubSystemState.this.setResult(RESULT_OK, data);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.RadioButton;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class ActivityManageTriggerTethering extends Activity
|
||||
{
|
||||
RadioButton rbTetheringOn, rbTetheringOff, rbTetheringTypeAny, rbTetheringTypeWifi, rbTetheringTypeBluetooth, rbTetheringTypeUsb, rbTetheringTypeCable;
|
||||
Button bTriggerTetheringSave;
|
||||
|
||||
public final static String tetheringTypeAny = "tetheringTypeAny";
|
||||
public final static String tetheringTypeWifi = "tetheringTypeWifi";
|
||||
public final static String tetheringTypeBluetooth = "tetheringTypeBluetooth";
|
||||
public final static String tetheringTypeUsb = "tetheringTypeUsb";
|
||||
public final static String tetheringTypeCable = "tetheringTypeCable";
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_manage_trigger_tethering);
|
||||
|
||||
rbTetheringOn = (RadioButton) findViewById(R.id.rbTetheringOn);
|
||||
rbTetheringOff = (RadioButton)findViewById(R.id.rbTetheringOff);
|
||||
rbTetheringTypeAny = (RadioButton) findViewById(R.id.rbTetheringTypeAny);
|
||||
rbTetheringTypeWifi = (RadioButton) findViewById(R.id.rbTetheringTypeWifi);
|
||||
rbTetheringTypeBluetooth = (RadioButton) findViewById(R.id.rbTetheringTypeBluetooth);
|
||||
rbTetheringTypeUsb = (RadioButton) findViewById(R.id.rbTetheringTypeUsb);
|
||||
rbTetheringTypeCable = (RadioButton) findViewById(R.id.rbTetheringTypeCable);
|
||||
bTriggerTetheringSave = (Button) findViewById(R.id.bTriggerTetheringSave);
|
||||
|
||||
Intent input = getIntent();
|
||||
if(input.hasExtra(ActivityManageRule.intentNameTriggerParameter1))
|
||||
{
|
||||
rbTetheringOn.setChecked(input.getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true));
|
||||
rbTetheringOff.setChecked(!input.getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, false));
|
||||
}
|
||||
|
||||
if(input.hasExtra(ActivityManageRule.intentNameTriggerParameter2))
|
||||
{
|
||||
String type = input.getStringExtra(ActivityManageRule.intentNameTriggerParameter2);
|
||||
|
||||
if(!StringUtils.isEmpty(type))
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case tetheringTypeAny:
|
||||
rbTetheringTypeAny.setChecked(true);
|
||||
break;
|
||||
case tetheringTypeWifi:
|
||||
rbTetheringTypeWifi.setChecked(true);
|
||||
break;
|
||||
case tetheringTypeBluetooth:
|
||||
rbTetheringTypeBluetooth.setChecked(true);
|
||||
break;
|
||||
case tetheringTypeUsb:
|
||||
rbTetheringTypeUsb.setChecked(true);
|
||||
break;
|
||||
case tetheringTypeCable:
|
||||
rbTetheringTypeCable.setChecked(true);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
rbTetheringTypeAny.setChecked(true);
|
||||
|
||||
bTriggerTetheringSave.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
Intent response = new Intent();
|
||||
response.putExtra(ActivityManageRule.intentNameTriggerParameter1, rbTetheringOn.isChecked());
|
||||
|
||||
if(rbTetheringTypeAny.isChecked())
|
||||
response.putExtra(ActivityManageRule.intentNameTriggerParameter2, tetheringTypeAny);
|
||||
else if(rbTetheringTypeWifi.isChecked())
|
||||
response.putExtra(ActivityManageRule.intentNameTriggerParameter2, tetheringTypeWifi);
|
||||
else if(rbTetheringTypeBluetooth.isChecked())
|
||||
response.putExtra(ActivityManageRule.intentNameTriggerParameter2, tetheringTypeBluetooth);
|
||||
else if(rbTetheringTypeUsb.isChecked())
|
||||
response.putExtra(ActivityManageRule.intentNameTriggerParameter2, tetheringTypeUsb);
|
||||
else if(rbTetheringTypeCable.isChecked())
|
||||
response.putExtra(ActivityManageRule.intentNameTriggerParameter2, tetheringTypeCable);
|
||||
|
||||
setResult(RESULT_OK, response);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@ -9,13 +10,13 @@ import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TimePicker;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.sql.Time;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
|
||||
@ -26,8 +27,9 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
||||
CheckBox checkMonday, checkTuesday, checkWednesday, checkThursday, checkFriday, checkSaturday, checkSunday, chkRepeat;
|
||||
RadioButton radioTimeFrameEntering, radioTimeFrameLeaving;
|
||||
EditText etRepeatEvery;
|
||||
TextView tvDaysHint;
|
||||
|
||||
public static Trigger editedTimeFrameTrigger = null;
|
||||
static Trigger editedTimeFrameTrigger = null;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
@ -52,17 +54,18 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
||||
radioTimeFrameLeaving = (RadioButton)findViewById(R.id.radioTimeFrameLeaving);
|
||||
chkRepeat = (CheckBox)findViewById(R.id.chkRepeat);
|
||||
etRepeatEvery = (EditText)findViewById(R.id.etRepeatEvery);
|
||||
tvDaysHint = (TextView)findViewById(R.id.tvDaysHint);
|
||||
|
||||
bSaveTimeFrame.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
Time startTime = new Time(0);
|
||||
TimeObject startTime = new TimeObject();
|
||||
startTime.setHours(startPicker.getCurrentHour());
|
||||
startTime.setMinutes(startPicker.getCurrentMinute());
|
||||
|
||||
Time stopTime = new Time(0);
|
||||
TimeObject stopTime = new TimeObject();
|
||||
stopTime.setHours(stopPicker.getCurrentHour());
|
||||
stopTime.setMinutes(stopPicker.getCurrentMinute());
|
||||
|
||||
@ -152,8 +155,13 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
||||
}
|
||||
|
||||
editedTimeFrameTrigger.setTriggerParameter(radioTimeFrameEntering.isChecked());
|
||||
|
||||
setResult(RESULT_OK);
|
||||
editedTimeFrameTrigger.setTriggerParameter2(editedTimeFrameTrigger.getTimeFrame().toTriggerParameter2String());
|
||||
|
||||
Intent response = new Intent();
|
||||
response.putExtra(ActivityManageRule.intentNameTriggerParameter1, editedTimeFrameTrigger.getTriggerParameter());
|
||||
response.putExtra(ActivityManageRule.intentNameTriggerParameter2, editedTimeFrameTrigger.getTriggerParameter2());
|
||||
|
||||
setResult(RESULT_OK, response);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
@ -166,9 +174,40 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
||||
etRepeatEvery.setEnabled(isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
if(editedTimeFrameTrigger.getTimeFrame() != null)
|
||||
|
||||
if(getIntent().hasExtra(ActivityManageRule.intentNameTriggerParameter2))
|
||||
{
|
||||
editedTimeFrameTrigger = new Trigger();
|
||||
editedTimeFrameTrigger.setTriggerParameter(getIntent().getBooleanExtra(ActivityManageRule.intentNameTriggerParameter1, true));
|
||||
editedTimeFrameTrigger.setTriggerParameter2(getIntent().getStringExtra(ActivityManageRule.intentNameTriggerParameter2));
|
||||
editedTimeFrameTrigger.setTimeFrame(new TimeFrame(editedTimeFrameTrigger.getTriggerParameter2()));
|
||||
loadVariableIntoGui();
|
||||
}
|
||||
|
||||
TimePicker.OnTimeChangedListener pickerListener = new TimePicker.OnTimeChangedListener()
|
||||
{
|
||||
@Override
|
||||
public void onTimeChanged(TimePicker timePicker, int i, int i1)
|
||||
{
|
||||
if(
|
||||
startPicker.getCurrentHour() > stopPicker.getCurrentHour()
|
||||
||
|
||||
(
|
||||
startPicker.getCurrentHour() == stopPicker.getCurrentHour()
|
||||
&&
|
||||
startPicker.getCurrentMinute() >= stopPicker.getCurrentMinute()
|
||||
)
|
||||
)
|
||||
tvDaysHint.setText(getResources().getString(R.string.timeFrameDaysHint));
|
||||
else
|
||||
tvDaysHint.setText("");
|
||||
}
|
||||
};
|
||||
startPicker.setOnTimeChangedListener(pickerListener);
|
||||
stopPicker.setOnTimeChangedListener(pickerListener);
|
||||
|
||||
// Perform check once
|
||||
pickerListener.onTimeChanged(null, 0, 0);
|
||||
}
|
||||
|
||||
private void loadVariableIntoGui()
|
||||
@ -219,5 +258,4 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
||||
etRepeatEvery.setText(String.valueOf(editedTimeFrameTrigger.getTimeFrame().getRepetition()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -20,15 +20,13 @@ import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
|
||||
import com.jens.automation2.receivers.BluetoothReceiver;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@ -41,10 +39,11 @@ public class ActivityManageTriggerWifi extends Activity
|
||||
RadioButton rbTriggerWifiConnected, rbTriggerWifiDisconnected;
|
||||
EditText etTriggerWifiName;
|
||||
Spinner spinnerWifiList;
|
||||
Button btriggerWifiSave, bLoadWifiList;
|
||||
Button bTriggerWifiSave, bLoadWifiList;
|
||||
List<String> wifiList = new ArrayList<>();
|
||||
ArrayAdapter<String> wifiSpinnerAdapter;
|
||||
private final static int requestCodeLocationPermission = 124;
|
||||
TextView tvWifiTriggerNameLocationNotice;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState)
|
||||
@ -56,13 +55,21 @@ public class ActivityManageTriggerWifi extends Activity
|
||||
rbTriggerWifiDisconnected = (RadioButton) findViewById(R.id.rbTriggerWifiDisconnected);
|
||||
etTriggerWifiName = (EditText) findViewById(R.id.etTriggerWifiName);
|
||||
spinnerWifiList = (Spinner) findViewById(R.id.spinnerWifiList);
|
||||
btriggerWifiSave = (Button) findViewById(R.id.btriggerWifiSave);
|
||||
bTriggerWifiSave = (Button) findViewById(R.id.bTriggerWifiSave);
|
||||
bLoadWifiList = (Button) findViewById(R.id.bLoadWifiList);
|
||||
tvWifiTriggerNameLocationNotice = (TextView)findViewById(R.id.tvWifiTriggerNameLocationNotice);
|
||||
|
||||
wifiSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, wifiList);
|
||||
spinnerWifiList.setAdapter(wifiSpinnerAdapter);
|
||||
spinnerWifiList.setEnabled(false); // bug in Android; this only works when done in code, not in xml
|
||||
|
||||
if(
|
||||
Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 29
|
||||
&&
|
||||
!ActivityPermissions.isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||
)
|
||||
tvWifiTriggerNameLocationNotice.setVisibility(View.VISIBLE);
|
||||
|
||||
if (getIntent().hasExtra("edit"))
|
||||
{
|
||||
boolean connected = getIntent().getBooleanExtra("wifiState", false);
|
||||
@ -74,7 +81,7 @@ public class ActivityManageTriggerWifi extends Activity
|
||||
etTriggerWifiName.setText(wifiName);
|
||||
}
|
||||
|
||||
btriggerWifiSave.setOnClickListener(new View.OnClickListener()
|
||||
bTriggerWifiSave.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
|
@ -224,7 +224,7 @@ public class ActivityPermissions extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
protected static void addToArrayListUnique(String value, ArrayList<String> list)
|
||||
public static void addToArrayListUnique(String value, List<String> list)
|
||||
{
|
||||
if (!list.contains(value))
|
||||
list.add(value);
|
||||
@ -250,7 +250,7 @@ public class ActivityPermissions extends Activity
|
||||
}
|
||||
else if(s.equalsIgnoreCase(Manifest.permission.ACTIVITY_RECOGNITION) || s.equalsIgnoreCase(permissionNameGoogleActivityDetection))
|
||||
{
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase("fdroidFlavor"))
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase(AutomationService.flavor_name_fdroid))
|
||||
if (!havePermission(s, context))
|
||||
return true;
|
||||
}
|
||||
@ -353,14 +353,21 @@ public class ActivityPermissions extends Activity
|
||||
if(!havePermission(Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, workingContext))
|
||||
addToArrayListUnique(Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, requiredPermissions);
|
||||
|
||||
for(Profile p : Profile.getProfileCollection())
|
||||
{
|
||||
if(p.changeIncomingCallsRingtone || p.changeNotificationRingtone)
|
||||
addToArrayListUnique(Manifest.permission.READ_EXTERNAL_STORAGE, requiredPermissions);
|
||||
}
|
||||
|
||||
if (!onlyGeneral)
|
||||
{
|
||||
for (Rule rule : Rule.getRuleCollection())
|
||||
{
|
||||
for (String singlePermission : getPermissionsForRule(rule))
|
||||
{
|
||||
if (!havePermission(singlePermission, workingContext))
|
||||
{
|
||||
if(
|
||||
if (
|
||||
|
||||
singlePermission.equalsIgnoreCase(Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||
||
|
||||
@ -372,14 +379,15 @@ public class ActivityPermissions extends Activity
|
||||
if (!Miscellaneous.googleToBlameForLocation(true))
|
||||
addToArrayListUnique(singlePermission, requiredPermissions);
|
||||
}
|
||||
else if(singlePermission.equalsIgnoreCase(Manifest.permission.ACTIVITY_RECOGNITION) || singlePermission.equalsIgnoreCase(permissionNameGoogleActivityDetection))
|
||||
else if (singlePermission.equalsIgnoreCase(Manifest.permission.ACTIVITY_RECOGNITION) || singlePermission.equalsIgnoreCase(permissionNameGoogleActivityDetection))
|
||||
{
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase("fdroidFlavor"))
|
||||
if (!BuildConfig.FLAVOR.equalsIgnoreCase(AutomationService.flavor_name_fdroid))
|
||||
addToArrayListUnique(singlePermission, requiredPermissions);
|
||||
}
|
||||
else
|
||||
addToArrayListUnique(singlePermission, requiredPermissions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -501,6 +509,12 @@ public class ActivityPermissions extends Activity
|
||||
case wifiConnection:
|
||||
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
|
||||
addToArrayListUnique(Manifest.permission.ACCESS_WIFI_STATE, requiredPermissions);
|
||||
if(
|
||||
Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 29
|
||||
&&
|
||||
isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||
)
|
||||
addToArrayListUnique(Manifest.permission.ACCESS_BACKGROUND_LOCATION, requiredPermissions);
|
||||
break;
|
||||
case notification:
|
||||
addToArrayListUnique(Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE, requiredPermissions);
|
||||
@ -518,6 +532,9 @@ public class ActivityPermissions extends Activity
|
||||
addToArrayListUnique(Manifest.permission.MODIFY_AUDIO_SETTINGS, requiredPermissions);
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
addToArrayListUnique(Manifest.permission.ACCESS_NOTIFICATION_POLICY, requiredPermissions);
|
||||
Profile targetProfile = Profile.getByName(action.getParameter2());
|
||||
if(targetProfile.changeIncomingCallsRingtone || targetProfile.changeNotificationRingtone)
|
||||
addToArrayListUnique(Manifest.permission.READ_EXTERNAL_STORAGE, requiredPermissions);
|
||||
break;
|
||||
case disableScreenRotation:
|
||||
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||
@ -527,9 +544,13 @@ public class ActivityPermissions extends Activity
|
||||
break;
|
||||
case playMusic:
|
||||
break;
|
||||
case controlMediaPlayback:
|
||||
// addToArrayListUnique(Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE, requiredPermissions);
|
||||
// addToArrayListUnique(Manifest.permission.MEDIA_CONTENT_CONTROL, requiredPermissions);
|
||||
break;
|
||||
case sendTextMessage:
|
||||
addToArrayListUnique(Manifest.permission.SEND_SMS, requiredPermissions);
|
||||
checkPermissionsInVariableUse(action.getParameter2(), requiredPermissions);
|
||||
getPermissionsForVariablesInUse(action.getParameter2(), requiredPermissions);
|
||||
break;
|
||||
case setAirplaneMode:
|
||||
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
|
||||
@ -588,7 +609,7 @@ public class ActivityPermissions extends Activity
|
||||
// addToArrayListUnique("android.permission.TETHER_PRIVILEGED", requiredPermissions);
|
||||
break;
|
||||
case speakText:
|
||||
checkPermissionsInVariableUse(action.getParameter2(), requiredPermissions);
|
||||
getPermissionsForVariablesInUse(action.getParameter2(), requiredPermissions);
|
||||
break;
|
||||
case startOtherActivity:
|
||||
if(
|
||||
@ -608,7 +629,7 @@ public class ActivityPermissions extends Activity
|
||||
break;
|
||||
case triggerUrl:
|
||||
addToArrayListUnique(Manifest.permission.INTERNET, requiredPermissions);
|
||||
checkPermissionsInVariableUse(action.getParameter2(), requiredPermissions);
|
||||
getPermissionsForVariablesInUse(action.getParameter2(), requiredPermissions);
|
||||
break;
|
||||
case turnBluetoothOff:
|
||||
addToArrayListUnique(Manifest.permission.BLUETOOTH_ADMIN, requiredPermissions);
|
||||
@ -649,6 +670,9 @@ public class ActivityPermissions extends Activity
|
||||
case playSound:
|
||||
addToArrayListUnique(Manifest.permission.READ_EXTERNAL_STORAGE, requiredPermissions);
|
||||
break;
|
||||
case closeNotification:
|
||||
addToArrayListUnique(Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE, requiredPermissions);
|
||||
break;
|
||||
case turnScreenOnOrOff:
|
||||
if(action.getParameter1())
|
||||
addToArrayListUnique(Manifest.permission.WAKE_LOCK, requiredPermissions);
|
||||
@ -852,6 +876,32 @@ public class ActivityPermissions extends Activity
|
||||
case Manifest.permission.READ_EXTERNAL_STORAGE:
|
||||
for(String ruleName : getRulesUsing(Action.Action_Enum.playSound))
|
||||
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||
|
||||
for(String ruleName : getRulesUsing(Action.Action_Enum.changeSoundProfile))
|
||||
{
|
||||
Rule tempRule = Rule.getByName(ruleName);
|
||||
if(tempRule != null)
|
||||
{
|
||||
for (Action a : tempRule.getActionSet())
|
||||
{
|
||||
if (a.getAction().equals(Action.Action_Enum.changeSoundProfile))
|
||||
{
|
||||
Profile p = Profile.getByName(a.getParameter2());
|
||||
if (p.changeIncomingCallsRingtone || p.changeNotificationRingtone)
|
||||
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(Profile p : Profile.getProfileCollection())
|
||||
{
|
||||
if(p.changeIncomingCallsRingtone || p.changeNotificationRingtone)
|
||||
{
|
||||
usingElements.add(String.format(getResources().getString(R.string.profileXrequiresThis), p.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case Manifest.permission.BIND_DEVICE_ADMIN:
|
||||
for(String ruleName : getRulesUsing(Action.Action_Enum.turnScreenOnOrOff))
|
||||
@ -860,6 +910,9 @@ public class ActivityPermissions extends Activity
|
||||
case Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS:
|
||||
usingElements.add(getResources().getString(R.string.recommendedForBetterReliability));
|
||||
break;
|
||||
case Manifest.permission.QUERY_ALL_PACKAGES:
|
||||
usingElements.add(getResources().getString(R.string.queryAllPackages));
|
||||
break;
|
||||
}
|
||||
|
||||
return usingElements;
|
||||
@ -1150,7 +1203,7 @@ public class ActivityPermissions extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
static ArrayList<String> checkPermissionsInVariableUse(String text, ArrayList<String> permsList)
|
||||
static ArrayList<String> getPermissionsForVariablesInUse(String text, ArrayList<String> permsList)
|
||||
{
|
||||
/*
|
||||
[uniqueid]
|
||||
|
@ -18,10 +18,10 @@ public class ActivitySettings extends PreferenceActivity
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(layout.activity_settings);
|
||||
|
||||
if(BuildConfig.FLAVOR.equals("apkFlavor"))
|
||||
if(BuildConfig.FLAVOR.equals(AutomationService.flavor_name_apk))
|
||||
{
|
||||
chkPrefUpdateCheck = (CheckBoxPreference) findPreference("automaticUpdateCheck");
|
||||
chkPrefUpdateCheck.setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -28,10 +28,12 @@ import androidx.core.app.NotificationManagerCompat;
|
||||
|
||||
import com.jens.automation2.Trigger.Trigger_Enum;
|
||||
import com.jens.automation2.location.LocationProvider;
|
||||
import com.jens.automation2.receivers.DateTimeListener;
|
||||
import com.jens.automation2.receivers.PackageReplacedReceiver;
|
||||
import com.jens.automation2.receivers.PhoneStatusListener;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public class AutomationService extends Service implements OnInitListener
|
||||
@ -41,8 +43,18 @@ public class AutomationService extends Service implements OnInitListener
|
||||
protected final static int notificationIdRestrictions = 1005;
|
||||
protected final static int notificationIdLocationRestriction = 1006;
|
||||
|
||||
final static String NOTIFICATION_CHANNEL_ID = "com.jens.automation2";
|
||||
final static String channelName = "Service notification";
|
||||
public static final String flavor_name_apk = "apkFlavor";
|
||||
public static final String flavor_name_fdroid = "fdroidFlavor";
|
||||
public static final String flavor_name_googleplay = "googlePlayFlavor";
|
||||
|
||||
final static String NOTIFICATION_CHANNEL_ID_SERVICE = "com.jens.automation2_service";
|
||||
final static String NOTIFICATION_CHANNEL_NAME_SERVICE = "Service notification";
|
||||
|
||||
final static String NOTIFICATION_CHANNEL_ID_FUNCTIONALITY = "com.jens.automation2_functionality";
|
||||
final static String NOTIFICATION_CHANNEL_NAME_FUNCTIONALITY = "Functionality information";
|
||||
|
||||
final static String NOTIFICATION_CHANNEL_ID_RULES = "com.jens.automation2_rules";
|
||||
final static String NOTIFICATION_CHANNEL_NAME_RULES = "Rule notifications";
|
||||
|
||||
protected static Notification myNotification;
|
||||
protected static NotificationCompat.Builder notificationBuilder = null;
|
||||
@ -51,6 +63,8 @@ public class AutomationService extends Service implements OnInitListener
|
||||
protected Calendar lockSoundChangesEnd = null;
|
||||
protected boolean isRunning;
|
||||
|
||||
protected static AutomationService centralInstance = null;
|
||||
|
||||
public void nullLockSoundChangesEnd()
|
||||
{
|
||||
lockSoundChangesEnd = null;
|
||||
@ -65,7 +79,6 @@ public class AutomationService extends Service implements OnInitListener
|
||||
lockSoundChangesEnd = Calendar.getInstance();
|
||||
|
||||
lockSoundChangesEnd.add(Calendar.MINUTE, Settings.lockSoundChangesInterval);
|
||||
// ActivityMainScreen.getActivityMainScreenInstance().updateMainScreen();
|
||||
}
|
||||
|
||||
public void checkLockSoundChangesTimeElapsed()
|
||||
@ -89,8 +102,6 @@ public class AutomationService extends Service implements OnInitListener
|
||||
return myLocationProvider;
|
||||
}
|
||||
|
||||
protected static AutomationService centralInstance = null;
|
||||
|
||||
public static AutomationService getInstance()
|
||||
{
|
||||
return centralInstance;
|
||||
@ -109,18 +120,6 @@ public class AutomationService extends Service implements OnInitListener
|
||||
|
||||
public boolean checkStartupRequirements(Context context, boolean startAtBoot)
|
||||
{
|
||||
// if (!ActivityPermissions.havePermission(ActivityPermissions.writeExternalStoragePermissionName, AutomationService.this))
|
||||
// {
|
||||
// /*
|
||||
// Don't have permission to access external storage. This is a show stopper as
|
||||
// the configuration file is stored on external storage.
|
||||
// */
|
||||
// Miscellaneous.logEvent("e", "Permission", "Don't have permission to access external storage. Will request it now.", 4);
|
||||
//// Toast.makeText(AutomationService.this, getResources().getString(R.string.appRequiresPermissiontoAccessExternalStorage), Toast.LENGTH_LONG).show();
|
||||
// ActivityPermissions.requestSpecificPermission(ActivityPermissions.writeExternalStoragePermissionName);
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if(Build.VERSION.SDK_INT >= 28)
|
||||
{
|
||||
if (!ActivityPermissions.havePermission(Manifest.permission.FOREGROUND_SERVICE, AutomationService.this))
|
||||
@ -135,10 +134,15 @@ public class AutomationService extends Service implements OnInitListener
|
||||
}
|
||||
}
|
||||
|
||||
if (PointOfInterest.getPointOfInterestCollection() == null | PointOfInterest.getPointOfInterestCollection().size() == 0
|
||||
|
|
||||
Rule.getRuleCollection() == null | Rule.getRuleCollection().size() == 0
|
||||
)
|
||||
if (
|
||||
PointOfInterest.getPointOfInterestCollection() == null
|
||||
||
|
||||
PointOfInterest.getPointOfInterestCollection().size() == 0
|
||||
||
|
||||
Rule.getRuleCollection() == null
|
||||
||
|
||||
Rule.getRuleCollection().size() == 0
|
||||
)
|
||||
{
|
||||
if (startAtBoot)
|
||||
{
|
||||
@ -173,7 +177,7 @@ public class AutomationService extends Service implements OnInitListener
|
||||
}
|
||||
|
||||
//if still no POIs...
|
||||
if (Rule.getRuleCollection() == null | Rule.getRuleCollection().size() == 0)
|
||||
if (Rule.getRuleCollection() == null || Rule.getRuleCollection().size() == 0)
|
||||
{
|
||||
Miscellaneous.logEvent("w", "AutomationService", context.getResources().getString(R.string.serviceWontStart), 1);
|
||||
Toast.makeText(context, context.getResources().getString(R.string.serviceWontStart), Toast.LENGTH_LONG).show();
|
||||
@ -194,18 +198,21 @@ public class AutomationService extends Service implements OnInitListener
|
||||
{
|
||||
Bundle b = intent.getExtras();
|
||||
startAtBoot = b.getBoolean("startAtBoot", false);
|
||||
|
||||
if(startAtBoot)
|
||||
Settings.deviceStartDone = false;
|
||||
}
|
||||
|
||||
if (checkStartupRequirements(this, startAtBoot))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Service", this.getResources().getString(R.string.logServiceStarting) + " VERSION_CODE: " + BuildConfig.VERSION_CODE + ", VERSION_NAME: " + BuildConfig.VERSION_NAME + ", flavor: " + BuildConfig.FLAVOR, 1);
|
||||
Miscellaneous.logEvent("i", "Service", ActivityMaintenance.getSystemInfo(), 1);
|
||||
Miscellaneous.logEvent("i", "Service", ActivityControlCenter.getSystemInfo(), 1);
|
||||
|
||||
startUpRoutine();
|
||||
|
||||
Intent myIntent = new Intent(this, ActivityMainTabLayout.class);
|
||||
myPendingIntent = PendingIntent.getActivity(this, 0, myIntent, 0);
|
||||
notificationBuilder = createDefaultNotificationBuilder();
|
||||
notificationBuilder = createServiceNotificationBuilder();
|
||||
|
||||
updateNotification();
|
||||
|
||||
@ -213,14 +220,18 @@ public class AutomationService extends Service implements OnInitListener
|
||||
ActivityMainScreen.updateMainScreen();
|
||||
|
||||
this.isRunning = true;
|
||||
|
||||
Miscellaneous.logEvent("i", "Service", this.getResources().getString(R.string.serviceStarted) + " VERSION_CODE: " + BuildConfig.VERSION_CODE + ", VERSION_NAME: " + BuildConfig.VERSION_NAME + ", flavor: " + BuildConfig.FLAVOR, 1);
|
||||
Toast.makeText(this, this.getResources().getString(R.string.serviceStarted), Toast.LENGTH_LONG).show();
|
||||
// ********** Test area **********
|
||||
// Miscellaneous.logEvent("i", "setNetworkType", "bin hier.", 3);
|
||||
// Actions.setData(true);
|
||||
// ********** Test area **********
|
||||
|
||||
return START_STICKY;
|
||||
/*
|
||||
On normal phones the app is supposed to automatically restart in case of any problems.
|
||||
In the emulator we want it to stop to be able to better pinpoint the root cause.
|
||||
*/
|
||||
if(Miscellaneous.isAndroidEmulator())
|
||||
return START_NOT_STICKY;
|
||||
else
|
||||
return START_STICKY;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -241,8 +252,6 @@ public class AutomationService extends Service implements OnInitListener
|
||||
reloadSettings, reloadPointsOfInterest, reloadRules, updateNotification
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
public void serviceInterface(serviceCommands command)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Bind", "Ahhhh, customers... How can I help you?", 5);
|
||||
@ -282,6 +291,8 @@ public class AutomationService extends Service implements OnInitListener
|
||||
myLocationProvider.applySettingsAndRules();
|
||||
|
||||
ReceiverCoordinator.applySettingsAndRules();
|
||||
|
||||
DateTimeListener.reloadAlarms();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -310,18 +321,29 @@ public class AutomationService extends Service implements OnInitListener
|
||||
|
||||
private void startUpRoutine()
|
||||
{
|
||||
Settings.serviceStartDone = false;
|
||||
|
||||
checkForTtsEngine();
|
||||
checkForPermissions();
|
||||
checkForRestrictedFeatures();
|
||||
checkForMissingBackgroundLocationPermission();
|
||||
|
||||
Actions.context = this;
|
||||
Actions.autoMationServerRef = this;
|
||||
Actions.automationServerRef = this;
|
||||
|
||||
startLocationProvider();
|
||||
ReceiverCoordinator.startAllReceivers();
|
||||
|
||||
PackageReplacedReceiver.setHasServiceBeenRunning(true, this);
|
||||
|
||||
for(Rule r : Rule.getRuleCollection())
|
||||
{
|
||||
if(r.getsGreenLight(AutomationService.this))
|
||||
r.activate(AutomationService.this, false);
|
||||
}
|
||||
|
||||
Settings.serviceStartDone = true;
|
||||
Settings.deviceStartDone = true;
|
||||
}
|
||||
|
||||
protected void startLocationProvider()
|
||||
@ -365,9 +387,9 @@ public class AutomationService extends Service implements OnInitListener
|
||||
Miscellaneous.logEvent("w", "Features disabled", "Features disabled because of rule " + rule, 5);
|
||||
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1)
|
||||
Miscellaneous.createDismissableNotificationWithDelay(1010, getResources().getString(R.string.featuresDisabled), ActivityPermissions.notificationIdPermissions, pi);
|
||||
Miscellaneous.createDismissibleNotificationWithDelay(1010, null, getResources().getString(R.string.featuresDisabled), ActivityPermissions.notificationIdPermissions, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
|
||||
else
|
||||
Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), ActivityPermissions.notificationIdPermissions, pi);
|
||||
Miscellaneous.createDismissibleNotification(null, getResources().getString(R.string.featuresDisabled), ActivityPermissions.notificationIdPermissions, false, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -389,9 +411,9 @@ public class AutomationService extends Service implements OnInitListener
|
||||
Miscellaneous.logEvent("w", "Features disabled", "Background location disabled because Google to blame.", 5);
|
||||
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1)
|
||||
Miscellaneous.createDismissableNotificationWithDelay(3300, getResources().getString(R.string.featuresDisabled), notificationIdRestrictions, pi);
|
||||
Miscellaneous.createDismissibleNotificationWithDelay(3300, null, getResources().getString(R.string.featuresDisabled), notificationIdRestrictions, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
|
||||
else
|
||||
Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), notificationIdRestrictions, pi);
|
||||
Miscellaneous.createDismissibleNotification(null, getResources().getString(R.string.featuresDisabled), notificationIdRestrictions, false, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -411,9 +433,9 @@ public class AutomationService extends Service implements OnInitListener
|
||||
Miscellaneous.logEvent("w", "Features disabled", "Background location disabled because Google to blame.", 5);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1)
|
||||
Miscellaneous.createDismissableNotificationWithDelay(2200, getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
|
||||
Miscellaneous.createDismissibleNotificationWithDelay(2200, null, getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
|
||||
else
|
||||
Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
|
||||
Miscellaneous.createDismissibleNotification(null, getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, false, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,6 +471,9 @@ public class AutomationService extends Service implements OnInitListener
|
||||
ttsEngine.shutdown();
|
||||
|
||||
PackageReplacedReceiver.setHasServiceBeenRunning(false, this);
|
||||
|
||||
centralInstance = null;
|
||||
Settings.serviceStartDone = false;
|
||||
}
|
||||
|
||||
protected static Builder createDefaultNotificationBuilderOld()
|
||||
@ -482,7 +507,7 @@ public class AutomationService extends Service implements OnInitListener
|
||||
return builder;
|
||||
}
|
||||
|
||||
protected static NotificationCompat.Builder createDefaultNotificationBuilder()
|
||||
protected static NotificationCompat.Builder createServiceNotificationBuilder()
|
||||
{
|
||||
NotificationManager mNotificationManager = (NotificationManager) AutomationService.getInstance().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
@ -490,14 +515,14 @@ public class AutomationService extends Service implements OnInitListener
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
{
|
||||
NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, NotificationManager.IMPORTANCE_LOW);
|
||||
// chan.setLightColor(Color.BLUE);
|
||||
chan.enableVibration(false);
|
||||
chan.setSound(null, null);
|
||||
chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||
mNotificationManager.createNotificationChannel(chan);
|
||||
NotificationChannel channel = Miscellaneous.getNotificationChannel(AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE);
|
||||
// channel.setLightColor(Color.BLUE);
|
||||
channel.enableVibration(false);
|
||||
channel.setSound(null, null);
|
||||
channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||
mNotificationManager.createNotificationChannel(channel);
|
||||
|
||||
builder = new NotificationCompat.Builder(AutomationService.getInstance(), NOTIFICATION_CHANNEL_ID);
|
||||
builder = new NotificationCompat.Builder(AutomationService.getInstance(), NOTIFICATION_CHANNEL_ID_SERVICE);
|
||||
}
|
||||
else
|
||||
builder = new NotificationCompat.Builder(AutomationService.getInstance());
|
||||
@ -542,11 +567,11 @@ public class AutomationService extends Service implements OnInitListener
|
||||
if(activePoi == null)
|
||||
{
|
||||
PointOfInterest closestPoi = PointOfInterest.getClosestPOI(instance.getLocationProvider().getCurrentLocation());
|
||||
bodyText = AutomationService.getInstance().getResources().getString(R.string.activePoi) + ": " + AutomationService.getInstance().getResources().getString(R.string.none) + "\n" + AutomationService.getInstance().getResources().getString(R.string.closestPoi) + ": " + closestPoi.getName() + lastRuleString;
|
||||
bodyText = AutomationService.getInstance().getResources().getString(R.string.activePoi) + " " + AutomationService.getInstance().getResources().getString(R.string.none) + "\n" + AutomationService.getInstance().getResources().getString(R.string.closestPoi) + ": " + closestPoi.getName() + lastRuleString;
|
||||
}
|
||||
else
|
||||
{
|
||||
bodyText = AutomationService.getInstance().getResources().getString(R.string.activePoi) + ": " + activePoi.getName() + lastRuleString;
|
||||
bodyText = AutomationService.getInstance().getResources().getString(R.string.activePoi) + " " + activePoi.getName() + lastRuleString;
|
||||
}
|
||||
}
|
||||
catch(NullPointerException e)
|
||||
@ -576,7 +601,7 @@ public class AutomationService extends Service implements OnInitListener
|
||||
String textToDisplay = bodyText + " " + lastRuleString;
|
||||
|
||||
if(notificationBuilder == null)
|
||||
notificationBuilder = createDefaultNotificationBuilder();
|
||||
notificationBuilder = createServiceNotificationBuilder();
|
||||
|
||||
notificationBuilder.setContentText(textToDisplay);
|
||||
notificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));
|
||||
|
@ -8,7 +8,7 @@ import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
@ -16,6 +16,8 @@ import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.database.Cursor;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.Uri;
|
||||
@ -23,6 +25,7 @@ import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.os.IBinder;
|
||||
import android.provider.DocumentsContract;
|
||||
import android.provider.MediaStore;
|
||||
import android.provider.Settings.Secure;
|
||||
import android.telephony.PhoneNumberUtils;
|
||||
@ -72,8 +75,10 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.security.DigestInputStream;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStore;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
@ -83,7 +88,10 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Scanner;
|
||||
import java.util.Set;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
@ -98,13 +106,10 @@ import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
|
||||
import static android.provider.CalendarContract.CalendarCache.URI;
|
||||
import static com.jens.automation2.AutomationService.NOTIFICATION_CHANNEL_ID;
|
||||
import static com.jens.automation2.AutomationService.channelName;
|
||||
|
||||
public class Miscellaneous extends Service
|
||||
{
|
||||
protected static String writeableFolderStringCache = null;
|
||||
@ -471,11 +476,16 @@ public class Miscellaneous extends Service
|
||||
switch(direction)
|
||||
{
|
||||
case Trigger.directionEquals:
|
||||
return haystack.equalsIgnoreCase(needle);
|
||||
if(Miscellaneous.isRegularExpression(needle))
|
||||
return haystack.matches(needle);
|
||||
else
|
||||
return haystack.equalsIgnoreCase(needle);
|
||||
case Trigger.directionNotEquals:
|
||||
return !haystack.equalsIgnoreCase(needle);
|
||||
case Trigger.directionContains:
|
||||
return haystack.toLowerCase().contains(needle.toLowerCase());
|
||||
case Trigger.directionNotContains:
|
||||
return !haystack.toLowerCase().contains(needle.toLowerCase());
|
||||
case Trigger.directionStartsWith:
|
||||
return haystack.toLowerCase().startsWith(needle.toLowerCase());
|
||||
case Trigger.directionEndsWith:
|
||||
@ -485,7 +495,7 @@ public class Miscellaneous extends Service
|
||||
}
|
||||
}
|
||||
|
||||
public static int compareTimes(Time time1, Time time2)
|
||||
public static int compareTimes(TimeObject time1, TimeObject time2)
|
||||
{
|
||||
// Miscellaneous.logEvent("i", "TimeCompare", "To compare: " + time1.toString() + " / " + time2.toString());
|
||||
|
||||
@ -631,27 +641,43 @@ public class Miscellaneous extends Service
|
||||
|
||||
if(source.contains("[notificationTitle]"))
|
||||
{
|
||||
String notificationTitle = NotificationListener.getLastNotification().getTitle();
|
||||
if(NotificationListener.getLastNotification() != null)
|
||||
{
|
||||
String notificationTitle = NotificationListener.getLastNotification().getTitle();
|
||||
|
||||
if(notificationTitle != null && notificationTitle.length() > 0)
|
||||
source = source.replace("[notificationTitle]", notificationTitle);
|
||||
if (notificationTitle != null && notificationTitle.length() > 0)
|
||||
source = source.replace("[notificationTitle]", notificationTitle);
|
||||
else
|
||||
{
|
||||
source = source.replace("[notificationTitle]", "notificationTitle unknown");
|
||||
Miscellaneous.logEvent("w", "Variable replacement", "notificationTitle was empty.", 3);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
source = source.replace("notificationTitle unknown", notificationTitle);
|
||||
Miscellaneous.logEvent("w", "Variable replacement", "notificationTitle was empty.", 3);
|
||||
source = source.replace("[notificationTitle]", "notificationTitle unknown");
|
||||
Miscellaneous.logEvent("w", "Variable replacement", "lastNotification was empty.", 3);
|
||||
}
|
||||
}
|
||||
|
||||
if(source.contains("[notificationText]"))
|
||||
{
|
||||
String notificationText = NotificationListener.getLastNotification().getText();
|
||||
if(NotificationListener.getLastNotification() != null)
|
||||
{
|
||||
String notificationText = NotificationListener.getLastNotification().getText();
|
||||
|
||||
if(notificationText != null && notificationText.length() > 0)
|
||||
source = source.replace("[notificationText]", notificationText);
|
||||
if (notificationText != null && notificationText.length() > 0)
|
||||
source = source.replace("[notificationText]", notificationText);
|
||||
else
|
||||
{
|
||||
source = source.replace("[notificationText]", "notificationText unknown");
|
||||
Miscellaneous.logEvent("w", "Variable replacement", "notificationText was empty.", 3);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
source = source.replace("notificationText unknown", notificationText);
|
||||
Miscellaneous.logEvent("w", "Variable replacement", "notificationText was empty.", 3);
|
||||
source = source.replace("[notificationText]", "notificationText unknown");
|
||||
Miscellaneous.logEvent("w", "Variable replacement", "lastNotification was empty.", 3);
|
||||
}
|
||||
}
|
||||
|
||||
@ -689,14 +715,6 @@ public class Miscellaneous extends Service
|
||||
}
|
||||
});
|
||||
|
||||
// alertDialog.setNegativeButton(context.getResources().getString(R.string.cancel), new DialogInterface.OnClickListener()
|
||||
// {
|
||||
// public void onClick(DialogInterface dialog, int whichButton)
|
||||
// {
|
||||
// // Canceled.
|
||||
// }
|
||||
// });
|
||||
|
||||
return alertDialog.create();
|
||||
}
|
||||
|
||||
@ -723,8 +741,8 @@ public class Miscellaneous extends Service
|
||||
*
|
||||
* @return <code>true</code> if the device is rooted, <code>false</code> otherwise.
|
||||
*/
|
||||
public static boolean isPhoneRooted()
|
||||
{
|
||||
public static boolean isPhoneRooted()
|
||||
{
|
||||
// if(true)
|
||||
// return true;
|
||||
|
||||
@ -732,30 +750,30 @@ public class Miscellaneous extends Service
|
||||
String buildTags = Build.TAGS;
|
||||
if (buildTags != null && buildTags.contains("test-keys"))
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// check if /system/app/Superuser.apk is present
|
||||
try
|
||||
{
|
||||
File file = new File("/system/app/Superuser.apk");
|
||||
if (file.exists())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e1)
|
||||
{
|
||||
try
|
||||
{
|
||||
File file = new File("/system/app/Superuser.apk");
|
||||
if (file.exists())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e1)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
// try executing commands
|
||||
return canExecuteCommand("/system/xbin/which su")
|
||||
return canExecuteCommand("/system/xbin/which su")
|
||||
||
|
||||
canExecuteCommand("/system/bin/which su")
|
||||
||
|
||||
canExecuteCommand("which su");
|
||||
}
|
||||
}
|
||||
|
||||
// executes a command on the system
|
||||
private static boolean canExecuteCommand(String command)
|
||||
@ -773,19 +791,35 @@ public class Miscellaneous extends Service
|
||||
|
||||
return executedSuccesfully;
|
||||
}
|
||||
public static boolean isNumericDecimal(String strNum)
|
||||
{
|
||||
if (strNum == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
try
|
||||
{
|
||||
double d = Double.parseDouble(strNum);
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isNumeric(String str)
|
||||
{
|
||||
return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal.
|
||||
}
|
||||
public static boolean isNumeric(String str)
|
||||
{
|
||||
return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal.
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the SSL certificate checking for new instances of {@link HttpsURLConnection} This has been created to
|
||||
* aid testing on a local box, not for use on production.
|
||||
*/
|
||||
private static void disableSSLCertificateChecking()
|
||||
{
|
||||
try
|
||||
private static void disableSSLCertificateChecking()
|
||||
{
|
||||
try
|
||||
{
|
||||
SSLSocketFactory ssf = null;
|
||||
|
||||
@ -877,7 +911,7 @@ public class Miscellaneous extends Service
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void createDismissableNotificationWithDelay(long delay, String textToDisplay, int notificationId, PendingIntent pendingIntent)
|
||||
public static void createDismissibleNotificationWithDelay(long delay, String title, String textToDisplay, int notificationId, String notificationChannelId, PendingIntent pendingIntent)
|
||||
{
|
||||
/*
|
||||
Now what's this about?
|
||||
@ -903,7 +937,7 @@ public class Miscellaneous extends Service
|
||||
catch(Exception e)
|
||||
{}
|
||||
|
||||
createDismissableNotification(textToDisplay, notificationId, pendingIntent);
|
||||
createDismissibleNotification(title, textToDisplay, notificationId, true, notificationChannelId, pendingIntent);
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -924,40 +958,88 @@ public class Miscellaneous extends Service
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void createDismissableNotification(String textToDisplay, int notificationId, PendingIntent pendingIntent)
|
||||
public static void createDismissibleNotification(String title, String textToDisplay, int notificationId, boolean vibrate, String notificationChannelId, PendingIntent pendingIntent)
|
||||
{
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
{
|
||||
createDismissableNotificationSdk26(textToDisplay, notificationId, pendingIntent);
|
||||
createDismissibleNotificationSdk26(title, textToDisplay, notificationId, vibrate, notificationChannelId, pendingIntent);
|
||||
return;
|
||||
}
|
||||
|
||||
NotificationManager mNotificationManager = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
NotificationCompat.Builder dismissableNotificationBuilder = createDismissableNotificationBuilder(pendingIntent);
|
||||
dismissableNotificationBuilder.setContentText(textToDisplay);
|
||||
dismissableNotificationBuilder.setContentIntent(pendingIntent);
|
||||
dismissableNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));
|
||||
dismissableNotificationBuilder.setAutoCancel(true);
|
||||
NotificationCompat.Builder dismissibleNotificationBuilder = createDismissibleNotificationBuilder(vibrate, notificationChannelId, pendingIntent);
|
||||
|
||||
Notification dismissableNotification = dismissableNotificationBuilder.build();
|
||||
if(title == null)
|
||||
dismissibleNotificationBuilder.setContentTitle(AutomationService.getInstance().getResources().getString(R.string.app_name));
|
||||
else
|
||||
dismissibleNotificationBuilder.setContentTitle(title);
|
||||
|
||||
mNotificationManager.notify(notificationId, dismissableNotification);
|
||||
dismissibleNotificationBuilder.setContentText(textToDisplay);
|
||||
dismissibleNotificationBuilder.setContentIntent(pendingIntent);
|
||||
dismissibleNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));
|
||||
dismissibleNotificationBuilder.setAutoCancel(true);
|
||||
|
||||
/*NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
|
||||
.setSmallIcon(R.drawable.ic_launcher) // notification icon
|
||||
.setContentTitle("Notification!") // title for notification
|
||||
.setContentText("Hello word") // message for notification
|
||||
.setAutoCancel(true); // clear notification after click
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
PendingIntent pi = PendingIntent.getActivity(this,0,intent,Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mBuilder.setContentIntent(pi);
|
||||
NotificationManager mNotificationManager =
|
||||
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
mNotificationManager.notify(0, dismissableNotification);*/
|
||||
if(notificationChannelId.equals(AutomationService.NOTIFICATION_CHANNEL_ID_RULES))
|
||||
dismissibleNotificationBuilder.setSmallIcon(R.drawable.info);
|
||||
|
||||
Notification dismissibleNotification = dismissibleNotificationBuilder.build();
|
||||
|
||||
mNotificationManager.notify(notificationId, dismissibleNotification);
|
||||
}
|
||||
|
||||
static void createDismissableNotificationSdk26(String textToDisplay, int notificationId, PendingIntent pendingIntent)
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
static NotificationChannel findExistingChannel(List<NotificationChannel> channels, String channelId)
|
||||
{
|
||||
for(NotificationChannel c : channels)
|
||||
{
|
||||
if(c.getId().equals(channelId))
|
||||
return c;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
static NotificationChannel getNotificationChannel(String channelId)
|
||||
{
|
||||
NotificationManager nm = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
List<NotificationChannel> channels = nm.getNotificationChannels();
|
||||
|
||||
if(!Settings.hasBeenDone(Settings.constNotificationChannelCleanupApk118) && BuildConfig.VERSION_CODE < 120)
|
||||
{
|
||||
// Perform a one-time cleanup of notification channels as they have been redesigned.
|
||||
|
||||
for(NotificationChannel c : channels)
|
||||
nm.deleteNotificationChannel(c.getId());
|
||||
|
||||
Settings.considerDone(Settings.constNotificationChannelCleanupApk118);
|
||||
Settings.writeSettings(Miscellaneous.getAnyContext());
|
||||
}
|
||||
|
||||
NotificationChannel channel = findExistingChannel(channels, channelId);
|
||||
|
||||
if(channel == null)
|
||||
{
|
||||
switch (channelId)
|
||||
{
|
||||
case AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE:
|
||||
channel = new NotificationChannel(AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, AutomationService.NOTIFICATION_CHANNEL_NAME_SERVICE, NotificationManager.IMPORTANCE_LOW);
|
||||
break;
|
||||
case AutomationService.NOTIFICATION_CHANNEL_ID_FUNCTIONALITY:
|
||||
channel = new NotificationChannel(AutomationService.NOTIFICATION_CHANNEL_ID_FUNCTIONALITY, AutomationService.NOTIFICATION_CHANNEL_NAME_FUNCTIONALITY, NotificationManager.IMPORTANCE_HIGH);
|
||||
break;
|
||||
case AutomationService.NOTIFICATION_CHANNEL_ID_RULES:
|
||||
channel = new NotificationChannel(AutomationService.NOTIFICATION_CHANNEL_ID_RULES, AutomationService.NOTIFICATION_CHANNEL_NAME_RULES, NotificationManager.IMPORTANCE_HIGH);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
||||
static void createDismissibleNotificationSdk26(String title, String textToDisplay, int notificationId, boolean vibrate, String notificationChannelId, PendingIntent pendingIntent)
|
||||
{
|
||||
NotificationManager mNotificationManager = (NotificationManager) AutomationService.getInstance().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
@ -965,29 +1047,44 @@ public class Miscellaneous extends Service
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
{
|
||||
NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, "Functionality warnings", NotificationManager.IMPORTANCE_HIGH);
|
||||
// chan.setLightColor(Color.BLUE);
|
||||
chan.enableVibration(false);
|
||||
// chan.setSound(null, null);
|
||||
chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||
mNotificationManager.createNotificationChannel(chan);
|
||||
NotificationChannel notificationChannel = getNotificationChannel(notificationChannelId);
|
||||
// notificationChannel.setLightColor(Color.BLUE);
|
||||
notificationChannel.enableVibration(vibrate);
|
||||
try
|
||||
{
|
||||
Uri notificationSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||
// Uri notificationSound = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE+ "://" +mContext.getPackageName()+"/"+R.raw.apple_ring));
|
||||
// Ringtone r = RingtoneManager.getRingtone(Miscellaneous.getAnyContext(), notification);
|
||||
AudioAttributes.Builder b = new AudioAttributes.Builder();
|
||||
b.setContentType(AudioAttributes.CONTENT_TYPE_UNKNOWN);
|
||||
notificationChannel.setSound(notificationSound, b.build());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Notification", Log.getStackTraceString(e), 2);
|
||||
}
|
||||
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||
mNotificationManager.createNotificationChannel(notificationChannel);
|
||||
|
||||
builder = new NotificationCompat.Builder(AutomationService.getInstance(), NOTIFICATION_CHANNEL_ID);
|
||||
builder = new NotificationCompat.Builder(AutomationService.getInstance(), notificationChannel.getId());
|
||||
}
|
||||
else
|
||||
builder = new NotificationCompat.Builder(AutomationService.getInstance());
|
||||
|
||||
// if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||
// builder.setCategory(Notification.CATEGORY_SERVICE);
|
||||
|
||||
builder.setWhen(System.currentTimeMillis());
|
||||
builder.setContentIntent(pendingIntent);
|
||||
|
||||
builder.setContentTitle(AutomationService.getInstance().getResources().getString(R.string.app_name));
|
||||
if(title == null)
|
||||
builder.setContentTitle(AutomationService.getInstance().getResources().getString(R.string.app_name));
|
||||
else
|
||||
builder.setContentTitle(title);
|
||||
|
||||
builder.setOnlyAlertOnce(true);
|
||||
|
||||
if(Settings.showIconWhenServiceIsRunning)
|
||||
if(Settings.showIconWhenServiceIsRunning && notificationChannelId.equals(AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE))
|
||||
builder.setSmallIcon(R.drawable.ic_launcher);
|
||||
else if(!notificationChannelId.equals(AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE))
|
||||
builder.setSmallIcon(R.drawable.info);
|
||||
|
||||
builder.setContentText(textToDisplay);
|
||||
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));
|
||||
@ -995,7 +1092,6 @@ public class Miscellaneous extends Service
|
||||
NotificationManager notificationManager = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
notificationManager.notify(1, builder.build());
|
||||
|
||||
|
||||
// Intent notifyIntent = new Intent(context, notification.class);
|
||||
// notifyIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
//
|
||||
@ -1017,7 +1113,7 @@ public class Miscellaneous extends Service
|
||||
// notificationManager.notify(1, notification);
|
||||
}
|
||||
|
||||
protected static NotificationCompat.Builder createDismissableNotificationBuilder(PendingIntent myPendingIntent)
|
||||
protected static NotificationCompat.Builder createDismissibleNotificationBuilder(boolean vibrate, String notificationChannelId, PendingIntent myPendingIntent)
|
||||
{
|
||||
NotificationManager mNotificationManager = (NotificationManager) AutomationService.getInstance().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
@ -1025,14 +1121,14 @@ public class Miscellaneous extends Service
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
{
|
||||
NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, NotificationManager.IMPORTANCE_HIGH);
|
||||
// chan.setLightColor(Color.BLUE);
|
||||
// chan.enableVibration(false);
|
||||
// chan.setSound(null, null);
|
||||
chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||
mNotificationManager.createNotificationChannel(chan);
|
||||
NotificationChannel notificationChannel = getNotificationChannel(notificationChannelId);
|
||||
// notificationChannel.setLightColor(Color.BLUE);
|
||||
notificationChannel.enableVibration(vibrate);
|
||||
// notificationChannel.setSound(null, null);
|
||||
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||
mNotificationManager.createNotificationChannel(notificationChannel);
|
||||
|
||||
builder = new NotificationCompat.Builder(AutomationService.getInstance(), NOTIFICATION_CHANNEL_ID);
|
||||
builder = new NotificationCompat.Builder(AutomationService.getInstance(), notificationChannelId);
|
||||
}
|
||||
else
|
||||
builder = new NotificationCompat.Builder(AutomationService.getInstance());
|
||||
@ -1110,7 +1206,8 @@ public class Miscellaneous extends Service
|
||||
|
||||
public static double round(double value, int places)
|
||||
{
|
||||
if (places < 0) throw new IllegalArgumentException();
|
||||
if (places < 0)
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
BigDecimal bd = new BigDecimal(Double.toString(value));
|
||||
bd = bd.setScale(places, RoundingMode.HALF_UP);
|
||||
@ -1122,7 +1219,7 @@ public class Miscellaneous extends Service
|
||||
Cursor cursor = null;
|
||||
try
|
||||
{
|
||||
String[] proj = { MediaStore.Images.Media.DATA };
|
||||
String[] proj = { MediaStore.Images.Media.DATA, MediaStore.Audio.Media.DATA };
|
||||
cursor = context.getContentResolver().query(contentUri, proj, null, null, null);
|
||||
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
cursor.moveToFirst();
|
||||
@ -1142,6 +1239,114 @@ public class Miscellaneous extends Service
|
||||
}
|
||||
}
|
||||
|
||||
public static String getRealPathFromURI2(final Context context, final Uri uri)
|
||||
{
|
||||
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
|
||||
|
||||
// DocumentProvider
|
||||
if (isKitKat && DocumentsContract.isDocumentUri(context, uri))
|
||||
{
|
||||
// ExternalStorageProvider
|
||||
if (isExternalStorageDocument(uri))
|
||||
{
|
||||
final String docId = DocumentsContract.getDocumentId(uri);
|
||||
final String[] split = docId.split(":");
|
||||
final String type = split[0];
|
||||
|
||||
if ("primary".equalsIgnoreCase(type))
|
||||
{
|
||||
return Environment.getExternalStorageDirectory() + "/" + split[1];
|
||||
}
|
||||
}
|
||||
// DownloadsProvider
|
||||
else if (isDownloadsDocument(uri))
|
||||
{
|
||||
|
||||
final String id = DocumentsContract.getDocumentId(uri);
|
||||
final Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
|
||||
|
||||
return getDataColumn(context, contentUri, null, null);
|
||||
}
|
||||
// MediaProvider
|
||||
else if (isMediaDocument(uri))
|
||||
{
|
||||
final String docId = DocumentsContract.getDocumentId(uri);
|
||||
final String[] split = docId.split(":");
|
||||
final String type = split[0];
|
||||
|
||||
Uri contentUri = null;
|
||||
if ("image".equals(type))
|
||||
{
|
||||
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
|
||||
}
|
||||
else if ("video".equals(type))
|
||||
{
|
||||
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
|
||||
}
|
||||
else if ("audio".equals(type))
|
||||
{
|
||||
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
|
||||
}
|
||||
|
||||
final String selection = "_id=?";
|
||||
final String[] selectionArgs = new String[] { split[1] };
|
||||
|
||||
return getDataColumn(context, contentUri, selection, selectionArgs);
|
||||
}
|
||||
}
|
||||
// MediaStore (and general)
|
||||
else if ("content".equalsIgnoreCase(uri.getScheme()))
|
||||
{
|
||||
return getDataColumn(context, uri, null, null);
|
||||
}
|
||||
// File
|
||||
else if ("file".equalsIgnoreCase(uri.getScheme()))
|
||||
{
|
||||
return uri.getPath();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs)
|
||||
{
|
||||
Cursor cursor = null;
|
||||
final String column = "_data";
|
||||
final String[] projection = { column };
|
||||
|
||||
try
|
||||
{
|
||||
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
|
||||
null);
|
||||
if (cursor != null && cursor.moveToFirst())
|
||||
{
|
||||
final int column_index = cursor.getColumnIndexOrThrow(column);
|
||||
return cursor.getString(column_index);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (cursor != null)
|
||||
cursor.close();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isExternalStorageDocument(Uri uri)
|
||||
{
|
||||
return "com.android.externalstorage.documents".equals(uri.getAuthority());
|
||||
}
|
||||
|
||||
public static boolean isDownloadsDocument(Uri uri)
|
||||
{
|
||||
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
|
||||
}
|
||||
|
||||
public static boolean isMediaDocument(Uri uri)
|
||||
{
|
||||
return "com.android.providers.media.documents".equals(uri.getAuthority());
|
||||
}
|
||||
|
||||
public static Method getClassMethodReflective(String className, String methodName)
|
||||
{
|
||||
Class foundClass = null;
|
||||
@ -1434,7 +1639,7 @@ public class Miscellaneous extends Service
|
||||
{
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||
{
|
||||
if (BuildConfig.FLAVOR.equalsIgnoreCase("googlePlayFlavor"))
|
||||
if (BuildConfig.FLAVOR.equalsIgnoreCase(AutomationService.flavor_name_googleplay))
|
||||
{
|
||||
if(checkExistingRules)
|
||||
{
|
||||
@ -1567,13 +1772,12 @@ public class Miscellaneous extends Service
|
||||
|
||||
public static boolean comparePhoneNumbers(String number1, String number2)
|
||||
{
|
||||
/* To be activated when Android S SDK comes out
|
||||
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.Q)
|
||||
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.S)
|
||||
{
|
||||
TelephonyManager tm = (TelephonyManager)Miscellaneous.getAnyContext().getSystemService(Context.TELEPHONY_SERVICE);
|
||||
return PhoneNumberUtils.areSamePhoneNumber(number1, number2, tm.getNetworkCountryIso());
|
||||
}
|
||||
else*/
|
||||
else
|
||||
return PhoneNumberUtils.compare(number1, number2);
|
||||
}
|
||||
|
||||
@ -1593,4 +1797,123 @@ public class Miscellaneous extends Service
|
||||
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
public static boolean arraySearch(String[] haystack, String needle, boolean caseSensitive, boolean matchFullLine)
|
||||
{
|
||||
if(matchFullLine)
|
||||
{
|
||||
if(caseSensitive)
|
||||
{
|
||||
for (String s : haystack)
|
||||
{
|
||||
if (s.equals(needle))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (String s : haystack)
|
||||
{
|
||||
if (s.toLowerCase().equals(needle.toLowerCase()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(caseSensitive)
|
||||
{
|
||||
for (String s : haystack)
|
||||
{
|
||||
if (s.contains(needle))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (String s : haystack)
|
||||
{
|
||||
if (s.toLowerCase().contains(needle.toLowerCase()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean arraySearch(ArrayList<String> requestList, String needle, boolean caseSensitive, boolean matchFullLine)
|
||||
{
|
||||
return arraySearch(requestList.toArray(new String[requestList.size()]), needle, caseSensitive, matchFullLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ISO 3166-1 alpha-2 country code for this device (or null if not available)
|
||||
* @param context Context reference to get the TelephonyManager instance from
|
||||
* @return country code or null
|
||||
*/
|
||||
public static String getUserCountry(Context context)
|
||||
{
|
||||
try
|
||||
{
|
||||
final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
final String simCountry = tm.getSimCountryIso();
|
||||
if (simCountry != null && simCountry.length() == 2)
|
||||
{ // SIM country code is available
|
||||
return simCountry.toLowerCase(Locale.US);
|
||||
}
|
||||
else if (tm.getPhoneType() != TelephonyManager.PHONE_TYPE_CDMA)
|
||||
{ // device is not 3G (would be unreliable)
|
||||
String networkCountry = tm.getNetworkCountryIso();
|
||||
if (networkCountry != null && networkCountry.length() == 2)
|
||||
{ // network country code is available
|
||||
return networkCountry.toLowerCase(Locale.US);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (SecurityException se)
|
||||
{
|
||||
return "unknown";
|
||||
}
|
||||
catch (Exception e)
|
||||
{ }
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String checksumSha(String filepath) throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
MessageDigest md = null;
|
||||
md = MessageDigest.getInstance("SHA-256");
|
||||
|
||||
// file hashing with DigestInputStream
|
||||
try (DigestInputStream dis = new DigestInputStream(new FileInputStream(filepath), md))
|
||||
{
|
||||
while (dis.read() != -1)
|
||||
; //empty loop to clear the data
|
||||
md = dis.getMessageDigest();
|
||||
}
|
||||
|
||||
// bytes to hex
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (byte b : md.digest())
|
||||
{
|
||||
result.append(String.format("%02x", b));
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
catch (NoSuchAlgorithmException e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "shaChecksum", Log.getStackTraceString(e), 2);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getTargetSDK(Context context)
|
||||
{
|
||||
return context.getApplicationContext().getApplicationInfo().targetSdkVersion;
|
||||
}
|
||||
}
|
@ -306,29 +306,31 @@ public class Profile implements Comparable<Profile>
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(MediaStore.MediaColumns.DATA, ringtoneFile.getAbsolutePath());
|
||||
// values.put(MediaStore.MediaColumns.TITLE, context.getResources().getString(R.string.app_name) + " ringtone");
|
||||
// values.put(MediaStore.MediaColumns.TITLE, ringtoneFile.getName().replace(".mp3", "").replace(".", ""));
|
||||
values.put(MediaStore.MediaColumns.TITLE, ringtoneFile.getName());
|
||||
// values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/*");
|
||||
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/mp3");
|
||||
values.put(MediaStore.MediaColumns.SIZE, ringtoneFile.length());
|
||||
// values.put(MediaStore.Audio.Media.ARTIST, R.string.app_name);
|
||||
values.put(MediaStore.Audio.Media.IS_RINGTONE, ringtoneType == RingtoneManager.TYPE_RINGTONE);
|
||||
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, ringtoneType == RingtoneManager.TYPE_NOTIFICATION);
|
||||
values.put(MediaStore.Audio.Media.IS_ALARM, false);
|
||||
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
|
||||
|
||||
Uri existingRingTone = MediaStore.Audio.Media.getContentUriForPath(ringtoneFile.getAbsolutePath());
|
||||
if(existingRingTone != null)
|
||||
context.getContentResolver().delete(existingRingTone, MediaStore.MediaColumns.DATA + "=\"" + ringtoneFile.getAbsolutePath() + "\"", null);
|
||||
Uri newRingTone = context.getContentResolver().insert(existingRingTone, values);
|
||||
|
||||
try
|
||||
{
|
||||
Uri newRingTone = null;
|
||||
|
||||
//TODO: This part needs to be made compatible with Android 11 and above.
|
||||
if(Build.VERSION.SDK_INT > 30)
|
||||
{
|
||||
Uri existingRingTone = MediaStore.Audio.Media.getContentUriForPath(ringtoneFile.getAbsolutePath());
|
||||
|
||||
if (existingRingTone != null)
|
||||
context.getContentResolver().delete(existingRingTone, MediaStore.MediaColumns.DATA + "=\"" + ringtoneFile.getAbsolutePath() + "\"", null);
|
||||
|
||||
newRingTone = context.getContentResolver().insert(existingRingTone, values);
|
||||
}
|
||||
|
||||
RingtoneManager.setActualDefaultRingtoneUri(context, ringtoneType, newRingTone);
|
||||
Miscellaneous.logEvent("i", "Profile", "Ringtone set to: " + newRingTone.toString(), 1);
|
||||
// Ringtone tone = RingtoneManager.getRingtone(context, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE));
|
||||
// tone.play();
|
||||
return true;
|
||||
}
|
||||
catch (Throwable t)
|
||||
@ -454,29 +456,17 @@ public class Profile implements Comparable<Profile>
|
||||
|
||||
public boolean delete(Context context)
|
||||
{
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.profileActive))
|
||||
Rule usingRule = this.isInUseByRules();
|
||||
if(usingRule != null)
|
||||
{
|
||||
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;
|
||||
}
|
||||
Toast.makeText(context, String.format(context.getResources().getString(R.string.ruleXIsUsingProfileY), usingRule.getName(), this.getName()), Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
profileCollection.remove(this);
|
||||
return XmlFileInterface.writeFile();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean plausibilityCheck()
|
||||
@ -517,7 +507,7 @@ public class Profile implements Comparable<Profile>
|
||||
Actions.setSound(context, soundMode);
|
||||
|
||||
if(changeDndMode)
|
||||
Actions.setDND(context, dndMode);
|
||||
Actions.setDoNotDisturb(context, dndMode);
|
||||
|
||||
if(changeVolumeMusicVideoGameMedia)
|
||||
am.setStreamVolume(AudioManager.STREAM_MUSIC, volumeMusic, AudioManager.FLAG_PLAY_SOUND);
|
||||
@ -604,65 +594,107 @@ public class Profile implements Comparable<Profile>
|
||||
try
|
||||
{
|
||||
AudioManager am = (AudioManager) Miscellaneous.getAnyContext().getSystemService(Context.AUDIO_SERVICE);
|
||||
NotificationManager mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
if(changeSoundMode)
|
||||
if (changeSoundMode)
|
||||
{
|
||||
if(am.getRingerMode() != soundMode)
|
||||
if (am.getRingerMode() != soundMode)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(changeDndMode && Build.VERSION.SDK_INT >= 23)
|
||||
if (changeDndMode && Build.VERSION.SDK_INT >= 23)
|
||||
{
|
||||
if(mNotificationManager.getCurrentInterruptionFilter() != dndMode)
|
||||
if (mNotificationManager.getCurrentInterruptionFilter() != dndMode)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(changeVolumeMusicVideoGameMedia)
|
||||
if (changeVolumeMusicVideoGameMedia)
|
||||
{
|
||||
if(am.getStreamVolume(AudioManager.STREAM_MUSIC) != volumeMusic)
|
||||
if (am.getStreamVolume(AudioManager.STREAM_MUSIC) != volumeMusic)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(changeVolumeNotifications)
|
||||
if (changeVolumeNotifications)
|
||||
{
|
||||
if(am.getStreamVolume(AudioManager.STREAM_NOTIFICATION) != volumeNotifications)
|
||||
if (am.getStreamVolume(AudioManager.STREAM_NOTIFICATION) != volumeNotifications)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(changeVolumeAlarms)
|
||||
if (changeVolumeAlarms)
|
||||
{
|
||||
if(am.getStreamVolume(AudioManager.STREAM_ALARM) != volumeAlarms)
|
||||
if (am.getStreamVolume(AudioManager.STREAM_ALARM) != volumeAlarms)
|
||||
return false;
|
||||
}
|
||||
|
||||
// if(changeIncomingCallsRingtone)
|
||||
// {
|
||||
// if (incomingCallsRingtone != null)
|
||||
// {
|
||||
// applyRingTone(incomingCallsRingtone, RingtoneManager.TYPE_RINGTONE, context);
|
||||
// }
|
||||
// }
|
||||
|
||||
if(changeVibrateWhenRinging)
|
||||
/*if (changeIncomingCallsRingtone)
|
||||
{
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||
if (incomingCallsRingtone != null)
|
||||
{
|
||||
Uri ringtone_uri = RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE);
|
||||
|
||||
if (ringtone_uri != null)
|
||||
{
|
||||
// if ringtone_uri is null get Default Ringtone
|
||||
ringtone_uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
|
||||
|
||||
Ringtone currentRingtone = RingtoneManager.getRingtone(context, ringtone_uri);
|
||||
String title = currentRingtone.getTitle(context);
|
||||
*//* Ringtone desiredRingtone = RingtoneManager.getRingtone(context, Uri.fromFile(notificationRingtone));
|
||||
boolean result = currentRingtone.equals(desiredRingtone);*//*
|
||||
|
||||
Uri desired_ringtone = MediaStore.Audio.Media.getContentUriForPath(incomingCallsRingtone.getAbsolutePath());
|
||||
|
||||
// File currentRingtoneFile = new File(Miscellaneous.getRealPathFromURI(context, ringtone_uri));
|
||||
String currentChecksum = Miscellaneous.checksumSha(ringtone_uri.getPath());
|
||||
String desiredChecksum = Miscellaneous.checksumSha(incomingCallsRingtone.getAbsolutePath());
|
||||
|
||||
if (!currentChecksum.equals(desiredChecksum))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
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))
|
||||
if (currentSetting != Miscellaneous.boolToInt(vibrateWhenRinging))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int currentSetting = am.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER);
|
||||
if(currentSetting != Miscellaneous.boolToInt(vibrateWhenRinging))
|
||||
if (currentSetting != Miscellaneous.boolToInt(vibrateWhenRinging))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// if(changeNotificationRingtone)
|
||||
// if(notificationRingtone != null)
|
||||
// applyRingTone(notificationRingtone, RingtoneManager.TYPE_NOTIFICATION, context);
|
||||
/*if (changeNotificationRingtone)
|
||||
{
|
||||
if (notificationRingtone != null)
|
||||
{
|
||||
Uri ringtone_uri = RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_NOTIFICATION);
|
||||
|
||||
if (ringtone_uri == null)
|
||||
{
|
||||
// if ringtone_uri is null get Default Ringtone
|
||||
ringtone_uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
|
||||
|
||||
File currentRingtone = new File(Settings.System.DEFAULT_NOTIFICATION_URI.getPath());
|
||||
|
||||
// File currentRingtone = new File(Miscellaneous.getRealPathFromURI(context, ringtone_uri));
|
||||
|
||||
String currentChecksum = Miscellaneous.checksumSha(currentRingtone.getAbsolutePath());
|
||||
String desiredChecksum = Miscellaneous.checksumSha(notificationRingtone.getAbsolutePath());
|
||||
|
||||
if(!currentChecksum.equals(desiredChecksum))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
if(changeScreenLockUnlockSound)
|
||||
{
|
||||
@ -730,4 +762,11 @@ public class Profile implements Comparable<Profile>
|
||||
return this.oldName;
|
||||
}
|
||||
|
||||
public static Profile getLastActivatedProfile()
|
||||
{
|
||||
if(Profile.profileActivationHistory != null && Profile.profileActivationHistory.size() > 0)
|
||||
return Profile.profileActivationHistory.get(Profile.profileActivationHistory.size() - 1);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import android.util.Log;
|
||||
|
||||
import com.jens.automation2.location.CellLocationChangedReceiver;
|
||||
import com.jens.automation2.location.WifiBroadcastReceiver;
|
||||
import com.jens.automation2.receivers.BroadcastListener;
|
||||
import com.jens.automation2.receivers.DateTimeListener;
|
||||
import com.jens.automation2.receivers.AutomationListenerInterface;
|
||||
import com.jens.automation2.receivers.BatteryReceiver;
|
||||
@ -12,9 +13,13 @@ import com.jens.automation2.receivers.BluetoothReceiver;
|
||||
import com.jens.automation2.receivers.ConnectivityReceiver;
|
||||
import com.jens.automation2.receivers.DeviceOrientationListener;
|
||||
import com.jens.automation2.receivers.HeadphoneJackListener;
|
||||
import com.jens.automation2.receivers.MediaPlayerListener;
|
||||
import com.jens.automation2.receivers.NoiseListener;
|
||||
import com.jens.automation2.receivers.PhoneStatusListener;
|
||||
import com.jens.automation2.receivers.ProcessListener;
|
||||
import com.jens.automation2.receivers.ScreenStateReceiver;
|
||||
import com.jens.automation2.receivers.SubSystemStateReceiver;
|
||||
import com.jens.automation2.receivers.TetheringReceiver;
|
||||
import com.jens.automation2.receivers.TimeZoneListener;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
@ -51,9 +56,13 @@ public class ReceiverCoordinator
|
||||
HeadphoneJackListener.class,
|
||||
//NfcReceiver.class,
|
||||
NoiseListener.class,
|
||||
//NotificationListener.class,
|
||||
PhoneStatusListener.class,
|
||||
ProcessListener.class,
|
||||
TimeZoneListener.class
|
||||
MediaPlayerListener.class,
|
||||
ScreenStateReceiver.class,
|
||||
TimeZoneListener.class,
|
||||
TetheringReceiver.class
|
||||
};
|
||||
}
|
||||
catch (ClassNotFoundException e)
|
||||
@ -62,6 +71,7 @@ public class ReceiverCoordinator
|
||||
DateTimeListener.class,
|
||||
BatteryReceiver.class,
|
||||
BluetoothReceiver.class,
|
||||
BroadcastListener.class,
|
||||
ConnectivityReceiver.class,
|
||||
DeviceOrientationListener.class,
|
||||
HeadphoneJackListener.class,
|
||||
@ -69,7 +79,9 @@ public class ReceiverCoordinator
|
||||
NoiseListener.class,
|
||||
PhoneStatusListener.class,
|
||||
ProcessListener.class,
|
||||
TimeZoneListener.class
|
||||
ScreenStateReceiver.class,
|
||||
TimeZoneListener.class,
|
||||
TetheringReceiver.class
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -132,12 +144,6 @@ public class ReceiverCoordinator
|
||||
Miscellaneous.logEvent("w", "Error in new model", Log.getStackTraceString(e), 3);
|
||||
}
|
||||
|
||||
// if(Settings.useAccelerometerForPositioning && !Miscellaneous.isAndroidEmulator())
|
||||
// {
|
||||
// accelerometerHandler = new AccelerometerHandler();
|
||||
// mySensorActivity = new SensorActivity(this);
|
||||
// }
|
||||
|
||||
// startPhoneStateListener
|
||||
PhoneStatusListener.startPhoneStatusListener(AutomationService.getInstance()); // also used to mute anouncements during calls
|
||||
|
||||
@ -163,13 +169,23 @@ public class ReceiverCoordinator
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.noiseLevel))
|
||||
NoiseListener.startNoiseListener(AutomationService.getInstance());
|
||||
|
||||
// startNoiseListener
|
||||
// startBroadcastListener
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.broadcastReceived))
|
||||
BroadcastListener.getInstance().startListener(AutomationService.getInstance());
|
||||
|
||||
// startProcessListener
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.process_started_stopped))
|
||||
ProcessListener.startProcessListener(AutomationService.getInstance());
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.deviceOrientation))
|
||||
DeviceOrientationListener.getInstance().startListener(AutomationService.getInstance());
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.tethering))
|
||||
TetheringReceiver.getInstance().startListener(AutomationService.getInstance());
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.subSystemState))
|
||||
SubSystemStateReceiver.getInstance().startListener(AutomationService.getInstance());
|
||||
|
||||
try
|
||||
{
|
||||
Class testClass = Class.forName(ActivityManageRule.activityDetectionClassPath);
|
||||
@ -182,13 +198,17 @@ public class ReceiverCoordinator
|
||||
// Nothing to do, just not starting this one.
|
||||
}
|
||||
|
||||
//startBluetoothReceiver
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.bluetoothConnection))
|
||||
BluetoothReceiver.startBluetoothReceiver();
|
||||
|
||||
//startHeadsetJackListener
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.headsetPlugged))
|
||||
HeadphoneJackListener.getInstance().startListener(AutomationService.getInstance());
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.musicPlaying))
|
||||
MediaPlayerListener.getInstance().startListener(AutomationService.getInstance());
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.screenState))
|
||||
ScreenStateReceiver.startScreenStateReceiver(AutomationService.getInstance());
|
||||
}
|
||||
|
||||
public static void stopAllReceivers()
|
||||
@ -202,15 +222,19 @@ public class ReceiverCoordinator
|
||||
TimeZoneListener.stopTimeZoneListener();
|
||||
DateTimeListener.stopAlarmListener(AutomationService.getInstance());
|
||||
NoiseListener.stopNoiseListener();
|
||||
BroadcastListener.getInstance().stopListener(AutomationService.getInstance());
|
||||
ProcessListener.stopProcessListener(AutomationService.getInstance());
|
||||
MediaPlayerListener.getInstance().stopListener(AutomationService.getInstance());
|
||||
DeviceOrientationListener.getInstance().stopListener(AutomationService.getInstance());
|
||||
TetheringReceiver.getInstance().stopListener(AutomationService.getInstance());
|
||||
SubSystemStateReceiver.getInstance().stopListener(AutomationService.getInstance());
|
||||
|
||||
try
|
||||
{
|
||||
Class testClass = Class.forName(ActivityManageRule.activityDetectionClassPath);
|
||||
Miscellaneous.runMethodReflective("ActivityDetectionReceiver", "stopActivityDetectionReceiver", null);
|
||||
}
|
||||
catch(ClassNotFoundException e)
|
||||
catch(Exception e)
|
||||
{
|
||||
// Nothing to do, just not stopping this one.
|
||||
}
|
||||
@ -241,7 +265,7 @@ public class ReceiverCoordinator
|
||||
|
||||
// timeFrame -> too inexpensive to shutdown
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.charging) | Rule.isAnyRuleUsing(Trigger.Trigger_Enum.usb_host_connection) | Rule.isAnyRuleUsing(Trigger.Trigger_Enum.batteryLevel))
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.charging) || Rule.isAnyRuleUsing(Trigger.Trigger_Enum.usb_host_connection) || Rule.isAnyRuleUsing(Trigger.Trigger_Enum.batteryLevel))
|
||||
{
|
||||
if(BatteryReceiver.haveAllPermission())
|
||||
BatteryReceiver.startBatteryReceiver(AutomationService.getInstance());
|
||||
@ -261,6 +285,17 @@ public class ReceiverCoordinator
|
||||
NoiseListener.stopNoiseListener();
|
||||
}
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.broadcastReceived))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "LocationProvider", "Starting BroadcastReceiver because used in a new/changed rule.", 4);
|
||||
BroadcastListener.getInstance().startListener(AutomationService.getInstance());
|
||||
}
|
||||
else
|
||||
{
|
||||
Miscellaneous.logEvent("i", "LocationProvider", "Shutting down BroadcastReceiver because not used in any rule.", 4);
|
||||
BroadcastListener.getInstance().stopListener(AutomationService.getInstance());
|
||||
}
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.process_started_stopped))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "LocationProvider", "Starting ProcessListener because used in a new/changed rule.", 4);
|
||||
@ -273,7 +308,29 @@ public class ReceiverCoordinator
|
||||
ProcessListener.stopProcessListener(AutomationService.getInstance());
|
||||
}
|
||||
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase("fdroidFlavor"))
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.screenState))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "LocationProvider", "Starting ScreenStateListener because used in a new/changed rule.", 4);
|
||||
ScreenStateReceiver.startScreenStateReceiver(AutomationService.getInstance());
|
||||
}
|
||||
else
|
||||
{
|
||||
Miscellaneous.logEvent("i", "LocationProvider", "Shutting down ScreenStateListener because not used in any rule.", 4);
|
||||
ScreenStateReceiver.stopScreenStateReceiver();
|
||||
}
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.musicPlaying))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "LocationProvider", "Starting MediaPlayerListener because used in a new/changed rule.", 4);
|
||||
MediaPlayerListener.getInstance().startListener(AutomationService.getInstance());
|
||||
}
|
||||
else
|
||||
{
|
||||
Miscellaneous.logEvent("i", "LocationProvider", "Shutting down MediaPlayerListener because not used in any rule.", 4);
|
||||
MediaPlayerListener.getInstance().stopListener(AutomationService.getInstance());
|
||||
}
|
||||
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase(AutomationService.flavor_name_fdroid))
|
||||
{
|
||||
if (Rule.isAnyRuleUsing(Trigger.Trigger_Enum.activityDetection))
|
||||
{
|
||||
@ -370,6 +427,42 @@ public class ReceiverCoordinator
|
||||
}
|
||||
}
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.tethering))
|
||||
{
|
||||
if(!TetheringReceiver.getInstance().isListenerRunning())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "TetheringReceiver", "Starting TetheringReceiver because used in a new/changed rule.", 4);
|
||||
// if(DevicePositionListener.getInstance().haveAllPermission())
|
||||
TetheringReceiver.getInstance().startListener(AutomationService.getInstance());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(TetheringReceiver.getInstance().isListenerRunning())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "TetheringReceiver", "Shutting down TetheringReceiver because not used in any rule.", 4);
|
||||
TetheringReceiver.getInstance().stopListener(AutomationService.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.subSystemState))
|
||||
{
|
||||
if(!SubSystemStateReceiver.getInstance().isListenerRunning())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "SubSystemStateReceiver", "Starting SubSystemStateReceiver because used in a new/changed rule.", 4);
|
||||
// if(DevicePositionListener.getInstance().haveAllPermission())
|
||||
TetheringReceiver.getInstance().startListener(AutomationService.getInstance());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(SubSystemStateReceiver.getInstance().isListenerRunning())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "SubSystemStateReceiver", "Shutting down SubSystemStateReceiver because not used in any rule.", 4);
|
||||
SubSystemStateReceiver.getInstance().stopListener(AutomationService.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
AutomationService.updateNotification();
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import java.util.Set;
|
||||
public class Settings implements SharedPreferences
|
||||
{
|
||||
public static final int rulesThatHaveBeenRanHistorySize = 10;
|
||||
public final static int lockSoundChangesInterval = 15;
|
||||
public static final int lockSoundChangesInterval = 15;
|
||||
public static final int newsPollEveryXDays = 3;
|
||||
public static final int newsDisplayForXDays = 3;
|
||||
public static final int updateCheckFrequencyDays = 7;
|
||||
@ -20,6 +20,7 @@ public class Settings implements SharedPreferences
|
||||
public static final String zipFileName = "automation.zip";
|
||||
|
||||
public static final String constNewsOptInDone ="newsOptInDone";
|
||||
public static final String constNotificationChannelCleanupApk118 ="notificationChannelCleanupApk118";
|
||||
|
||||
public static long minimumDistanceChangeForGpsUpdate;
|
||||
public static long minimumDistanceChangeForNetworkUpdate;
|
||||
@ -65,6 +66,7 @@ public class Settings implements SharedPreferences
|
||||
public static boolean executeRulesAndProfilesWithSingleClick;
|
||||
public static boolean displayNewsOnMainScreen;
|
||||
public static boolean automaticUpdateCheck;
|
||||
public static long musicCheckFrequency;
|
||||
|
||||
public static boolean lockSoundChanges;
|
||||
public static boolean noticeAndroid9MicrophoneShown;
|
||||
@ -75,57 +77,64 @@ public class Settings implements SharedPreferences
|
||||
public static ArrayList<String> whatHasBeenDone;
|
||||
|
||||
/*
|
||||
Generic settings valid for all installations and not changable
|
||||
Not saved permanently.
|
||||
*/
|
||||
public static boolean deviceStartDone = true; // by default assume device has not just been started
|
||||
public static boolean serviceStartDone = false;
|
||||
|
||||
/*
|
||||
Generic settings valid for all installations and not changeable
|
||||
*/
|
||||
public static final String dateFormat = "E dd.MM.yyyy HH:mm:ss:ssss";
|
||||
|
||||
protected static final int default_positioningEngine = 0;
|
||||
protected static final long default_minimumDistanceChangeForGpsUpdate = 100;
|
||||
protected static final long default_minimumDistanceChangeForNetworkUpdate = 500; // in Meters
|
||||
protected static final long default_satisfactoryAccuracyGps = 50;
|
||||
protected static final long default_satisfactoryAccuracyNetwork = 1000;
|
||||
protected static final int default_gpsTimeout = 300; // seconds
|
||||
protected static final long default_minimumTimeBetweenUpdate = 30000; // in Milliseconds
|
||||
protected static final boolean default_startServiceAtSystemBoot = false;
|
||||
protected static final boolean default_writeLogFile = false;
|
||||
protected static final long default_logLevel = 2;
|
||||
protected static final int default_logFileMaxSize = 10;
|
||||
protected static final boolean default_useTextToSpeechOnNormal = false;
|
||||
protected static final boolean default_useTextToSpeechOnVibrate = false;
|
||||
protected static final boolean default_useTextToSpeechOnSilent = false;
|
||||
protected static final boolean default_muteTextToSpeechDuringCalls = true;
|
||||
protected static final boolean default_useWifiForPositioning = true;
|
||||
protected static final boolean default_useAccelerometerForPositioning = true;
|
||||
protected static final long default_useAccelerometerAfterIdleTime = 5;
|
||||
protected static final long default_accelerometerMovementThreshold = 2;
|
||||
protected static final long default_speedMaximumTimeBetweenLocations = 4;
|
||||
protected static final long default_timeBetweenNoiseLevelMeasurements = 60;
|
||||
protected static final long default_lengthOfNoiseLevelMeasurements = 5;
|
||||
protected static final long default_referenceValueForNoiseLevelMeasurements = 20;
|
||||
protected static final boolean default_hasServiceBeenRunning = false;
|
||||
protected static final boolean default_startServiceAfterAppUpdate = true;
|
||||
protected static final boolean default_startNewThreadForRuleActivation = true;
|
||||
protected static final boolean default_showIconWhenServiceIsRunning = true;
|
||||
protected static final boolean default_httpAcceptAllCertificates = false;
|
||||
protected static final int default_httpAttempts = 3;
|
||||
protected static final int default_httpAttemptsTimeout = 60;
|
||||
protected static final int default_httpAttemptGap = 2;
|
||||
protected static final PointOfInterest default_lastActivePoi = null;
|
||||
protected static final boolean default_rememberLastActivePoi = true;
|
||||
protected static final int default_locationRingBufferSize=3;
|
||||
protected static final long default_timeBetweenProcessMonitorings = 60;
|
||||
protected static final long default_acceptDevicePositionSignalEveryX_MilliSeconds = 1000;
|
||||
protected static final int default_activityDetectionFrequency = 60;
|
||||
protected static final int default_activityDetectionRequiredProbability = 75;
|
||||
protected static final boolean default_privacyLocationing = false;
|
||||
protected static final int default_startScreen = 0;
|
||||
protected static final int default_tabsPlacement = 0;
|
||||
protected static final boolean default_executeRulesAndProfilesWithSingleClick = false;
|
||||
protected static final boolean default_displayNewsOnMainScreen = false;
|
||||
protected static final boolean default_automaticUpdateCheck = false;
|
||||
protected static final boolean default_lockSoundChanges = false;
|
||||
protected static final long default_lastNewsPolltime = -1;
|
||||
protected static final long default_lastUpdateCheck = -1;
|
||||
public static final int default_positioningEngine = 0;
|
||||
public static final long default_minimumDistanceChangeForGpsUpdate = 100;
|
||||
public static final long default_minimumDistanceChangeForNetworkUpdate = 500; // in Meters
|
||||
public static final long default_satisfactoryAccuracyGps = 50;
|
||||
public static final long default_satisfactoryAccuracyNetwork = 1000;
|
||||
public static final int default_gpsTimeout = 300; // seconds
|
||||
public static final long default_minimumTimeBetweenUpdate = 30000; // in Milliseconds
|
||||
public static final boolean default_startServiceAtSystemBoot = false;
|
||||
public static final boolean default_writeLogFile = false;
|
||||
public static final long default_logLevel = 2;
|
||||
public static final int default_logFileMaxSize = 10;
|
||||
public static final boolean default_useTextToSpeechOnNormal = false;
|
||||
public static final boolean default_useTextToSpeechOnVibrate = false;
|
||||
public static final boolean default_useTextToSpeechOnSilent = false;
|
||||
public static final boolean default_muteTextToSpeechDuringCalls = true;
|
||||
public static final boolean default_useWifiForPositioning = true;
|
||||
public static final boolean default_useAccelerometerForPositioning = true;
|
||||
public static final long default_useAccelerometerAfterIdleTime = 5;
|
||||
public static final long default_accelerometerMovementThreshold = 2;
|
||||
public static final long default_speedMaximumTimeBetweenLocations = 4;
|
||||
public static final long default_timeBetweenNoiseLevelMeasurements = 60;
|
||||
public static final long default_lengthOfNoiseLevelMeasurements = 5;
|
||||
public static final long default_referenceValueForNoiseLevelMeasurements = 20;
|
||||
public static final boolean default_hasServiceBeenRunning = false;
|
||||
public static final boolean default_startServiceAfterAppUpdate = true;
|
||||
public static final boolean default_startNewThreadForRuleActivation = true;
|
||||
public static final boolean default_showIconWhenServiceIsRunning = true;
|
||||
public static final boolean default_httpAcceptAllCertificates = false;
|
||||
public static final int default_httpAttempts = 3;
|
||||
public static final int default_httpAttemptsTimeout = 60;
|
||||
public static final int default_httpAttemptGap = 2;
|
||||
public static final PointOfInterest default_lastActivePoi = null;
|
||||
public static final boolean default_rememberLastActivePoi = true;
|
||||
public static final int default_locationRingBufferSize=3;
|
||||
public static final long default_timeBetweenProcessMonitorings = 60;
|
||||
public static final long default_acceptDevicePositionSignalEveryX_MilliSeconds = 1000;
|
||||
public static final int default_activityDetectionFrequency = 60;
|
||||
public static final int default_activityDetectionRequiredProbability = 75;
|
||||
public static final boolean default_privacyLocationing = false;
|
||||
public static final int default_startScreen = 0;
|
||||
public static final int default_tabsPlacement = 0;
|
||||
public static final boolean default_executeRulesAndProfilesWithSingleClick = false;
|
||||
public static final boolean default_displayNewsOnMainScreen = false;
|
||||
public static final boolean default_automaticUpdateCheck = false;
|
||||
public static final boolean default_lockSoundChanges = false;
|
||||
public static final long default_lastNewsPolltime = -1;
|
||||
public static final long default_lastUpdateCheck = -1;
|
||||
public static final long default_musicCheckFrequency = 2500;
|
||||
|
||||
@Override
|
||||
public boolean contains(String arg0)
|
||||
@ -260,6 +269,11 @@ public class Settings implements SharedPreferences
|
||||
startScreen = Integer.parseInt(prefs.getString("startScreen", String.valueOf(default_startScreen)));
|
||||
tabsPlacement = Integer.parseInt(prefs.getString("tabsPlacement", String.valueOf(default_tabsPlacement)));
|
||||
|
||||
musicCheckFrequency = Long.parseLong(prefs.getString("musicCheckFrequency", String.valueOf(default_musicCheckFrequency)));
|
||||
|
||||
if(Settings.musicCheckFrequency == 0)
|
||||
Settings.musicCheckFrequency = Settings.default_musicCheckFrequency;
|
||||
|
||||
executeRulesAndProfilesWithSingleClick = prefs.getBoolean("executeRulesAndProfilesWithSingleClick", default_executeRulesAndProfilesWithSingleClick);
|
||||
automaticUpdateCheck = prefs.getBoolean("automaticUpdateCheck", default_automaticUpdateCheck);
|
||||
displayNewsOnMainScreen = prefs.getBoolean("displayNewsOnMainScreen", default_displayNewsOnMainScreen);
|
||||
@ -326,154 +340,154 @@ public class Settings implements SharedPreferences
|
||||
|
||||
Editor editor = prefs.edit();
|
||||
|
||||
if(!prefs.contains("startServiceAtSystemBoot") | force)
|
||||
if(!prefs.contains("startServiceAtSystemBoot") || force)
|
||||
editor.putBoolean("startServiceAtSystemBoot", default_startServiceAtSystemBoot);
|
||||
|
||||
if(!prefs.contains("writeLogFile") | force)
|
||||
if(!prefs.contains("writeLogFile") || force)
|
||||
editor.putBoolean("writeLogFile", default_writeLogFile);
|
||||
|
||||
// if(!prefs.contains("useTextToSpeech") | force)
|
||||
// editor.putBoolean("useTextToSpeech", default_useTextToSpeech);
|
||||
|
||||
if(!prefs.contains("useTextToSpeechOnNormal") | force)
|
||||
if(!prefs.contains("useTextToSpeechOnNormal") || force)
|
||||
editor.putBoolean("useTextToSpeechOnNormal", default_useTextToSpeechOnNormal);
|
||||
|
||||
if(!prefs.contains("useTextToSpeechOnVibrate") | force)
|
||||
if(!prefs.contains("useTextToSpeechOnVibrate") || force)
|
||||
editor.putBoolean("useTextToSpeechOnVibrate", default_useTextToSpeechOnVibrate);
|
||||
|
||||
if(!prefs.contains("useTextToSpeechOnSilent") | force)
|
||||
if(!prefs.contains("useTextToSpeechOnSilent") || force)
|
||||
editor.putBoolean("useTextToSpeechOnSilent", default_useTextToSpeechOnSilent);
|
||||
|
||||
if(!prefs.contains("muteTextToSpeechDuringCalls") | force)
|
||||
if(!prefs.contains("muteTextToSpeechDuringCalls") || force)
|
||||
editor.putBoolean("muteTextToSpeechDuringCalls", default_muteTextToSpeechDuringCalls);
|
||||
|
||||
if(!prefs.contains("positioningEngine") | force)
|
||||
if(!prefs.contains("positioningEngine") || force)
|
||||
editor.putString("positioningEngine", String.valueOf(default_positioningEngine));
|
||||
|
||||
if(!prefs.contains("useWifiForPositioning") | force)
|
||||
if(!prefs.contains("useWifiForPositioning") || force)
|
||||
editor.putBoolean("useWifiForPositioning", default_useWifiForPositioning);
|
||||
|
||||
if(!prefs.contains("hasServiceBeenRunning") | force)
|
||||
if(!prefs.contains("hasServiceBeenRunning") || force)
|
||||
editor.putBoolean("hasServiceBeenRunning", default_hasServiceBeenRunning);
|
||||
|
||||
if(!prefs.contains("startServiceAfterAppUpdate") | force)
|
||||
if(!prefs.contains("startServiceAfterAppUpdate") || force)
|
||||
editor.putBoolean("startServiceAfterAppUpdate", default_startServiceAfterAppUpdate);
|
||||
|
||||
if(!prefs.contains("startNewThreadForRuleActivation") | force)
|
||||
if(!prefs.contains("startNewThreadForRuleActivation") || force)
|
||||
editor.putBoolean("startNewThreadForRuleActivation", default_startNewThreadForRuleActivation);
|
||||
|
||||
if(!prefs.contains("showIconWhenServiceIsRunning") | force)
|
||||
if(!prefs.contains("showIconWhenServiceIsRunning") || force)
|
||||
editor.putBoolean("showIconWhenServiceIsRunning", default_showIconWhenServiceIsRunning);
|
||||
|
||||
if(!prefs.contains("useAccelerometerForPositioning") | force)
|
||||
if(!prefs.contains("useAccelerometerForPositioning") || force)
|
||||
editor.putBoolean("useAccelerometerForPositioning", default_useAccelerometerForPositioning);
|
||||
|
||||
if(!prefs.contains("useAccelerometerAfterIdleTime") | force)
|
||||
if(!prefs.contains("useAccelerometerAfterIdleTime") || force)
|
||||
editor.putString("useAccelerometerAfterIdleTime", String.valueOf(default_useAccelerometerAfterIdleTime));
|
||||
|
||||
if(!prefs.contains("accelerometerMovementThreshold") | force)
|
||||
if(!prefs.contains("accelerometerMovementThreshold") || force)
|
||||
editor.putString("accelerometerMovementThreshold", String.valueOf(default_accelerometerMovementThreshold));
|
||||
|
||||
if(!prefs.contains("speedMaximumTimeBetweenLocations") | force)
|
||||
if(!prefs.contains("speedMaximumTimeBetweenLocations") || force)
|
||||
editor.putString("speedMaximumTimeBetweenLocations", String.valueOf(default_speedMaximumTimeBetweenLocations));
|
||||
|
||||
if(!prefs.contains("MINIMUM_DISTANCE_CHANGE_FOR_GPS_UPDATE") | force)
|
||||
if(!prefs.contains("MINIMUM_DISTANCE_CHANGE_FOR_GPS_UPDATE") || force)
|
||||
editor.putString("MINIMUM_DISTANCE_CHANGE_FOR_GPS_UPDATE", String.valueOf(default_minimumDistanceChangeForGpsUpdate));
|
||||
|
||||
if(!prefs.contains("MINIMUM_DISTANCE_CHANGE_FOR_NETWORK_UPDATE") | force)
|
||||
if(!prefs.contains("MINIMUM_DISTANCE_CHANGE_FOR_NETWORK_UPDATE") || force)
|
||||
editor.putString("MINIMUM_DISTANCE_CHANGE_FOR_NETWORK_UPDATE", String.valueOf(default_minimumDistanceChangeForNetworkUpdate));
|
||||
|
||||
if(!prefs.contains("SATISFACTORY_ACCURACY_GPS") | force)
|
||||
if(!prefs.contains("SATISFACTORY_ACCURACY_GPS") || force)
|
||||
editor.putString("SATISFACTORY_ACCURACY_GPS", String.valueOf(default_satisfactoryAccuracyGps));
|
||||
|
||||
if(!prefs.contains("SATISFACTORY_ACCURACY_NETWORK") | force)
|
||||
if(!prefs.contains("SATISFACTORY_ACCURACY_NETWORK") || force)
|
||||
editor.putString("SATISFACTORY_ACCURACY_NETWORK", String.valueOf(default_satisfactoryAccuracyNetwork));
|
||||
|
||||
if(!prefs.contains("gpsTimeout") | force)
|
||||
if(!prefs.contains("gpsTimeout") || force)
|
||||
editor.putString("gpsTimeout", String.valueOf(default_gpsTimeout));
|
||||
|
||||
if(!prefs.contains("MINIMUM_TIME_BETWEEN_UPDATE") | force)
|
||||
if(!prefs.contains("MINIMUM_TIME_BETWEEN_UPDATE") || force)
|
||||
editor.putString("MINIMUM_TIME_BETWEEN_UPDATE", String.valueOf(default_minimumTimeBetweenUpdate));
|
||||
|
||||
if(!prefs.contains("timeBetweenNoiseLevelMeasurements") | force)
|
||||
if(!prefs.contains("timeBetweenNoiseLevelMeasurements") || force)
|
||||
editor.putString("timeBetweenNoiseLevelMeasurements", String.valueOf(default_timeBetweenNoiseLevelMeasurements));
|
||||
|
||||
if(!prefs.contains("lengthOfNoiseLevelMeasurements") | force)
|
||||
if(!prefs.contains("lengthOfNoiseLevelMeasurements") || force)
|
||||
editor.putString("lengthOfNoiseLevelMeasurements", String.valueOf(default_lengthOfNoiseLevelMeasurements));
|
||||
|
||||
if(!prefs.contains("referenceValueForNoiseLevelMeasurements") | force)
|
||||
if(!prefs.contains("referenceValueForNoiseLevelMeasurements") || force)
|
||||
editor.putString("referenceValueForNoiseLevelMeasurements", String.valueOf(default_referenceValueForNoiseLevelMeasurements));
|
||||
|
||||
if(!prefs.contains("logLevel") | force)
|
||||
if(!prefs.contains("logLevel") || force)
|
||||
editor.putString("logLevel", String.valueOf(default_logLevel));
|
||||
|
||||
if(!prefs.contains("logFileMaxSize") | force)
|
||||
if(!prefs.contains("logFileMaxSize") || force)
|
||||
editor.putString("logFileMaxSize", String.valueOf(default_logFileMaxSize));
|
||||
|
||||
if(!prefs.contains("httpAcceptAllCertificates") | force)
|
||||
if(!prefs.contains("httpAcceptAllCertificates") || force)
|
||||
editor.putBoolean("httpAcceptAllCertificates", default_httpAcceptAllCertificates);
|
||||
|
||||
if(!prefs.contains("httpAttempts") | force)
|
||||
if(!prefs.contains("httpAttempts") || force)
|
||||
editor.putString("httpAttempts", String.valueOf(default_httpAttempts));
|
||||
|
||||
if(!prefs.contains("httpAttemptsTimeout") | force)
|
||||
if(!prefs.contains("httpAttemptsTimeout") || force)
|
||||
editor.putString("httpAttemptsTimeout", String.valueOf(default_httpAttemptsTimeout));
|
||||
|
||||
if(!prefs.contains("httpAttemptGap") | force)
|
||||
if(!prefs.contains("httpAttemptGap") || force)
|
||||
editor.putString("httpAttemptGap", String.valueOf(default_httpAttemptGap));
|
||||
|
||||
if(!prefs.contains("lastActivePoi") | force)
|
||||
if(!prefs.contains("lastActivePoi") || force)
|
||||
editor.putString("lastActivePoi", "null");
|
||||
|
||||
if(!prefs.contains("rememberLastActivePoi") | force)
|
||||
if(!prefs.contains("rememberLastActivePoi") || force)
|
||||
editor.putBoolean("rememberLastActivePoi", default_rememberLastActivePoi);
|
||||
|
||||
if(!prefs.contains("locationRingBufferSize") | force)
|
||||
if(!prefs.contains("locationRingBufferSize") || force)
|
||||
editor.putString("locationRingBufferSize", String.valueOf(default_locationRingBufferSize));
|
||||
|
||||
if(!prefs.contains("timeBetweenProcessMonitorings") | force)
|
||||
if(!prefs.contains("timeBetweenProcessMonitorings") || force)
|
||||
editor.putString("timeBetweenProcessMonitorings", String.valueOf(default_timeBetweenProcessMonitorings));
|
||||
|
||||
if(!prefs.contains("acceptDevicePositionSignalEveryX_MilliSeconds") | force)
|
||||
if(!prefs.contains("acceptDevicePositionSignalEveryX_MilliSeconds") || force)
|
||||
editor.putString("acceptDevicePositionSignalEveryX_MilliSeconds", String.valueOf(default_acceptDevicePositionSignalEveryX_MilliSeconds));
|
||||
|
||||
if(!prefs.contains("activityDetectionFrequency") | force)
|
||||
if(!prefs.contains("activityDetectionFrequency") || force)
|
||||
editor.putString("activityDetectionFrequency", String.valueOf(default_activityDetectionFrequency));
|
||||
|
||||
if(!prefs.contains("activityDetectionRequiredProbability") | force)
|
||||
if(!prefs.contains("activityDetectionRequiredProbability") || force)
|
||||
editor.putString("activityDetectionRequiredProbability", String.valueOf(default_activityDetectionRequiredProbability));
|
||||
|
||||
if(!prefs.contains("privacyLocationing") | force)
|
||||
if(!prefs.contains("privacyLocationing") || force)
|
||||
editor.putBoolean("privacyLocationing", default_privacyLocationing);
|
||||
|
||||
if(!prefs.contains("startScreen") | force)
|
||||
if(!prefs.contains("startScreen") || force)
|
||||
editor.putString("startScreen", String.valueOf(default_startScreen));
|
||||
|
||||
if(!prefs.contains("tabsPlacement") | force)
|
||||
if(!prefs.contains("tabsPlacement") || force)
|
||||
editor.putString("tabsPlacement", String.valueOf(default_tabsPlacement));
|
||||
|
||||
if(!prefs.contains("executeRulesAndProfilesWithSingleClick") | force)
|
||||
if(!prefs.contains("executeRulesAndProfilesWithSingleClick") || force)
|
||||
editor.putBoolean("executeRulesAndProfilesWithSingleClick", default_executeRulesAndProfilesWithSingleClick);
|
||||
|
||||
if(!prefs.contains("automaticUpdateCheck") | force)
|
||||
if(!prefs.contains("automaticUpdateCheck") || force)
|
||||
editor.putBoolean("automaticUpdateCheck", default_automaticUpdateCheck);
|
||||
|
||||
if(!prefs.contains("displayNewsOnMainScreen") | force)
|
||||
if(!prefs.contains("displayNewsOnMainScreen") || force)
|
||||
editor.putBoolean("displayNewsOnMainScreen", default_displayNewsOnMainScreen);
|
||||
|
||||
if(!prefs.contains("lockSoundChanges") | force)
|
||||
if(!prefs.contains("musicCheckFrequency") || force)
|
||||
editor.putLong("musicCheckFrequency", default_musicCheckFrequency);
|
||||
|
||||
if(!prefs.contains("lockSoundChanges") || force)
|
||||
editor.putBoolean("lockSoundChanges", default_lockSoundChanges);
|
||||
|
||||
if(!prefs.contains("noticeAndroid9MicrophoneShown") | force)
|
||||
if(!prefs.contains("noticeAndroid9MicrophoneShown") || force)
|
||||
editor.putBoolean("noticeAndroid9MicrophoneShown", false);
|
||||
|
||||
if(!prefs.contains("lastNewsPolltime") | force)
|
||||
if(!prefs.contains("lastNewsPolltime") || force)
|
||||
editor.putLong("lastNewsPolltime", default_lastNewsPolltime);
|
||||
|
||||
if(!prefs.contains("lastUpdateCheck") | force)
|
||||
if(!prefs.contains("lastUpdateCheck") || force)
|
||||
editor.putLong("lastUpdateCheck", default_lastUpdateCheck);
|
||||
|
||||
if(!prefs.contains("whatHasBeenDone") | force)
|
||||
if(!prefs.contains("whatHasBeenDone") || force)
|
||||
editor.putString("whatHasBeenDone", "");
|
||||
|
||||
editor.commit();
|
||||
@ -542,6 +556,10 @@ public class Settings implements SharedPreferences
|
||||
editor.putBoolean("automaticUpdateCheck", automaticUpdateCheck);
|
||||
editor.putBoolean("displayNewsOnMainScreen", displayNewsOnMainScreen);
|
||||
|
||||
if(Settings.musicCheckFrequency == 0)
|
||||
Settings.musicCheckFrequency = Settings.default_musicCheckFrequency;
|
||||
editor.putString("musicCheckFrequency", String.valueOf(musicCheckFrequency));
|
||||
|
||||
editor.putBoolean("lockSoundChanges", lockSoundChanges);
|
||||
editor.putBoolean("noticeAndroid9MicrophoneShown", noticeAndroid9MicrophoneShown);
|
||||
editor.putBoolean("noticeAndroid10WifiShown", noticeAndroid10WifiShown);
|
||||
@ -588,5 +606,4 @@ public class Settings implements SharedPreferences
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -6,8 +6,8 @@ import java.util.ArrayList;
|
||||
public class TimeFrame
|
||||
{
|
||||
// Defines a timeframe
|
||||
protected Time triggerTimeStart;
|
||||
protected Time triggerTimeStop;
|
||||
protected TimeObject triggerTimeStart;
|
||||
protected TimeObject triggerTimeStop;
|
||||
protected long repetition;
|
||||
|
||||
protected final static String separator = "/";
|
||||
@ -34,20 +34,20 @@ public class TimeFrame
|
||||
}
|
||||
}
|
||||
|
||||
public Time getTriggerTimeStart()
|
||||
public TimeObject getTriggerTimeStart()
|
||||
{
|
||||
return triggerTimeStart;
|
||||
}
|
||||
public void setTriggerTimeStart(Time triggerTimeStart)
|
||||
public void setTriggerTimeStart(TimeObject triggerTimeStart)
|
||||
{
|
||||
this.triggerTimeStart = triggerTimeStart;
|
||||
}
|
||||
|
||||
public Time getTriggerTimeStop()
|
||||
public TimeObject getTriggerTimeStop()
|
||||
{
|
||||
return triggerTimeStop;
|
||||
}
|
||||
public void setTriggerTimeStop(Time triggerTimeStop)
|
||||
public void setTriggerTimeStop(TimeObject triggerTimeStop)
|
||||
{
|
||||
this.triggerTimeStop = triggerTimeStop;
|
||||
}
|
||||
@ -62,7 +62,7 @@ public class TimeFrame
|
||||
this.repetition = repetition;
|
||||
}
|
||||
|
||||
public TimeFrame (Time timeStart, Time timeEnd, ArrayList<Integer> dayList2, long repetition)
|
||||
public TimeFrame (TimeObject timeStart, TimeObject timeEnd, ArrayList<Integer> dayList2, long repetition)
|
||||
{
|
||||
this.setTriggerTimeStart(timeStart);
|
||||
this.setTriggerTimeStop(timeEnd);
|
||||
@ -73,13 +73,36 @@ public class TimeFrame
|
||||
public TimeFrame (String fileContent)
|
||||
{
|
||||
String[] dateArray = fileContent.split(separator); // example: timestart/timestop/days[int]/repetition
|
||||
this.setTriggerTimeStart(Time.valueOf(dateArray[0]));
|
||||
this.setTriggerTimeStop(Time.valueOf(dateArray[1]));
|
||||
this.setTriggerTimeStart(TimeObject.valueOf(dateArray[0]));
|
||||
this.setTriggerTimeStop(TimeObject.valueOf(dateArray[1]));
|
||||
this.setDayListFromString(dateArray[2]);
|
||||
if(dateArray.length > 3) // may not exist in old config files
|
||||
this.setRepetition(Long.parseLong(dateArray[3]));
|
||||
}
|
||||
|
||||
public String toTriggerParameter2String()
|
||||
{
|
||||
StringBuilder response = new StringBuilder();
|
||||
response.append(this.getTriggerTimeStart().getHours() + ":" + this.getTriggerTimeStart().getMinutes() + ":0");
|
||||
response.append(separator);
|
||||
response.append(this.getTriggerTimeStop().getHours() + ":" + this.getTriggerTimeStop().getMinutes() + ":0");
|
||||
response.append(separator);
|
||||
|
||||
StringBuilder days = new StringBuilder();
|
||||
|
||||
for(int day : dayList)
|
||||
days.append(String.valueOf(day));
|
||||
|
||||
response.append(days.toString());
|
||||
|
||||
if(this.repetition > 0)
|
||||
{
|
||||
response.append(separator + this.getRepetition());
|
||||
}
|
||||
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
78
app/src/main/java/com/jens/automation2/TimeObject.java
Normal file
78
app/src/main/java/com/jens/automation2/TimeObject.java
Normal file
@ -0,0 +1,78 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.sql.Time;
|
||||
|
||||
public class TimeObject
|
||||
{
|
||||
int hours, minutes, seconds;
|
||||
|
||||
public TimeObject()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public int getHours()
|
||||
{
|
||||
return hours;
|
||||
}
|
||||
|
||||
public void setHours(int hours)
|
||||
{
|
||||
this.hours = hours;
|
||||
}
|
||||
|
||||
public int getMinutes()
|
||||
{
|
||||
return minutes;
|
||||
}
|
||||
|
||||
public void setMinutes(int minutes)
|
||||
{
|
||||
this.minutes = minutes;
|
||||
}
|
||||
|
||||
public int getSeconds()
|
||||
{
|
||||
return seconds;
|
||||
}
|
||||
|
||||
public void setSeconds(int seconds)
|
||||
{
|
||||
this.seconds = seconds;
|
||||
}
|
||||
|
||||
public TimeObject(int hours, int minutes, int seconds)
|
||||
{
|
||||
this.hours = hours;
|
||||
this.minutes = minutes;
|
||||
this.seconds = seconds;
|
||||
}
|
||||
|
||||
public static TimeObject valueOf(String input)
|
||||
{
|
||||
TimeObject ro = null;
|
||||
|
||||
if(input.contains(":"))
|
||||
{
|
||||
String[] parts = input.split(":");
|
||||
if(parts.length == 2)
|
||||
ro = new TimeObject(Integer.parseInt(parts[0]), Integer.parseInt(parts[1]), 0);
|
||||
else if(parts.length == 3)
|
||||
ro = new TimeObject(Integer.parseInt(parts[0]), Integer.parseInt(parts[1]), Integer.parseInt(parts[2]));
|
||||
else
|
||||
Miscellaneous.logEvent("w", "TimeObject", "Invalid length for time. Input: " + input, 4);
|
||||
}
|
||||
|
||||
return ro;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
Time time = Time.valueOf(this.getHours() + ":" + this.getMinutes() + ":" + this.getSeconds());
|
||||
return time.toString();
|
||||
}
|
||||
}
|
@ -3,7 +3,6 @@ package com.jens.automation2;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
@ -14,29 +13,125 @@ import com.jens.automation2.location.LocationProvider;
|
||||
import com.jens.automation2.location.WifiBroadcastReceiver;
|
||||
import com.jens.automation2.receivers.BatteryReceiver;
|
||||
import com.jens.automation2.receivers.BluetoothReceiver;
|
||||
import com.jens.automation2.receivers.BroadcastListener;
|
||||
import com.jens.automation2.receivers.ConnectivityReceiver;
|
||||
import com.jens.automation2.receivers.DeviceOrientationListener;
|
||||
import com.jens.automation2.receivers.HeadphoneJackListener;
|
||||
import com.jens.automation2.receivers.MediaPlayerListener;
|
||||
import com.jens.automation2.receivers.NfcReceiver;
|
||||
import com.jens.automation2.receivers.NoiseListener;
|
||||
import com.jens.automation2.receivers.NotificationListener;
|
||||
import com.jens.automation2.receivers.PhoneStatusListener;
|
||||
import com.jens.automation2.receivers.ProcessListener;
|
||||
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TEXT;
|
||||
import static com.jens.automation2.receivers.NotificationListener.EXTRA_TITLE;
|
||||
import com.jens.automation2.receivers.ScreenStateReceiver;
|
||||
import com.jens.automation2.receivers.TetheringReceiver;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.sql.Time;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class Trigger
|
||||
{
|
||||
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,
|
||||
screenState,
|
||||
musicPlaying,
|
||||
deviceStarts,
|
||||
serviceStarts,
|
||||
broadcastReceived,
|
||||
tethering,
|
||||
subSystemState,
|
||||
phoneCall; //phoneCall always needs to be at the very end because of Google's shitty so called privacy
|
||||
|
||||
public String getFullName(Context context)
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case pointOfInterest:
|
||||
return context.getResources().getString(R.string.triggerPointOfInterest);
|
||||
case timeFrame:
|
||||
return context.getResources().getString(R.string.triggerTimeFrame);
|
||||
case charging:
|
||||
return context.getResources().getString(R.string.triggerCharging);
|
||||
case batteryLevel:
|
||||
return context.getResources().getString(R.string.batteryLevel);
|
||||
case usb_host_connection:
|
||||
return context.getResources().getString(R.string.triggerUsb_host_connection);
|
||||
case speed:
|
||||
return context.getResources().getString(R.string.triggerSpeed);
|
||||
case noiseLevel:
|
||||
return context.getResources().getString(R.string.triggerNoiseLevel);
|
||||
case wifiConnection:
|
||||
return context.getResources().getString(R.string.wifiConnection);
|
||||
case process_started_stopped:
|
||||
return context.getResources().getString(R.string.anotherAppIsRunning);
|
||||
case airplaneMode:
|
||||
return context.getResources().getString(R.string.airplaneMode);
|
||||
case roaming:
|
||||
return context.getResources().getString(R.string.roaming);
|
||||
case phoneCall:
|
||||
return context.getResources().getString(R.string.phoneCall);
|
||||
case nfcTag:
|
||||
return context.getResources().getString(R.string.nfcTag);
|
||||
case activityDetection:
|
||||
return context.getResources().getString(R.string.activityDetection);
|
||||
case bluetoothConnection:
|
||||
return context.getResources().getString(R.string.bluetoothConnection);
|
||||
case headsetPlugged:
|
||||
return context.getResources().getString(R.string.triggerHeadsetPlugged);
|
||||
case notification:
|
||||
return context.getResources().getString(R.string.notification);
|
||||
case deviceOrientation:
|
||||
return context.getResources().getString(R.string.deviceOrientation);
|
||||
case profileActive:
|
||||
return context.getResources().getString(R.string.profile);
|
||||
case musicPlaying:
|
||||
return context.getResources().getString(R.string.musicPlaying);
|
||||
case screenState:
|
||||
return context.getResources().getString(R.string.screenState);
|
||||
case deviceStarts:
|
||||
return context.getResources().getString(R.string.deviceStarts);
|
||||
case serviceStarts:
|
||||
return context.getResources().getString(R.string.serviceStarts);
|
||||
case broadcastReceived:
|
||||
return context.getResources().getString(R.string.broadcastReceivedTitle);
|
||||
case tethering:
|
||||
return context.getResources().getString(R.string.tetheringState);
|
||||
case subSystemState:
|
||||
return context.getResources().getString(R.string.subSystemState);
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static enum subSystemStates { wifi, bluetooth };
|
||||
|
||||
Rule parentRule = null;
|
||||
Calendar lastTimeNotApplied = null;
|
||||
|
||||
final static String anyAppString = "-1";
|
||||
|
||||
public boolean applies(Object triggeringObject, Context context)
|
||||
{
|
||||
boolean result = true;
|
||||
@ -121,6 +216,34 @@ public class Trigger
|
||||
if(!checkProfileActive())
|
||||
result = false;
|
||||
break;
|
||||
case musicPlaying:
|
||||
if(!checkMusicPlaying())
|
||||
result = false;
|
||||
break;
|
||||
case screenState:
|
||||
if(!checkScreenState())
|
||||
result = false;
|
||||
break;
|
||||
case deviceStarts:
|
||||
if(!checkDeviceStarts())
|
||||
result = false;
|
||||
break;
|
||||
case serviceStarts:
|
||||
if(!checkServiceStarts())
|
||||
result = false;
|
||||
break;
|
||||
case broadcastReceived:
|
||||
if(!checkBroadcastReceived())
|
||||
result = false;
|
||||
break;
|
||||
case tethering:
|
||||
if(!checkTetheringActive())
|
||||
result = false;
|
||||
break;
|
||||
case subSystemState:
|
||||
if(!checkSubSystemState())
|
||||
result = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -137,7 +260,19 @@ public class Trigger
|
||||
return result;
|
||||
}
|
||||
|
||||
boolean checkNotification()
|
||||
boolean checkBroadcastReceived()
|
||||
{
|
||||
/*
|
||||
We cannot reasonably check the current state for every broadcast event.
|
||||
We can only hope that when starting the receiver we get an initial broadcast
|
||||
for every current state. That collection of states will be saved and checked if
|
||||
it contains the specific event of this trigger.
|
||||
*/
|
||||
|
||||
return triggerParameter == BroadcastListener.getInstance().hasBroadcastOccurred(triggerParameter2);
|
||||
}
|
||||
|
||||
boolean checkNotification()
|
||||
{
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
|
||||
{
|
||||
@ -163,15 +298,13 @@ public class Trigger
|
||||
{
|
||||
if(getParentRule().getLastExecution() == null || sbn.getPostTime() > this.getParentRule().getLastExecution().getTimeInMillis())
|
||||
{
|
||||
String notificationApp = sbn.getPackageName();
|
||||
String notificationTitle = null;
|
||||
String notificationText = null;
|
||||
NotificationListener.SimpleNotification sn = NotificationListener.convertNotificationToSimpleNotification(true, sbn);
|
||||
|
||||
Miscellaneous.logEvent("i", "NotificationCheck", "Checking if this notification matches our rule " + this.getParentRule().getName() + ". App: " + notificationApp + ", title: " + notificationTitle + ", text: " + notificationText, 5);
|
||||
Miscellaneous.logEvent("i", "NotificationCheck", "Checking if this notification matches our rule " + this.getParentRule().getName() + ": " + sn.toString(), 5);
|
||||
|
||||
if (!myApp.equals("-1"))
|
||||
if (!myApp.equals(anyAppString))
|
||||
{
|
||||
if (!notificationApp.equalsIgnoreCase(myApp))
|
||||
if (!myApp.equalsIgnoreCase(sn.getApp()))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "NotificationCheck", "Notification app name does not match rule.", 5);
|
||||
continue;
|
||||
@ -179,6 +312,9 @@ public class Trigger
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
Notifications from Automation are disregarded to avoid infinite loops.
|
||||
*/
|
||||
if(myApp.equals(BuildConfig.APPLICATION_ID))
|
||||
{
|
||||
return false;
|
||||
@ -190,15 +326,10 @@ public class Trigger
|
||||
https://stackoverflow.com/questions/28047767/notificationlistenerservice-not-reading-text-of-stacked-notifications
|
||||
*/
|
||||
|
||||
Bundle extras = sbn.getNotification().extras;
|
||||
|
||||
// T I T L E
|
||||
if (extras.containsKey(EXTRA_TITLE))
|
||||
notificationTitle = sbn.getNotification().extras.getString(EXTRA_TITLE);
|
||||
|
||||
if (!StringUtils.isEmpty(requiredTitle))
|
||||
{
|
||||
if (!Miscellaneous.compare(myTitleDir, requiredTitle, notificationTitle))
|
||||
if (!Miscellaneous.compare(myTitleDir, requiredTitle, sn.getTitle()))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "NotificationCheck", "Notification title does not match rule.", 5);
|
||||
continue;
|
||||
@ -208,13 +339,9 @@ public class Trigger
|
||||
Miscellaneous.logEvent("i", "NotificationCheck", "A required title for a notification trigger was not specified.", 5);
|
||||
|
||||
// T E X T
|
||||
|
||||
if (extras.containsKey(EXTRA_TEXT))
|
||||
notificationText = sbn.getNotification().extras.getString(EXTRA_TEXT);
|
||||
|
||||
if (!StringUtils.isEmpty(requiredText))
|
||||
{
|
||||
if (!Miscellaneous.compare(myTextDir, requiredText, notificationText))
|
||||
if (!Miscellaneous.compare(myTextDir, requiredText, sn.getText()))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "NotificationCheck", "Notification text does not match rule.", 5);
|
||||
continue;
|
||||
@ -243,7 +370,7 @@ public class Trigger
|
||||
String title = NotificationListener.getLastNotification().getTitle();
|
||||
String text = NotificationListener.getLastNotification().getText();
|
||||
|
||||
if (!myApp.equals("-1"))
|
||||
if (!myApp.equals(anyAppString))
|
||||
{
|
||||
if (!app.equalsIgnoreCase(myApp))
|
||||
return false;
|
||||
@ -277,6 +404,26 @@ public class Trigger
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean checkMusicPlaying()
|
||||
{
|
||||
return triggerParameter == MediaPlayerListener.isAudioPlaying(Miscellaneous.getAnyContext());
|
||||
}
|
||||
|
||||
boolean checkDeviceStarts()
|
||||
{
|
||||
if(triggerParameter && checkServiceStarts() && !Settings.deviceStartDone)
|
||||
return true;
|
||||
else if(!triggerParameter && !checkServiceStarts() && Settings.deviceStartDone)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean checkServiceStarts()
|
||||
{
|
||||
return !Settings.serviceStartDone == getTriggerParameter();
|
||||
}
|
||||
|
||||
boolean checkProfileActive()
|
||||
{
|
||||
String demandedProfileName = getTriggerParameter2().split(Trigger.triggerParameter2Split)[0];
|
||||
@ -314,6 +461,25 @@ public class Trigger
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean checkScreenState()
|
||||
{
|
||||
try
|
||||
{
|
||||
int desiredState = Integer.parseInt(getTriggerParameter2());
|
||||
|
||||
if(desiredState == ScreenStateReceiver.SCREEN_STATE_OFF || desiredState == ScreenStateReceiver.SCREEN_STATE_ON)
|
||||
return desiredState == ScreenStateReceiver.getScreenPowerState();
|
||||
else
|
||||
return desiredState == ScreenStateReceiver.getScreenLockState();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("w", "Trigger", "Error checking screen state trigger.", 4);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean checkDeviceOrientation()
|
||||
{
|
||||
String deviceOrientationPieces[] = getTriggerParameter2().split(Trigger.triggerParameter2Split);
|
||||
@ -383,6 +549,31 @@ public class Trigger
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean checkSubSystemState()
|
||||
{
|
||||
try
|
||||
{
|
||||
subSystemStates state = subSystemStates.valueOf(triggerParameter2);
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case wifi:
|
||||
return WifiBroadcastReceiver.isWifiEnabled(Miscellaneous.getAnyContext()) == triggerParameter;
|
||||
case bluetooth:
|
||||
return BluetoothReceiver.isBluetoothEnabled() == triggerParameter;
|
||||
default:
|
||||
Miscellaneous.logEvent("w", "checkSubSystemState()", "Invalid subSystemState: " + state.name(), 3);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "checkSubSystemState()", Log.getStackTraceString(e), 1);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean checkBluetooth()
|
||||
{
|
||||
Miscellaneous.logEvent("i", Miscellaneous.getAnyContext().getResources().getString(R.string.ruleCheckOf), String.format("Checking for bluetooth...", this.getParentRule().getName()), 4);
|
||||
@ -538,7 +729,19 @@ public class Trigger
|
||||
|
||||
boolean checkProcess()
|
||||
{
|
||||
boolean running = ProcessListener.getRunningApps().contains(this.getProcessName());
|
||||
boolean running = false;
|
||||
|
||||
if(getTriggerParameter2().contains(triggerParameter2Split))
|
||||
{
|
||||
String parts[] = triggerParameter2.split(triggerParameter2Split);
|
||||
for(String appName : ProcessListener.getRunningApps())
|
||||
{
|
||||
if(appName.startsWith(parts[0]))
|
||||
running = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
running = ProcessListener.getRunningApps().contains(this.getProcessName());
|
||||
|
||||
if(running)
|
||||
Miscellaneous.logEvent("i", "ProcessMonitoring", "App " + this.getProcessName() + " is currently running.", 4);
|
||||
@ -564,7 +767,8 @@ public class Trigger
|
||||
if(this.getTriggerParameter2().length() > 0) // only check if any wifi name specified, otherwise any wifi will do
|
||||
{
|
||||
Miscellaneous.logEvent("i", Miscellaneous.getAnyContext().getResources().getString(R.string.ruleCheckOf), String.format("Wifi name specified, checking that.", this.getParentRule().getName()), 4);
|
||||
if(!WifiBroadcastReceiver.getLastWifiSsid().equals(this.getTriggerParameter2()))
|
||||
|
||||
if(!WifiBroadcastReceiver.getLastWifiSsid().equals(this.getTriggerParameter2()) && !(Miscellaneous.isRegularExpression(this.getTriggerParameter2()) && WifiBroadcastReceiver.getLastWifiSsid().matches(this.getTriggerParameter2())))
|
||||
{
|
||||
Miscellaneous.logEvent("i", Miscellaneous.getAnyContext().getResources().getString(R.string.ruleCheckOf), String.format(String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.ruleDoesntApplyNotTheCorrectSsid), getParentRule().getName(), this.getTriggerParameter2(), WifiBroadcastReceiver.getLastWifiSsid()),this.getParentRule().getName()), 3);
|
||||
return false;
|
||||
@ -630,9 +834,15 @@ public class Trigger
|
||||
|
||||
boolean checkBatteryLevel()
|
||||
{
|
||||
/*
|
||||
-1 means value is not known, yet.
|
||||
*/
|
||||
if(BatteryReceiver.getBatteryLevel() == -1)
|
||||
return false;
|
||||
|
||||
if(this.getTriggerParameter())
|
||||
{
|
||||
if(BatteryReceiver.getBatteryLevel() <= this.getBatteryLevel())
|
||||
if(BatteryReceiver.getBatteryLevel() < this.getBatteryLevel())
|
||||
{
|
||||
Miscellaneous.logEvent("i", Miscellaneous.getAnyContext().getResources().getString(R.string.ruleCheckOf), String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.ruleDoesntApplyBatteryLowerThan) + " " + String.valueOf(this.getBatteryLevel()), this.getParentRule().getName()), 3);
|
||||
return false;
|
||||
@ -640,7 +850,10 @@ public class Trigger
|
||||
}
|
||||
else
|
||||
{
|
||||
if(this.getBatteryLevel() >= this.getBatteryLevel())
|
||||
if(BatteryReceiver.getBatteryLevel() < 100 && BatteryReceiver.getBatteryLevel() >= this.getBatteryLevel()
|
||||
||
|
||||
BatteryReceiver.getBatteryLevel() > this.getBatteryLevel()
|
||||
)
|
||||
{
|
||||
Miscellaneous.logEvent("i", Miscellaneous.getAnyContext().getResources().getString(R.string.ruleCheckOf), String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.ruleDoesntApplyBatteryHigherThan) + " " + String.valueOf(this.getBatteryLevel()), this.getParentRule().getName()), 3);
|
||||
return false;
|
||||
@ -762,6 +975,28 @@ public class Trigger
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean checkTetheringActive()
|
||||
{
|
||||
if(TetheringReceiver.isTetheringActive() == triggerParameter)
|
||||
{
|
||||
if(getTriggerParameter2().equals(ActivityManageTriggerTethering.tetheringTypeAny))
|
||||
return true;
|
||||
|
||||
for(String oneOfLastTypes : TetheringReceiver.getLastTetheringTypes())
|
||||
{
|
||||
if(oneOfLastTypes.equals(getTriggerParameter2()))
|
||||
{
|
||||
if(triggerParameter)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean checkDateTime(Object triggeringObject, boolean checkifStateChangedSinceLastRuleExecution)
|
||||
{
|
||||
/*
|
||||
@ -777,7 +1012,7 @@ public class Trigger
|
||||
triggeringTime = new Date();
|
||||
|
||||
String timeString = String.valueOf(triggeringTime.getHours()) + ":" + String.valueOf(triggeringTime.getMinutes()) + ":" + String.valueOf(triggeringTime.getSeconds());
|
||||
Time nowTime = Time.valueOf(timeString);
|
||||
TimeObject nowTime = TimeObject.valueOf(timeString);
|
||||
Calendar calNow = Calendar.getInstance();
|
||||
|
||||
try
|
||||
@ -789,20 +1024,24 @@ public class Trigger
|
||||
if(
|
||||
// Regular case, start time is lower than end time
|
||||
(
|
||||
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
||||
&&
|
||||
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0
|
||||
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
||||
&&
|
||||
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0
|
||||
)
|
||||
||
|
||||
// Other case, start time higher than end time, timeframe goes over midnight
|
||||
(
|
||||
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) < 0
|
||||
&&
|
||||
(Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
||||
||
|
||||
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0)
|
||||
)
|
||||
||
|
||||
// further case: start and end times are identical, meaning a 24h window
|
||||
(
|
||||
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) == 0
|
||||
)
|
||||
|
|
||||
// Other case, start time higher than end time, timeframe goes over midnight
|
||||
(
|
||||
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) < 0
|
||||
&&
|
||||
(Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
||||
|
|
||||
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0)
|
||||
)
|
||||
|
||||
)
|
||||
{
|
||||
// We are in the timeframe
|
||||
@ -928,7 +1167,7 @@ public class Trigger
|
||||
public static Calendar getNextRepeatedExecutionAfter(Trigger trigger, Calendar now)
|
||||
{
|
||||
Calendar calSet;
|
||||
Time setTime;
|
||||
TimeObject setTime;
|
||||
TimeFrame tf = new TimeFrame(trigger.getTriggerParameter2());
|
||||
|
||||
if(tf.getRepetition() > 0)
|
||||
@ -944,8 +1183,6 @@ public class Trigger
|
||||
calSet.set(Calendar.SECOND, 0);
|
||||
calSet.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
// if(this.applies(null))
|
||||
// {
|
||||
// If the starting time is a day ahead remove 1 day.
|
||||
if(calSet.getTimeInMillis() > now.getTimeInMillis())
|
||||
calSet.add(Calendar.DAY_OF_MONTH, -1);
|
||||
@ -956,15 +1193,7 @@ public class Trigger
|
||||
Calendar calSchedule = Calendar.getInstance();
|
||||
calSchedule.setTimeInMillis(nextScheduleTimestamp * 1000);
|
||||
|
||||
/*
|
||||
* Das war mal aktiviert. Allerdings: Die ganze Funktion liefert zurück, wenn die Regel NOCH nicht
|
||||
* zutrifft, aber wir z.B. gleich den zeitlichen Bereich betreten.
|
||||
*/
|
||||
// if(trigger.checkDateTime(calSchedule.getTime(), false))
|
||||
// {
|
||||
return calSchedule;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("i", "Trigger", "Trigger " + trigger.toString() + " is not executed repeatedly.", 5);
|
||||
@ -997,73 +1226,14 @@ public class Trigger
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Can be several things:
|
||||
* -PointOfInterest
|
||||
* -TimeFrame
|
||||
* -Event (like charging, cable plugged, etc.)
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
public String getFullName(Context context)
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case pointOfInterest:
|
||||
return context.getResources().getString(R.string.triggerPointOfInterest);
|
||||
case timeFrame:
|
||||
return context.getResources().getString(R.string.triggerTimeFrame);
|
||||
case charging:
|
||||
return context.getResources().getString(R.string.triggerCharging);
|
||||
case batteryLevel:
|
||||
return context.getResources().getString(R.string.batteryLevel);
|
||||
case usb_host_connection:
|
||||
return context.getResources().getString(R.string.triggerUsb_host_connection);
|
||||
case speed:
|
||||
return context.getResources().getString(R.string.triggerSpeed);
|
||||
case noiseLevel:
|
||||
return context.getResources().getString(R.string.triggerNoiseLevel);
|
||||
case wifiConnection:
|
||||
return context.getResources().getString(R.string.wifiConnection);
|
||||
case process_started_stopped:
|
||||
return context.getResources().getString(R.string.anotherAppIsRunning);
|
||||
case airplaneMode:
|
||||
return context.getResources().getString(R.string.airplaneMode);
|
||||
case roaming:
|
||||
return context.getResources().getString(R.string.roaming);
|
||||
case phoneCall:
|
||||
return context.getResources().getString(R.string.phoneCall);
|
||||
case nfcTag:
|
||||
return context.getResources().getString(R.string.nfcTag);
|
||||
case activityDetection:
|
||||
return context.getResources().getString(R.string.activityDetection);
|
||||
case bluetoothConnection:
|
||||
return context.getResources().getString(R.string.bluetoothConnection);
|
||||
case headsetPlugged:
|
||||
return context.getResources().getString(R.string.triggerHeadsetPlugged);
|
||||
case notification:
|
||||
return context.getResources().getString(R.string.notification);
|
||||
case deviceOrientation:
|
||||
return context.getResources().getString(R.string.deviceOrientation);
|
||||
case profileActive:
|
||||
return context.getResources().getString(R.string.profile);
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private boolean triggerParameter; //if true->started event, if false->stopped
|
||||
private String triggerParameter2;
|
||||
boolean triggerParameter; //if true->started event, if false->stopped
|
||||
String triggerParameter2;
|
||||
|
||||
public static final String triggerParameter2Split = "tp2split";
|
||||
|
||||
private Trigger_Enum triggerType = null;
|
||||
private PointOfInterest pointOfInterest = null;
|
||||
private TimeFrame timeFrame;
|
||||
Trigger_Enum triggerType = null;
|
||||
PointOfInterest pointOfInterest = null;
|
||||
TimeFrame timeFrame;
|
||||
|
||||
public static String triggerPhoneCallStateRinging = "ringing";
|
||||
public static String triggerPhoneCallStateStarted = "started";
|
||||
@ -1073,17 +1243,17 @@ public class Trigger
|
||||
public static String triggerPhoneCallDirectionAny = "any";
|
||||
public static String triggerPhoneCallNumberAny = "any";
|
||||
|
||||
private double speed; //km/h
|
||||
private long noiseLevelDb;
|
||||
private String processName = null;
|
||||
private int batteryLevel;
|
||||
private int phoneDirection = 0; // 0=any, 1=incoming, 2=outgoing
|
||||
private String phoneNumber = null;
|
||||
private String nfcTagId = null;
|
||||
private String bluetoothEvent = null;
|
||||
private String bluetoothDeviceAddress = null;
|
||||
private int activityDetectionType = -1;
|
||||
private int headphoneType = -1;
|
||||
double speed; //km/h
|
||||
long noiseLevelDb;
|
||||
String processName = null;
|
||||
int batteryLevel;
|
||||
int phoneDirection = 0; // 0=any, 1=incoming, 2=outgoing
|
||||
String phoneNumber = null;
|
||||
String nfcTagId = null;
|
||||
String bluetoothEvent = null;
|
||||
String bluetoothDeviceAddress = null;
|
||||
int activityDetectionType = -1;
|
||||
int headphoneType = -1;
|
||||
|
||||
public int getHeadphoneType()
|
||||
{
|
||||
@ -1191,9 +1361,9 @@ public class Trigger
|
||||
return triggerType;
|
||||
}
|
||||
|
||||
public void setTriggerType(Trigger_Enum settriggerType)
|
||||
public void setTriggerType(Trigger_Enum setTriggerType)
|
||||
{
|
||||
this.triggerType = settriggerType;
|
||||
this.triggerType = setTriggerType;
|
||||
}
|
||||
|
||||
public boolean getTriggerParameter()
|
||||
@ -1466,7 +1636,7 @@ public class Trigger
|
||||
StringBuilder triggerBuilder = new StringBuilder();
|
||||
|
||||
String appString;
|
||||
if (app.equalsIgnoreCase("-1"))
|
||||
if (app.equalsIgnoreCase(anyAppString))
|
||||
appString = Miscellaneous.getAnyContext().getResources().getString(R.string.anyApp);
|
||||
else
|
||||
appString = "app " + app;
|
||||
@ -1486,7 +1656,7 @@ public class Trigger
|
||||
}
|
||||
else
|
||||
{
|
||||
setTriggerParameter2("-1" + triggerParameter2Split + directionEquals + triggerParameter2Split + triggerParameter2Split + directionEquals + triggerParameter2Split + triggerParameter2Split);
|
||||
setTriggerParameter2(anyAppString + triggerParameter2Split + directionEquals + triggerParameter2Split + triggerParameter2Split + directionEquals + triggerParameter2Split + triggerParameter2Split);
|
||||
}
|
||||
break;
|
||||
case deviceOrientation:
|
||||
@ -1498,6 +1668,79 @@ public class Trigger
|
||||
else
|
||||
returnString.append(String.format(Miscellaneous.getAnyContext().getString(R.string.profileNotActive), getTriggerParameter2().split(Trigger.triggerParameter2Split)[0]));
|
||||
break;
|
||||
case musicPlaying:
|
||||
if(triggerParameter)
|
||||
returnString.append(Miscellaneous.getAnyContext().getString(R.string.musicIsPlaying));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getString(R.string.musicIsNotPlaying));
|
||||
break;
|
||||
case screenState:
|
||||
String state;
|
||||
switch(triggerParameter2)
|
||||
{
|
||||
case "0":
|
||||
state = Miscellaneous.getAnyContext().getString(R.string.off);
|
||||
break;
|
||||
case "1":
|
||||
state = Miscellaneous.getAnyContext().getString(R.string.on);
|
||||
break;
|
||||
case "2":
|
||||
state = Miscellaneous.getAnyContext().getString(R.string.unlocked);
|
||||
break;
|
||||
case "3":
|
||||
state = Miscellaneous.getAnyContext().getString(R.string.lockedWithoutSecurity);
|
||||
break;
|
||||
case "4":
|
||||
state = Miscellaneous.getAnyContext().getString(R.string.lockedWithSecurity);
|
||||
break;
|
||||
default:
|
||||
state = Miscellaneous.getAnyContext().getString(R.string.unknown);
|
||||
}
|
||||
returnString.append(String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.screenIs), state));
|
||||
break;
|
||||
case deviceStarts:
|
||||
// This type doesn't have an activate/deactivate equivalent
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.deviceIsStarting) + ": " + String.valueOf(triggerParameter));
|
||||
break;
|
||||
case serviceStarts:
|
||||
// This type doesn't have an activate/deactivate equivalent
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.serviceIsStarting) + ": " + String.valueOf(triggerParameter));
|
||||
break;
|
||||
case broadcastReceived:
|
||||
if(triggerParameter)
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.broadcastReceived));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.broadcastNotReceived));
|
||||
|
||||
returnString.append(": " + triggerParameter2);
|
||||
break;
|
||||
case tethering:
|
||||
if(triggerParameter)
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.tetheringActive));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.tetheringNotActive));
|
||||
|
||||
returnString.append(" (" + Miscellaneous.getAnyContext().getResources().getString(R.string.type) + ": " + triggerParameter2 + ")");
|
||||
break;
|
||||
case subSystemState:
|
||||
Trigger.subSystemStates desiredState = subSystemStates.valueOf(triggerParameter2);
|
||||
switch(desiredState)
|
||||
{
|
||||
case wifi:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.wifi));
|
||||
break;
|
||||
case bluetooth:
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.bluetooth));
|
||||
break;
|
||||
}
|
||||
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.is) + " ");
|
||||
|
||||
if(triggerParameter)
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.activated));
|
||||
else
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.deactivated));
|
||||
break;
|
||||
default:
|
||||
returnString.append("error");
|
||||
break;
|
||||
@ -1508,6 +1751,7 @@ public class Trigger
|
||||
|
||||
public static final String directionEquals = "eq";
|
||||
public static final String directionContains = "ct";
|
||||
public static final String directionNotContains = "nc";
|
||||
public static final String directionStartsWith = "sw";
|
||||
public static final String directionEndsWith = "ew";
|
||||
public static final String directionNotEquals = "ne";
|
||||
@ -1520,6 +1764,8 @@ public class Trigger
|
||||
return Miscellaneous.getAnyContext().getString(R.string.directionStringEquals);
|
||||
case directionContains:
|
||||
return Miscellaneous.getAnyContext().getString(R.string.directionStringContains);
|
||||
case directionNotContains:
|
||||
return Miscellaneous.getAnyContext().getString(R.string.directionStringDoesNotContain);
|
||||
case directionStartsWith:
|
||||
return Miscellaneous.getAnyContext().getString(R.string.directionStringStartsWith);
|
||||
case directionEndsWith:
|
||||
@ -1537,6 +1783,8 @@ public class Trigger
|
||||
return directionEquals;
|
||||
else if(direction.equalsIgnoreCase(Miscellaneous.getAnyContext().getString(R.string.directionStringContains)))
|
||||
return directionContains;
|
||||
else if(direction.equalsIgnoreCase(Miscellaneous.getAnyContext().getString(R.string.directionStringDoesNotContain)))
|
||||
return directionNotContains;
|
||||
else if(direction.equalsIgnoreCase(Miscellaneous.getAnyContext().getString(R.string.directionStringStartsWith)))
|
||||
return directionStartsWith;
|
||||
else if(direction.equalsIgnoreCase(Miscellaneous.getAnyContext().getString(R.string.directionStringEndsWith)))
|
||||
@ -1550,11 +1798,7 @@ public class Trigger
|
||||
public static String[] getTriggerTypesAsArray()
|
||||
{
|
||||
ArrayList<String> triggerTypesList = new ArrayList<String>();
|
||||
|
||||
/*for(int i=0; i<Trigger_Enum.values().length; i++)
|
||||
{
|
||||
triggerTypesList.add(Trigger_Enum.values()[i].toString());
|
||||
}*/
|
||||
|
||||
for(Trigger_Enum triggerType : Trigger_Enum.values())
|
||||
triggerTypesList.add(triggerType.name());
|
||||
|
||||
@ -1565,11 +1809,7 @@ public class Trigger
|
||||
public static String[] getTriggerTypesStringAsArray(Context context)
|
||||
{
|
||||
ArrayList<String> triggerTypesList = new ArrayList<String>();
|
||||
|
||||
/*for(int i=0; i<Trigger_Enum.values().length; i++)
|
||||
{
|
||||
triggerTypesList.add(Trigger_Enum.values()[i].getFullName(context));
|
||||
}*/
|
||||
|
||||
for(Trigger_Enum triggerType : Trigger_Enum.values())
|
||||
triggerTypesList.add(triggerType.getFullName(context));
|
||||
|
||||
|
@ -254,8 +254,6 @@ public class XmlFileInterface
|
||||
else
|
||||
serializer.text("null");
|
||||
}
|
||||
else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.timeFrame)
|
||||
serializer.text(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTimeFrame().toString());
|
||||
else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.speed)
|
||||
serializer.text(String.valueOf(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getSpeed()));
|
||||
else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.noiseLevel)
|
||||
@ -263,11 +261,9 @@ public class XmlFileInterface
|
||||
else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.wifiConnection)
|
||||
serializer.text(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerParameter2());
|
||||
else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.process_started_stopped)
|
||||
serializer.text(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getProcessName());
|
||||
serializer.text(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerParameter2());
|
||||
else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.batteryLevel)
|
||||
serializer.text(String.valueOf(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getBatteryLevel()));
|
||||
// else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.phoneCall)
|
||||
// serializer.text(String.valueOf(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getPhoneDirection()) + "," + String.valueOf(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getPhoneNumber()));
|
||||
else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.nfcTag)
|
||||
serializer.text(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getNfcTagId());
|
||||
else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.activityDetection)
|
||||
@ -840,7 +836,6 @@ public class XmlFileInterface
|
||||
|
||||
private static Trigger readTrigger(XmlPullParser parser) throws IOException, XmlPullParserException
|
||||
{
|
||||
|
||||
/* FILE EXAMPE:
|
||||
* *****************
|
||||
* <Automation>
|
||||
@ -943,8 +938,16 @@ public class XmlFileInterface
|
||||
}
|
||||
else if(newTrigger.getTriggerType() == Trigger_Enum.process_started_stopped)
|
||||
{
|
||||
newTrigger.setProcessName(triggerParameter2);
|
||||
newTrigger.setTriggerParameter2(triggerParameter2);
|
||||
|
||||
if(triggerParameter2.contains(triggerParameter2Split))
|
||||
{
|
||||
String[] parts = triggerParameter2.split(triggerParameter2Split);
|
||||
newTrigger.setProcessName(parts[1]);
|
||||
}
|
||||
else
|
||||
newTrigger.setProcessName(triggerParameter2);
|
||||
|
||||
}
|
||||
else if(newTrigger.getTriggerType() == Trigger_Enum.phoneCall)
|
||||
{
|
||||
@ -1154,12 +1157,17 @@ public class XmlFileInterface
|
||||
newAction.setAction(Action_Enum.disableScreenRotation);
|
||||
else if(actionNameString.equals("disableScreenRotation"))
|
||||
newAction.setAction(Action_Enum.disableScreenRotation);
|
||||
else if(actionNameString.equals("playMusic"))
|
||||
{
|
||||
newAction.setAction(Action_Enum.controlMediaPlayback);
|
||||
newAction.setParameter2("1");
|
||||
}
|
||||
else if(actionNameString.equals("wakeupDevice"))
|
||||
{
|
||||
newAction.setAction(Action_Enum.turnScreenOnOrOff);
|
||||
newAction.setParameter1(true);
|
||||
}
|
||||
// *** deprecated
|
||||
// *** :deprecated
|
||||
|
||||
else
|
||||
newAction.setAction(Action_Enum.valueOf(actionNameString));
|
||||
@ -1273,14 +1281,14 @@ public class XmlFileInterface
|
||||
{
|
||||
String newTag;
|
||||
|
||||
if(tag.contains(Action.intentPairSeperator)) // already has new format
|
||||
if(tag.contains(Action.intentPairSeparator)) // already has new format
|
||||
newTag = tag;
|
||||
else
|
||||
newTag = tag.replace("/", Action.intentPairSeperator);
|
||||
newTag = tag.replace("/", Action.intentPairSeparator);
|
||||
|
||||
String[] newTagPieces = newTag.split(";");
|
||||
|
||||
if(newTagPieces.length < 2 || (!newTagPieces[0].contains(Actions.dummyPackageString) && newTagPieces[1].contains(Action.intentPairSeperator)))
|
||||
if(newTagPieces.length < 2 || (!newTagPieces[0].contains(Actions.dummyPackageString) && newTagPieces[1].contains(Action.intentPairSeparator)))
|
||||
{
|
||||
newTag = Actions.dummyPackageString + ";" + newTag;
|
||||
newTagPieces = newTag.split(";");
|
||||
@ -1290,7 +1298,7 @@ public class XmlFileInterface
|
||||
newTag += ";" + ActivityManageActionStartActivity.startByActivityString;
|
||||
else if(newTagPieces.length >= 3)
|
||||
{
|
||||
if(newTagPieces[2].contains(Action.intentPairSeperator))
|
||||
if(newTagPieces[2].contains(Action.intentPairSeparator))
|
||||
newTag = newTagPieces[0] + ";" + newTagPieces[1] + ";" + ActivityManageActionStartActivity.startByActivityString + ";" + newTagPieces[2];
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ import android.location.LocationManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.jens.automation2.ActivityMainScreen;
|
||||
@ -162,7 +161,7 @@ public class LocationProvider
|
||||
(
|
||||
(locationList.get(i).getProvider().equals(LocationManager.GPS_PROVIDER) && locationList.get(i).getAccuracy() > Settings.satisfactoryAccuracyGps)
|
||||
||
|
||||
(locationList.get(i).getProvider().equals(LocationManager.NETWORK_PROVIDER) && locationList.get(i).getAccuracy() > Settings.satisfactoryAccuracyNetwork)
|
||||
(locationList.get(i).getProvider().equals(LocationManager.NETWORK_PROVIDER) && locationList.get(i).getAccuracy() > Settings.satisfactoryAccuracyNetwork)
|
||||
)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Speed", "Not using 2 most recent locations for speed calculation because at least one does not have a satisfactory accuracy: " + locationList.get(i).toString(), 4);
|
||||
@ -189,7 +188,7 @@ public class LocationProvider
|
||||
/*
|
||||
Due to strange factors the time difference might be 0 resulting in mathematical error.
|
||||
*/
|
||||
if (Double.isInfinite(currentSpeed) | Double.isNaN(currentSpeed))
|
||||
if (Double.isInfinite(currentSpeed) || Double.isNaN(currentSpeed))
|
||||
Miscellaneous.logEvent("i", "Speed", "Error while calculating speed.", 4);
|
||||
else
|
||||
{
|
||||
@ -232,12 +231,6 @@ public class LocationProvider
|
||||
|
||||
public void startLocationService()
|
||||
{
|
||||
// if(Settings.useAccelerometerForPositioning && !Miscellaneous.isAndroidEmulator())
|
||||
// {
|
||||
// accelerometerHandler = new AccelerometerHandler();
|
||||
// mySensorActivity = new SensorActivity(this);
|
||||
// }
|
||||
|
||||
// startPhoneStateListener
|
||||
PhoneStatusListener.startPhoneStatusListener(parentService); // also used to mute anouncements during calls
|
||||
|
||||
@ -246,10 +239,8 @@ public class LocationProvider
|
||||
|
||||
if(Settings.positioningEngine == 0)
|
||||
{
|
||||
if(Rule.isAnyRuleUsing(Trigger_Enum.pointOfInterest) | Rule.isAnyRuleUsing(Trigger_Enum.speed))
|
||||
if(Rule.isAnyRuleUsing(Trigger_Enum.pointOfInterest) || Rule.isAnyRuleUsing(Trigger_Enum.speed))
|
||||
{
|
||||
// TelephonyManager telephonyManager = (TelephonyManager) AutomationService.getInstance().getSystemService(Context.TELEPHONY_SERVICE);
|
||||
|
||||
// startCellLocationChangedReceiver
|
||||
if (CellLocationChangedReceiver.isCellLocationChangedReceiverPossible())
|
||||
{
|
||||
@ -432,7 +423,7 @@ public class LocationProvider
|
||||
}
|
||||
|
||||
// *********** RULE CHANGES ***********
|
||||
if(!CellLocationChangedReceiver.isCellLocationListenerActive() && (Rule.isAnyRuleUsing(Trigger_Enum.pointOfInterest) | Rule.isAnyRuleUsing(Trigger_Enum.speed)))
|
||||
if(!CellLocationChangedReceiver.isCellLocationListenerActive() && (Rule.isAnyRuleUsing(Trigger_Enum.pointOfInterest) || Rule.isAnyRuleUsing(Trigger_Enum.speed)))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "LocationProvider", "Starting NoiseListener CellLocationChangedReceiver because used in a new/changed rule.", 4);
|
||||
if(CellLocationChangedReceiver.haveAllPermission())
|
||||
@ -493,7 +484,6 @@ public class LocationProvider
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void resetSpeedTimer(Calendar timeOfForcedLocationCheck)
|
||||
{
|
||||
if(speedTimerActive)
|
||||
@ -514,7 +504,6 @@ public class LocationProvider
|
||||
Message msg = new Message();
|
||||
msg.what = 1;
|
||||
speedHandler.sendMessageAtTime(msg, timeOfForcedLocationCheck.getTimeInMillis());
|
||||
// speedHandler.sendMessageDelayed(msg, delayTime);
|
||||
speedTimerActive = true;
|
||||
}
|
||||
else
|
||||
@ -531,7 +520,7 @@ public class LocationProvider
|
||||
if(msg.what == 1)
|
||||
{
|
||||
// time is up, no cell location updates since x minutes, start accelerometer
|
||||
String text = "Timer triggered. Based on the last location and speed we may be at a POI. Forcing location update in case CellLocationChangedReceiver didn\'t fire.";
|
||||
Miscellaneous.logEvent("i", "LocationProvider", "Timer triggered. Based on the last location and speed we may be at a POI. Forcing location update in case CellLocationChangedReceiver didn\'t fire.", 5);
|
||||
|
||||
Location currentLocation = CellLocationChangedReceiver.getInstance().getLocation("coarse");
|
||||
AutomationService.getInstance().getLocationProvider().setCurrentLocation(currentLocation, false);
|
||||
|
@ -26,7 +26,7 @@ public class WifiBroadcastReceiver extends BroadcastReceiver
|
||||
public static Boolean wasConnected = false;
|
||||
protected static String lastWifiSsid = "";
|
||||
public static boolean lastConnectedState = false;
|
||||
protected static boolean mayCellLocationChangedReceiverBeActivatedFromWifiPointOfWifi = true;
|
||||
protected static boolean mayCellLocationChangedReceiverBeActivatedFromWifiPointOfView = true;
|
||||
protected static WifiBroadcastReceiver wifiBrInstance;
|
||||
protected static IntentFilter wifiListenerIntentFilter;
|
||||
protected static boolean wifiListenerActive=false;
|
||||
@ -40,8 +40,9 @@ public class WifiBroadcastReceiver extends BroadcastReceiver
|
||||
{
|
||||
if(newWifiSsid.startsWith("\"") && newWifiSsid.endsWith("\""))
|
||||
newWifiSsid = newWifiSsid.substring(1, newWifiSsid.length()-1);
|
||||
|
||||
WifiBroadcastReceiver.lastWifiSsid = newWifiSsid;
|
||||
|
||||
if(newWifiSsid.length() > 0)
|
||||
WifiBroadcastReceiver.lastWifiSsid = newWifiSsid;
|
||||
}
|
||||
|
||||
public static boolean isWifiListenerActive()
|
||||
@ -51,7 +52,7 @@ public class WifiBroadcastReceiver extends BroadcastReceiver
|
||||
|
||||
public static boolean mayCellLocationReceiverBeActivated()
|
||||
{
|
||||
return mayCellLocationChangedReceiverBeActivatedFromWifiPointOfWifi;
|
||||
return mayCellLocationChangedReceiverBeActivatedFromWifiPointOfView;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -62,18 +63,12 @@ public class WifiBroadcastReceiver extends BroadcastReceiver
|
||||
// int state = -1;
|
||||
NetworkInfo myWifi = null;
|
||||
|
||||
// if(intent.getAction().equals(WifiManager.RSSI_CHANGED_ACTION)) //gefeuert bei Verbindung
|
||||
// {
|
||||
// Miscellaneous.logEvent("i", "WifiReceiver", "RSSI_CHANGED_ACTION: " + String.valueOf(intent.getIntExtra(WifiManager.RSSI_CHANGED_ACTION, -1)));
|
||||
// }
|
||||
// else
|
||||
if(intent.getAction().equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) //gefeuert bei Trennung
|
||||
if(intent.getAction().equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) // fired upon disconnection
|
||||
{
|
||||
// state = intent.getIntExtra(WifiManager.NETWORK_STATE_CHANGED_ACTION, -1);
|
||||
// Miscellaneous.logEvent("i", "WifiReceiver", "NETWORK_STATE_CHANGED_ACTION: " + String.valueOf(state));
|
||||
myWifi = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
|
||||
}
|
||||
|
||||
|
||||
WifiManager myWifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
|
||||
// ConnectivityManager connManager = (ConnectivityManager)context.getSystemService(context.CONNECTIVITY_SERVICE);
|
||||
@ -94,8 +89,14 @@ public class WifiBroadcastReceiver extends BroadcastReceiver
|
||||
if(Settings.useWifiForPositioning && PointOfInterest.reachedPoiWithActivateWifiRule()) // Poi has wifi
|
||||
{
|
||||
Miscellaneous.logEvent("i", "WifiReceiver", context.getResources().getString(R.string.poiHasWifiStoppingCellLocationListener), 2);
|
||||
mayCellLocationChangedReceiverBeActivatedFromWifiPointOfWifi = false;
|
||||
mayCellLocationChangedReceiverBeActivatedFromWifiPointOfView = false;
|
||||
CellLocationChangedReceiver.stopCellLocationChangedReceiver();
|
||||
|
||||
/*
|
||||
TODO: Every time the screen is turned on, we receiver a "wifi has been connected"-event.
|
||||
This is technically wrong and not really any changed to when the screen was off. It has
|
||||
to be filtered.
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -109,7 +110,7 @@ public class WifiBroadcastReceiver extends BroadcastReceiver
|
||||
{
|
||||
wasConnected = true;
|
||||
Miscellaneous.logEvent("i", "WifiReceiver", "WifiReceiver just activated. Wifi already connected. Stopping CellLocationReceiver", 3);
|
||||
mayCellLocationChangedReceiverBeActivatedFromWifiPointOfWifi = false;
|
||||
mayCellLocationChangedReceiverBeActivatedFromWifiPointOfView = false;
|
||||
CellLocationChangedReceiver.stopCellLocationChangedReceiver();
|
||||
SensorActivity.stopAccelerometerTimer();
|
||||
String ssid = myWifiManager.getConnectionInfo().getSSID();
|
||||
@ -125,7 +126,7 @@ public class WifiBroadcastReceiver extends BroadcastReceiver
|
||||
{
|
||||
wasConnected = false;
|
||||
Miscellaneous.logEvent("i", "WifiReceiver", String.format(context.getResources().getString(R.string.disconnectedFromWifi), getLastWifiSsid()) + " Switching to CellLocationChangedReceiver.", 3);
|
||||
mayCellLocationChangedReceiverBeActivatedFromWifiPointOfWifi = true;
|
||||
mayCellLocationChangedReceiverBeActivatedFromWifiPointOfView = true;
|
||||
CellLocationChangedReceiver.startCellLocationChangedReceiver();
|
||||
lastConnectedState = false;
|
||||
findRules(AutomationService.getInstance());
|
||||
|
@ -99,54 +99,48 @@ public class BatteryReceiver extends BroadcastReceiver implements AutomationList
|
||||
|
||||
if(intent.getAction().equals(Intent.ACTION_BATTERY_LOW))
|
||||
{
|
||||
Log.i("Battery", "Low battery event");
|
||||
Miscellaneous.logEvent("i", "Battery", "Low battery event", 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
// Miscellaneous.logEvent("i", "BatteryReceiver", "Received battery event.");
|
||||
// if(intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED))
|
||||
// {
|
||||
batteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
|
||||
// int scale = -1;
|
||||
// int voltage = -1;
|
||||
// int temp = -1;
|
||||
// scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
|
||||
// temp = intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, -1);
|
||||
// voltage = intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE, -1);
|
||||
Log.i("Battery", "Level: " + String.valueOf(batteryLevel));
|
||||
this.actionBatteryLevel(context);
|
||||
|
||||
int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
|
||||
int statusPlugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
|
||||
// Miscellaneous.logEvent("i", "BatteryReceiver", "Status: " + String.valueOf(statusPlugged));
|
||||
|
||||
switch(statusPlugged)
|
||||
{
|
||||
case BatteryManager.BATTERY_PLUGGED_AC:
|
||||
// Toast.makeText(context, "Regular charging", Toast.LENGTH_LONG).show();
|
||||
// Miscellaneous.logEvent("i", "BatteryReceiver", "Regular charging.");
|
||||
this.actionCharging(context);
|
||||
break;
|
||||
case BatteryManager.BATTERY_PLUGGED_USB:
|
||||
this.actionUsbConnected(context);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(status)
|
||||
{
|
||||
// case BatteryManager.BATTERY_STATUS_CHARGING:
|
||||
// break;
|
||||
case BatteryManager.BATTERY_STATUS_FULL:
|
||||
// Toast.makeText(context, "Regular charging full", Toast.LENGTH_LONG).show();
|
||||
// Miscellaneous.logEvent("i", "BatteryReceiver", "Device has been fully charged.");
|
||||
this.actionCharging(context);
|
||||
break;
|
||||
case BatteryManager.BATTERY_STATUS_DISCHARGING:
|
||||
this.actionDischarging(context);
|
||||
break;
|
||||
}
|
||||
batteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
|
||||
// int scale = -1;
|
||||
// int voltage = -1;
|
||||
// int temp = -1;
|
||||
// scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
|
||||
// temp = intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, -1);
|
||||
// voltage = intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE, -1);
|
||||
Log.i("Battery", "Level: " + String.valueOf(batteryLevel));
|
||||
this.actionBatteryLevel(context);
|
||||
|
||||
int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
|
||||
int statusPlugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
|
||||
Miscellaneous.logEvent("i", "BatteryReceiver", "Status: " + String.valueOf(statusPlugged), 5);
|
||||
|
||||
switch(statusPlugged)
|
||||
{
|
||||
case BatteryManager.BATTERY_PLUGGED_AC:
|
||||
// Toast.makeText(context, "Regular charging", Toast.LENGTH_LONG).show();
|
||||
Miscellaneous.logEvent("i", "BatteryReceiver", "Regular charging.", 5);
|
||||
this.actionCharging(context);
|
||||
break;
|
||||
case BatteryManager.BATTERY_PLUGGED_USB:
|
||||
this.actionUsbConnected(context);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(status)
|
||||
{
|
||||
case BatteryManager.BATTERY_STATUS_FULL:
|
||||
Miscellaneous.logEvent("i", "BatteryReceiver", "Device has been fully charged.", 5);
|
||||
this.actionCharging(context);
|
||||
break;
|
||||
case BatteryManager.BATTERY_STATUS_DISCHARGING:
|
||||
this.actionDischarging(context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
@ -264,11 +258,13 @@ public class BatteryReceiver extends BroadcastReceiver implements AutomationList
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startListener(AutomationService automationService)
|
||||
{
|
||||
BatteryReceiver.startBatteryReceiver(automationService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopListener(AutomationService automationService)
|
||||
{
|
||||
@ -292,4 +288,4 @@ public class BatteryReceiver extends BroadcastReceiver implements AutomationList
|
||||
// actually monitores several
|
||||
return new Trigger_Enum[] { Trigger_Enum.batteryLevel, Trigger_Enum.charging, Trigger_Enum.usb_host_connection };
|
||||
}
|
||||
}
|
||||
}
|
@ -300,4 +300,16 @@ public class BluetoothReceiver extends BroadcastReceiver implements AutomationLi
|
||||
{
|
||||
return new Trigger_Enum[] { Trigger_Enum.bluetoothConnection };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for Bluetooth.
|
||||
*
|
||||
* @return true if Bluetooth is available.
|
||||
*/
|
||||
public static boolean isBluetoothEnabled()
|
||||
{
|
||||
final BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
|
||||
return bluetoothAdapter != null && bluetoothAdapter.isEnabled() && bluetoothAdapter.getState() == BluetoothAdapter.STATE_ON;
|
||||
}
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.jens.automation2.ActivityPermissions;
|
||||
import com.jens.automation2.AutomationService;
|
||||
import com.jens.automation2.Miscellaneous;
|
||||
import com.jens.automation2.Rule;
|
||||
import com.jens.automation2.Trigger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
public class BroadcastListener extends android.content.BroadcastReceiver implements AutomationListenerInterface
|
||||
{
|
||||
ArrayList<EventOccurrence> broadcastsCollection = new ArrayList<>();
|
||||
public static AutomationService automationServiceRef = null;
|
||||
private static boolean broadcastReceiverActive = false;
|
||||
private static BroadcastListener broadcastReceiverInstance = null;
|
||||
private static IntentFilter broadcastIntentFilter = null;
|
||||
private static Intent broadcastStatus = null;
|
||||
|
||||
public static BroadcastListener getInstance()
|
||||
{
|
||||
if(broadcastReceiverInstance == null)
|
||||
broadcastReceiverInstance = new BroadcastListener();
|
||||
|
||||
return broadcastReceiverInstance;
|
||||
}
|
||||
|
||||
public static class EventOccurrence
|
||||
{
|
||||
Calendar time;
|
||||
String event;
|
||||
|
||||
public EventOccurrence(Calendar time, String event)
|
||||
{
|
||||
this.time = time;
|
||||
this.event = event;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
broadcastsCollection.add(new EventOccurrence(Calendar.getInstance(), intent.getAction()));
|
||||
|
||||
for(String key : intent.getExtras().keySet())
|
||||
{
|
||||
Miscellaneous.logEvent("i", "Broadcast extra", "Broadcast " + intent.getAction() + " has extra " + key + " and type " + intent.getExtras().get(key).getClass().getName(), 4);
|
||||
}
|
||||
|
||||
ArrayList<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger.Trigger_Enum.broadcastReceived);
|
||||
for(int i=0; i<ruleCandidates.size(); i++)
|
||||
{
|
||||
if(ruleCandidates.get(i).getsGreenLight(context))
|
||||
ruleCandidates.get(i).activate(automationServiceRef, false);
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<EventOccurrence> getBroadcastsCollection()
|
||||
{
|
||||
return broadcastsCollection;
|
||||
}
|
||||
|
||||
public boolean hasBroadcastOccurred(String event)
|
||||
{
|
||||
for(EventOccurrence eo : broadcastsCollection)
|
||||
{
|
||||
if(eo.event.equalsIgnoreCase(event))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasBroadcastOccurredSince(String event, Calendar timeLimit)
|
||||
{
|
||||
for(EventOccurrence eo : broadcastsCollection)
|
||||
{
|
||||
if(eo.event.equalsIgnoreCase(event) && (timeLimit == null || eo.time.getTimeInMillis() > timeLimit.getTimeInMillis()))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startListener(AutomationService automationService)
|
||||
{
|
||||
if(!broadcastReceiverActive)
|
||||
{
|
||||
BroadcastListener.automationServiceRef = automationService;
|
||||
|
||||
if(broadcastReceiverInstance == null)
|
||||
broadcastReceiverInstance = new BroadcastListener();
|
||||
|
||||
if(broadcastIntentFilter == null)
|
||||
{
|
||||
broadcastIntentFilter = new IntentFilter();
|
||||
|
||||
List<String> actionList = new ArrayList<>();
|
||||
ArrayList<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger.Trigger_Enum.broadcastReceived);
|
||||
for(int i=0; i<ruleCandidates.size(); i++)
|
||||
{
|
||||
for(Trigger t : ruleCandidates.get(i).getTriggerSet())
|
||||
{
|
||||
if(t.getTriggerType().equals(Trigger.Trigger_Enum.broadcastReceived))
|
||||
{
|
||||
ActivityPermissions.addToArrayListUnique(t.getTriggerParameter2(), actionList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(String s : actionList)
|
||||
broadcastIntentFilter.addAction(s);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
broadcastStatus = automationServiceRef.registerReceiver(broadcastReceiverInstance, broadcastIntentFilter);
|
||||
broadcastReceiverActive = true;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
/*
|
||||
We might be confronted with permission issues here.
|
||||
*/
|
||||
Miscellaneous.logEvent("e", "BroadcastListener", Log.getStackTraceString(e), 1);
|
||||
broadcastReceiverActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopListener(AutomationService automationService)
|
||||
{
|
||||
if(broadcastReceiverActive)
|
||||
{
|
||||
if(broadcastReceiverInstance != null)
|
||||
{
|
||||
automationServiceRef.unregisterReceiver(broadcastReceiverInstance);
|
||||
broadcastReceiverInstance = null;
|
||||
}
|
||||
|
||||
broadcastReceiverActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isListenerRunning()
|
||||
{
|
||||
return broadcastReceiverActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Trigger.Trigger_Enum[] getMonitoredTrigger()
|
||||
{
|
||||
return new Trigger.Trigger_Enum[] { Trigger.Trigger_Enum.broadcastReceived };
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ import com.jens.automation2.AutomationService;
|
||||
import com.jens.automation2.Miscellaneous;
|
||||
import com.jens.automation2.Rule;
|
||||
import com.jens.automation2.TimeFrame;
|
||||
import com.jens.automation2.TimeObject;
|
||||
import com.jens.automation2.Trigger;
|
||||
import com.jens.automation2.Trigger.Trigger_Enum;
|
||||
|
||||
@ -27,12 +28,10 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
{
|
||||
private static AutomationService automationServiceRef;
|
||||
private static AlarmManager centralAlarmManagerInstance;
|
||||
// private static Intent alarmIntent;
|
||||
// private static PendingIntent alarmPendingIntent;
|
||||
private static boolean alarmListenerActive=false;
|
||||
private static ArrayList<ScheduleElement> alarmCandidates = new ArrayList<>();
|
||||
|
||||
private static ArrayList<Integer> requestCodeList = new ArrayList<Integer>();
|
||||
static PendingIntent alarmPendingIntent = null;
|
||||
|
||||
public static void startAlarmListener(final AutomationService automationServiceRef)
|
||||
{
|
||||
@ -52,13 +51,9 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "AlarmListener", "Alarm received", 2);
|
||||
Date now = new Date();
|
||||
String timeString = String.valueOf(now.getHours()) + ":" + String.valueOf(now.getMinutes()) + ":" + String.valueOf(now.getSeconds());
|
||||
Time passTime = Time.valueOf(timeString);
|
||||
|
||||
ArrayList<Rule> allRulesWithNowInTimeFrame = Rule.findRuleCandidates(Trigger_Enum.timeFrame);
|
||||
// ArrayList<Rule> allRulesWithNowInTimeFrame = Rule.findRuleCandidatesByTime(passTime);
|
||||
for(int i=0; i<allRulesWithNowInTimeFrame.size(); i++)
|
||||
for(int i=0; i < allRulesWithNowInTimeFrame.size(); i++)
|
||||
{
|
||||
if(allRulesWithNowInTimeFrame.get(i).getsGreenLight(context))
|
||||
allRulesWithNowInTimeFrame.get(i).activate(automationServiceRef, false);
|
||||
@ -77,23 +72,7 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
|
||||
clearAlarms();
|
||||
|
||||
int i=0;
|
||||
|
||||
// // get a Calendar object with current time
|
||||
// Calendar cal = Calendar.getInstance();
|
||||
// // add 5 minutes to the calendar object
|
||||
// cal.add(Calendar.SECOND, 10);
|
||||
// String calSetWorkingCopyString2 = null;
|
||||
// SimpleDateFormat sdf2 = new SimpleDateFormat("E dd.MM.yyyy HH:mm");
|
||||
// if (cal != null)
|
||||
// {
|
||||
// calSetWorkingCopyString2 = sdf2.format(cal.getTime());
|
||||
// }
|
||||
// Miscellaneous.logEvent("i", "AlarmManager", "Setting repeating alarm because of hardcoded test: beginning at " + calSetWorkingCopyString2);
|
||||
// Intent alarmIntent2 = new Intent(automationServiceRef, AlarmListener.class);
|
||||
// PendingIntent alarmPendingIntent2 = PendingIntent.getBroadcast(automationServiceRef, 0, alarmIntent2, 0);
|
||||
// centralAlarmManagerInstance.setInexactRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 5000, alarmPendingIntent2);
|
||||
// requestCodeList.add(0);
|
||||
int i=0;
|
||||
|
||||
ArrayList<Rule> allRulesWithTimeFrames = new ArrayList<Rule>();
|
||||
allRulesWithTimeFrames = Rule.findRuleCandidates(Trigger_Enum.timeFrame);
|
||||
@ -118,7 +97,7 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
TimeFrame tf = new TimeFrame(oneTrigger.getTriggerParameter2());
|
||||
|
||||
Calendar calSet;
|
||||
Time setTime;
|
||||
TimeObject setTime;
|
||||
|
||||
if(oneTrigger.getTriggerParameter())
|
||||
setTime = tf.getTriggerTimeStart();
|
||||
@ -161,7 +140,7 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
}
|
||||
|
||||
i++;
|
||||
i=(int)System.currentTimeMillis();
|
||||
i = (int)System.currentTimeMillis();
|
||||
sdf.format(calSetWorkingCopy.getTime());
|
||||
String.valueOf(i);
|
||||
|
||||
@ -264,11 +243,10 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
}
|
||||
|
||||
Intent alarmIntent = new Intent(automationServiceRef, DateTimeListener.class);
|
||||
PendingIntent alarmPendingIntent = PendingIntent.getBroadcast(automationServiceRef, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
alarmPendingIntent = PendingIntent.getBroadcast(automationServiceRef, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
centralAlarmManagerInstance.set(AlarmManager.RTC_WAKEUP, scheduleCandidate.time.getTimeInMillis(), alarmPendingIntent);
|
||||
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("E dd.MM.yyyy HH:mm");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("E dd.MM.yyyy HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(scheduleCandidate.time.getTimeInMillis());
|
||||
Miscellaneous.logEvent("i", "AlarmManager", "Chose " + sdf.format(calendar.getTime()) + " as next scheduled alarm.", 4);
|
||||
@ -280,7 +258,8 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
for(int requestCode : requestCodeList)
|
||||
{
|
||||
Intent alarmIntent = new Intent(automationServiceRef, DateTimeListener.class);
|
||||
PendingIntent alarmPendingIntent = PendingIntent.getBroadcast(automationServiceRef, requestCode, alarmIntent, 0);
|
||||
if(alarmPendingIntent == null)
|
||||
alarmPendingIntent = PendingIntent.getBroadcast(automationServiceRef, requestCode, alarmIntent, 0);
|
||||
// Miscellaneous.logEvent("i", "AlarmManager", "Clearing alarm with request code: " + String.valueOf(requestCode));
|
||||
centralAlarmManagerInstance.cancel(alarmPendingIntent);
|
||||
}
|
||||
@ -316,7 +295,7 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
{
|
||||
Miscellaneous.logEvent("i", "AlarmListener", "Stopping alarm listener.", 4);
|
||||
clearAlarms();
|
||||
// centralAlarmManagerInstance.cancel(alarmPendingIntent);
|
||||
centralAlarmManagerInstance.cancel(alarmPendingIntent);
|
||||
alarmListenerActive = false;
|
||||
}
|
||||
else
|
||||
@ -387,7 +366,7 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
public static Calendar getNextRepeatedExecutionAfter(Trigger trigger, Calendar now)
|
||||
{
|
||||
Calendar calSet;
|
||||
Time setTime;
|
||||
TimeObject setTime;
|
||||
TimeFrame tf = new TimeFrame(trigger.getTriggerParameter2());
|
||||
|
||||
if(tf.getRepetition() > 0)
|
||||
@ -403,8 +382,6 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
calSet.set(Calendar.SECOND, 0);
|
||||
calSet.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
// if(this.applies(null))
|
||||
// {
|
||||
// If the starting time is a day ahead remove 1 day.
|
||||
if(calSet.getTimeInMillis() > now.getTimeInMillis())
|
||||
calSet.add(Calendar.DAY_OF_MONTH, -1);
|
||||
@ -419,11 +396,8 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
||||
* Das war mal aktiviert. Allerdings: Die ganze Funktion liefert zurück, wenn die Regel NOCH nicht
|
||||
* zutrifft, aber wir z.B. gleich den zeitlichen Bereich betreten.
|
||||
*/
|
||||
// if(trigger.checkDateTime(calSchedule.getTime(), false))
|
||||
// {
|
||||
|
||||
return calSchedule;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("i", "DateTimeListener", "Trigger " + trigger.toString() + " is not executed repeatedly.", 5);
|
||||
|
@ -34,17 +34,18 @@ public class DeviceOrientationListener implements SensorEventListener, Automatio
|
||||
static int sensorValueCounter = 0;
|
||||
|
||||
// Gravity rotational data
|
||||
private float gravity[];
|
||||
float gravity[];
|
||||
// Magnetic rotational data
|
||||
private float magnetic[]; //for magnetic rotational data
|
||||
private float accels[] = new float[3];
|
||||
private float mags[] = new float[3];
|
||||
private float[] values = new float[3];
|
||||
float magnetic[]; //for magnetic rotational data
|
||||
float accels[] = new float[3];
|
||||
float mags[] = new float[3];
|
||||
float[] values = new float[3];
|
||||
boolean hasMagneticSensor=false;
|
||||
|
||||
// azimuth, pitch and roll
|
||||
private float azimuth;
|
||||
private float pitch;
|
||||
private float roll;
|
||||
float azimuth;
|
||||
float pitch;
|
||||
float roll;
|
||||
|
||||
boolean applies = false;
|
||||
boolean flipped = false;
|
||||
@ -91,7 +92,7 @@ public class DeviceOrientationListener implements SensorEventListener, Automatio
|
||||
isRunning = true;
|
||||
|
||||
sManager.registerListener(this, sManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL);
|
||||
sManager.registerListener(this, sManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD), SensorManager.SENSOR_DELAY_NORMAL);
|
||||
hasMagneticSensor = sManager.registerListener(this, sManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD), SensorManager.SENSOR_DELAY_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,6 +130,9 @@ public class DeviceOrientationListener implements SensorEventListener, Automatio
|
||||
break;
|
||||
}
|
||||
|
||||
if (!hasMagneticSensor)
|
||||
mags=new float[]{1f,1f,1f};
|
||||
|
||||
if (mags != null && accels != null)
|
||||
{
|
||||
gravity = new float[9];
|
||||
|
@ -0,0 +1,105 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
|
||||
import com.jens.automation2.AutomationService;
|
||||
import com.jens.automation2.Miscellaneous;
|
||||
import com.jens.automation2.Rule;
|
||||
import com.jens.automation2.Settings;
|
||||
import com.jens.automation2.Trigger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
public class MediaPlayerListener implements AutomationListenerInterface
|
||||
{
|
||||
static MediaPlayerListener instance = null;
|
||||
static AudioManager mAudioManager = null;
|
||||
static boolean listenerActive = false;
|
||||
Timer timer = null;
|
||||
TimerTask task = null;
|
||||
|
||||
public static boolean isAudioPlaying(Context context)
|
||||
{
|
||||
if(mAudioManager == null)
|
||||
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||
|
||||
return mAudioManager.isMusicActive();
|
||||
}
|
||||
|
||||
public static MediaPlayerListener getInstance()
|
||||
{
|
||||
if(instance == null)
|
||||
instance = new MediaPlayerListener();
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startListener(AutomationService automationService)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "MediaPlayerListener", "Starting listener.",5);
|
||||
|
||||
if(!listenerActive)
|
||||
{
|
||||
if(timer == null)
|
||||
{
|
||||
timer = new Timer();
|
||||
}
|
||||
else
|
||||
{
|
||||
task.cancel();
|
||||
timer.purge();
|
||||
}
|
||||
|
||||
task = new TimerTask()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
synchronized(this)
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger.Trigger_Enum.musicPlaying);
|
||||
for (int i = 0; i < ruleCandidates.size(); i++)
|
||||
{
|
||||
if (ruleCandidates.get(i).getsGreenLight(AutomationService.getInstance()))
|
||||
ruleCandidates.get(i).activate(AutomationService.getInstance(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
timer.scheduleAtFixedRate(task, 0, Settings.musicCheckFrequency);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopListener(AutomationService automationService)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "MediaPlayerListener", "Stopping listener.",5);
|
||||
|
||||
if(listenerActive)
|
||||
{
|
||||
if (timer != null)
|
||||
{
|
||||
timer.cancel();
|
||||
timer.purge();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isListenerRunning()
|
||||
{
|
||||
return listenerActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Trigger.Trigger_Enum[] getMonitoredTrigger()
|
||||
{
|
||||
return new Trigger.Trigger_Enum[] { Trigger.Trigger_Enum.musicPlaying };
|
||||
}
|
||||
}
|
@ -216,23 +216,26 @@ public class NfcReceiver
|
||||
}
|
||||
|
||||
NdefMessage ndefMessage = ndef.getCachedNdefMessage();
|
||||
|
||||
NdefRecord[] records = ndefMessage.getRecords();
|
||||
for (NdefRecord ndefRecord : records)
|
||||
{
|
||||
if (ndefRecord.getTnf() == NdefRecord.TNF_WELL_KNOWN && Arrays.equals(ndefRecord.getType(), NdefRecord.RTD_TEXT))
|
||||
{
|
||||
try
|
||||
{
|
||||
return readText(ndefRecord);
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
Miscellaneous.logEvent("w", "NFC", "Unsupported Encoding: " + Log.getStackTraceString(e), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(ndefMessage != null)
|
||||
{
|
||||
NdefRecord[] records = ndefMessage.getRecords();
|
||||
for (NdefRecord ndefRecord : records)
|
||||
{
|
||||
if (ndefRecord.getTnf() == NdefRecord.TNF_WELL_KNOWN && Arrays.equals(ndefRecord.getType(), NdefRecord.RTD_TEXT))
|
||||
{
|
||||
try
|
||||
{
|
||||
return readText(ndefRecord);
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
Miscellaneous.logEvent("w", "NFC", "Unsupported Encoding: " + Log.getStackTraceString(e), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,16 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.service.notification.NotificationListenerService;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
@ -19,9 +26,10 @@ import java.util.Calendar;
|
||||
|
||||
@SuppressLint("OverrideAbstract")
|
||||
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||
public class NotificationListener extends NotificationListenerService
|
||||
public class NotificationListener extends NotificationListenerService// implements AutomationListenerInterface
|
||||
{
|
||||
static Calendar lastResponseToNotification = null;
|
||||
static boolean listenerRunning = false;
|
||||
static NotificationListener instance;
|
||||
static SimpleNotification lastNotification = null;
|
||||
|
||||
@ -37,6 +45,8 @@ public class NotificationListener extends NotificationListenerService
|
||||
// a bitmap to be used instead of the small icon when showing the notification payload
|
||||
public static final String EXTRA_LARGE_ICON = "android.largeIcon";
|
||||
|
||||
protected static IntentFilter notificationReceiverIntentFilter = null;
|
||||
|
||||
public static SimpleNotification getLastNotification()
|
||||
{
|
||||
return lastNotification;
|
||||
@ -78,16 +88,12 @@ public class NotificationListener extends NotificationListenerService
|
||||
{
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT)
|
||||
{
|
||||
String app = sbn.getPackageName();
|
||||
String title = sbn.getNotification().extras.getString(EXTRA_TITLE);
|
||||
String text = sbn.getNotification().extras.getString(EXTRA_TEXT);
|
||||
lastNotification = convertNotificationToSimpleNotification(created, sbn);
|
||||
|
||||
lastNotification = new SimpleNotification();
|
||||
lastNotification.publishTime = Miscellaneous.calendarFromLong(sbn.getPostTime());
|
||||
lastNotification.created = created;
|
||||
lastNotification.app = app;
|
||||
lastNotification.title = title;
|
||||
lastNotification.text = text;
|
||||
if(created)
|
||||
Miscellaneous.logEvent("i", "New notification", lastNotification.toString(), 5);
|
||||
else
|
||||
Miscellaneous.logEvent("i", "Notification removed", lastNotification.toString(), 5);
|
||||
|
||||
ArrayList<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger.Trigger_Enum.notification);
|
||||
for (int i = 0; i < ruleCandidates.size(); i++)
|
||||
@ -100,6 +106,50 @@ public class NotificationListener extends NotificationListenerService
|
||||
return false;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
public static SimpleNotification convertNotificationToSimpleNotification(boolean created, StatusBarNotification input)
|
||||
{
|
||||
String app = input.getPackageName();
|
||||
String title = "";
|
||||
String text = "";
|
||||
|
||||
Bundle extras = input.getNotification().extras;
|
||||
|
||||
try
|
||||
{
|
||||
if (extras.containsKey(EXTRA_TITLE))
|
||||
title = extras.getString(EXTRA_TITLE).toString();
|
||||
}
|
||||
catch (NullPointerException e)
|
||||
{
|
||||
// https://www.b4x.com/android/forum/threads/solved-reading-statusbarnotifications-extras.64416/
|
||||
// Some notifications have an empty title, like KDE connect
|
||||
if(extras.containsKey(EXTRA_TITLE) && extras.get(EXTRA_TITLE) != null)
|
||||
title = extras.get(EXTRA_TITLE).toString();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (extras.containsKey(EXTRA_TEXT))
|
||||
text = extras.getString(EXTRA_TEXT).toString();
|
||||
}
|
||||
catch (NullPointerException e)
|
||||
{
|
||||
// in stacked notifications the "surrounding" element has no text, only a title
|
||||
if (extras.containsKey(EXTRA_TEXT) && extras.get(EXTRA_TEXT) != null)
|
||||
text = extras.get(EXTRA_TEXT).toString();
|
||||
}
|
||||
|
||||
SimpleNotification returnNotification = new SimpleNotification();
|
||||
returnNotification.publishTime = Miscellaneous.calendarFromLong(input.getPostTime());
|
||||
returnNotification.created = created;
|
||||
returnNotification.app = app;
|
||||
returnNotification.title = title;
|
||||
returnNotification.text = text;
|
||||
|
||||
return returnNotification;
|
||||
}
|
||||
|
||||
public static class SimpleNotification
|
||||
{
|
||||
boolean created;
|
||||
@ -155,6 +205,18 @@ public class NotificationListener extends NotificationListenerService
|
||||
{
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SimpleNotification{" +
|
||||
"created=" + created +
|
||||
", publishTime=" + publishTime +
|
||||
", app='" + app + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", text='" + text + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -168,4 +230,44 @@ public class NotificationListener extends NotificationListenerService
|
||||
{
|
||||
super.onListenerDisconnected();
|
||||
}
|
||||
|
||||
public void dismissNotification(StatusBarNotification sbn)
|
||||
{
|
||||
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
|
||||
cancelNotification(sbn.getPackageName(), sbn.getTag(), sbn.getId());
|
||||
else
|
||||
cancelNotification(sbn.getKey());
|
||||
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
public void clickNotificationButton(StatusBarNotification sbn, String buttonText)
|
||||
{
|
||||
boolean buttonFound = false;
|
||||
|
||||
if(sbn.getNotification().actions != null)
|
||||
{
|
||||
for (Notification.Action a : sbn.getNotification().actions)
|
||||
{
|
||||
if((Miscellaneous.isRegularExpression(buttonText) && a.title.toString().matches(buttonText)) || a.title.toString().equalsIgnoreCase(buttonText))
|
||||
{
|
||||
if (!buttonFound)
|
||||
buttonFound = true;
|
||||
|
||||
try
|
||||
{
|
||||
Miscellaneous.logEvent("w", "clickNotificationButton()", "Pressing button with text \"" + a.title.toString() + "\".", 2);
|
||||
a.actionIntent.send();
|
||||
}
|
||||
catch (PendingIntent.CanceledException e)
|
||||
{
|
||||
Miscellaneous.logEvent("w", "clickNotificationButton()", Log.getStackTraceString(e), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!buttonFound)
|
||||
Miscellaneous.logEvent("w", "clickNotificationButton()", "Button with text \n" + buttonText + "\n could not found.", 2);
|
||||
}
|
||||
}
|
@ -22,8 +22,6 @@ import java.util.ArrayList;
|
||||
|
||||
public class PhoneStatusListener implements AutomationListenerInterface
|
||||
{
|
||||
// protected static int currentStateIncoming = -1;
|
||||
// protected static int currentStateOutgoing = -1;
|
||||
protected static String lastPhoneNumber="";
|
||||
protected static int lastPhoneDirection = -1; //0=incoming, 1=outgoing
|
||||
protected static int currentState = -1;
|
||||
@ -120,8 +118,6 @@ public class PhoneStatusListener implements AutomationListenerInterface
|
||||
}
|
||||
else
|
||||
{
|
||||
// state != TelephonyManager.CALL_STATE_IDLE &&
|
||||
|
||||
setCurrentState(state);
|
||||
setLastPhoneDirection(1);
|
||||
|
||||
@ -175,12 +171,12 @@ public class PhoneStatusListener implements AutomationListenerInterface
|
||||
Miscellaneous.logEvent("i", "Call state", String.format(Miscellaneous.getAnyContext().getResources().getString(R.string.outgoingCallTo), getLastPhoneNumber()), 4);
|
||||
|
||||
ArrayList<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger_Enum.phoneCall);
|
||||
for(int i=0; i<ruleCandidates.size(); i++)
|
||||
for(int i = 0; i < ruleCandidates.size(); i++)
|
||||
{
|
||||
AutomationService asInstance = AutomationService.getInstance();
|
||||
if(asInstance != null)
|
||||
if(ruleCandidates.get(i).getsGreenLight(asInstance))
|
||||
ruleCandidates.get(i).activate(asInstance, false);
|
||||
ruleCandidates.get(i).activate(asInstance, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -289,4 +285,4 @@ public class PhoneStatusListener implements AutomationListenerInterface
|
||||
{
|
||||
return new Trigger_Enum[] { Trigger_Enum.phoneCall };
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.ActivityManager.RunningAppProcessInfo;
|
||||
import android.app.ActivityManager.RunningServiceInfo;
|
||||
@ -8,6 +9,7 @@ import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.jens.automation2.Action;
|
||||
import com.jens.automation2.ActivityPermissions;
|
||||
import com.jens.automation2.AutomationService;
|
||||
import com.jens.automation2.Miscellaneous;
|
||||
@ -208,12 +210,12 @@ public class ProcessListener implements AutomationListenerInterface
|
||||
workHandler.sendMessage(answer);
|
||||
|
||||
//activate rule(s)
|
||||
/*ArrayList<Rule> ruleCandidates = Rule.findRuleCandidatesByProcess();
|
||||
ArrayList<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger_Enum.process_started_stopped);
|
||||
for(int i=0; i<ruleCandidates.size(); i++)
|
||||
{
|
||||
if(ruleCandidates.get(i).applies(automationService))
|
||||
ruleCandidates.get(i).activate(automationService);
|
||||
}*/
|
||||
if(ruleCandidates.get(i).getsGreenLight(automationService))
|
||||
ruleCandidates.get(i).activate(automationService, false);
|
||||
}
|
||||
|
||||
isMonitoringActive = false;
|
||||
|
||||
@ -231,6 +233,7 @@ public class ProcessListener implements AutomationListenerInterface
|
||||
|
||||
final ActivityManager activityManager = (ActivityManager)automationService.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
final List<RunningTaskInfo> services = activityManager.getRunningTasks(Integer.MAX_VALUE);
|
||||
final List<RunningAppProcessInfo> apps = activityManager.getRunningAppProcesses();
|
||||
|
||||
ArrayList<String> runningAppsListReference;
|
||||
if(lastWritten == 1)
|
||||
@ -246,32 +249,23 @@ public class ProcessListener implements AutomationListenerInterface
|
||||
|
||||
runningAppsListReference.clear();
|
||||
|
||||
for (int i = 0; i < services.size(); i++)
|
||||
/*for (int i = 0; i < services.size(); i++)
|
||||
{
|
||||
if(!runningAppsListReference.contains(services.get(i).baseActivity.getClassName()))
|
||||
{
|
||||
// you may broadcast a new application launch here.
|
||||
runningAppsListReference.add(services.get(i).baseActivity.getClassName());
|
||||
}
|
||||
}
|
||||
}*/
|
||||
for (int i = 0; i < apps.size(); i++)
|
||||
{
|
||||
if(!runningAppsListReference.contains(apps.get(i).processName))
|
||||
{
|
||||
// you may broadcast a new application launch here.
|
||||
runningAppsListReference.add(apps.get(i).processName);
|
||||
}
|
||||
}
|
||||
|
||||
// for(String runningApp : runningAppsListReference)
|
||||
// {
|
||||
// Miscellaneous.logEvent("i", "Running app", runningApp, 5);
|
||||
// }
|
||||
|
||||
// List<RunningAppProcessInfo> procInfos = activityManager.getRunningAppProcesses();
|
||||
// for(int i = 0; i < procInfos.size(); i++)
|
||||
// {
|
||||
// ArrayList<String> runningPkgs = new ArrayList<String>(Arrays.asList(procInfos.get(i).pkgList));
|
||||
//
|
||||
// Collection diff = subtractSets(runningPkgs, stalkList);
|
||||
//
|
||||
// if(diff != null)
|
||||
// {
|
||||
// stalkList.removeAll(diff);
|
||||
// }
|
||||
// }
|
||||
|
||||
// Set marker to the one to be written next.
|
||||
if(lastWritten == 1)
|
||||
@ -351,7 +345,7 @@ public class ProcessListener implements AutomationListenerInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean checkifThisIsActive(RunningAppProcessInfo target)
|
||||
private boolean checkIfThisIsActive(RunningAppProcessInfo target)
|
||||
{
|
||||
boolean result = false;
|
||||
RunningTaskInfo info;
|
||||
@ -397,7 +391,6 @@ public class ProcessListener implements AutomationListenerInterface
|
||||
|
||||
Message message = new Message();
|
||||
message.arg1 = 1;
|
||||
// schedulingHandler.sendMessageDelayed(message, Settings.timeBetweenNoiseLevelMeasurements * 1000);
|
||||
schedulingHandler.sendMessageDelayed(message, 10000);
|
||||
}
|
||||
else
|
||||
@ -444,7 +437,7 @@ public class ProcessListener implements AutomationListenerInterface
|
||||
|
||||
public static boolean haveAllPermission()
|
||||
{
|
||||
return ActivityPermissions.havePermission("android.permission.GET_TASKS", Miscellaneous.getAnyContext());
|
||||
return ActivityPermissions.havePermission(Manifest.permission.GET_TASKS, Miscellaneous.getAnyContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -458,6 +451,4 @@ public class ProcessListener implements AutomationListenerInterface
|
||||
{
|
||||
return new Trigger_Enum[] { Trigger_Enum.process_started_stopped };
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,274 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.KeyguardManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.jens.automation2.Actions;
|
||||
import com.jens.automation2.ActivityPermissions;
|
||||
import com.jens.automation2.AutomationService;
|
||||
import com.jens.automation2.Miscellaneous;
|
||||
import com.jens.automation2.Rule;
|
||||
import com.jens.automation2.Trigger.Trigger_Enum;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
public class ScreenStateReceiver extends BroadcastReceiver implements AutomationListenerInterface
|
||||
{
|
||||
static int screenPowerState = -1; // initialize with a better value than this
|
||||
static int screenLockState = -1; // initialize with a better value than this
|
||||
public static AutomationService automationServiceRef = null;
|
||||
|
||||
private static boolean screenStateReceiverActive = false;
|
||||
private static IntentFilter screenStateIntentFilter = null;
|
||||
private static Intent screenStatusIntent = null;
|
||||
private static BroadcastReceiver screenStateReceiverInstance = null;
|
||||
|
||||
public final static String broadcastScreenLockedWithoutSecurity = "automation.system.screen_locked_without_security";
|
||||
public final static String broadcastScreenLockedWithSecurity = "automation.system.screen_locked_with_security";
|
||||
|
||||
public final static int SCREEN_STATE_OFF = 0;
|
||||
public final static int SCREEN_STATE_ON = 1;
|
||||
public final static int SCREEN_STATE_UNLOCKED = 2;
|
||||
public final static int SCREEN_STATE_LOCKED_WITHOUT_SECURITY = 3;
|
||||
public final static int SCREEN_STATE_LOCKED_WITH_SECURITY = 4;
|
||||
|
||||
public static BroadcastReceiver getScreenStateReceiverInstance()
|
||||
{
|
||||
if (screenStateReceiverInstance == null)
|
||||
screenStateReceiverInstance = new ScreenStateReceiver();
|
||||
|
||||
return screenStateReceiverInstance;
|
||||
}
|
||||
|
||||
public static void startScreenStateReceiver(final AutomationService automationServiceRef)
|
||||
{
|
||||
if (!screenStateReceiverActive)
|
||||
{
|
||||
ScreenStateReceiver.automationServiceRef = automationServiceRef;
|
||||
|
||||
if (screenStateReceiverInstance == null)
|
||||
screenStateReceiverInstance = new ScreenStateReceiver();
|
||||
|
||||
if (screenStateIntentFilter == null)
|
||||
{
|
||||
screenStateIntentFilter = new IntentFilter();
|
||||
screenStateIntentFilter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
screenStateIntentFilter.addAction(Intent.ACTION_SCREEN_ON);
|
||||
screenStateIntentFilter.addAction(Intent.ACTION_USER_PRESENT); // also fired when device is unlocked
|
||||
screenStateIntentFilter.addAction(broadcastScreenLockedWithoutSecurity);
|
||||
screenStateIntentFilter.addAction(broadcastScreenLockedWithSecurity);
|
||||
// Intent.ACTION_USER_UNLOCKED
|
||||
}
|
||||
|
||||
screenStatusIntent = automationServiceRef.registerReceiver(screenStateReceiverInstance, screenStateIntentFilter);
|
||||
|
||||
screenStateReceiverActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void stopScreenStateReceiver()
|
||||
{
|
||||
if (screenStateReceiverActive)
|
||||
{
|
||||
if (screenStateReceiverInstance != null)
|
||||
{
|
||||
automationServiceRef.unregisterReceiver(screenStateReceiverInstance);
|
||||
screenStateReceiverInstance = null;
|
||||
}
|
||||
|
||||
screenStateReceiverActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isScreenStateReceiverActive()
|
||||
{
|
||||
return screenStateReceiverActive;
|
||||
}
|
||||
|
||||
public static int getScreenPowerState()
|
||||
{
|
||||
return screenPowerState;
|
||||
}
|
||||
|
||||
public static int getScreenLockState()
|
||||
{
|
||||
return screenLockState;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP_MR1)
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
if (intent == null)
|
||||
return;
|
||||
if (context == null)
|
||||
return;
|
||||
|
||||
Miscellaneous.logEvent("e", "ScreenStateReceiver", "Received: " + intent.getAction(), 3);
|
||||
|
||||
try
|
||||
{
|
||||
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF))
|
||||
{
|
||||
ScreenStateReceiver.screenPowerState = SCREEN_STATE_OFF;
|
||||
|
||||
KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
|
||||
|
||||
// PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||
// Miscellaneous.logEvent("i", "ScreenStateReceiver", "Method 2: " + String.valueOf(pm.isInteractive() && pm.isScreenOn() && keyguardManager.isKeyguardLocked() && keyguardManager.isDeviceLocked()), 4);
|
||||
// if (pm.isInteractive() && pm.isScreenOn() && keyguardManager.isKeyguardLocked() && keyguardManager.isDeviceLocked())
|
||||
// Miscellaneous.logEvent("i", "ScreenStateReceiver", "pm.isInteractive(): " + String.valueOf(pm.isInteractive()), 4);
|
||||
// Miscellaneous.logEvent("i", "ScreenStateReceiver", "pm.isScreenOn(): " + String.valueOf(pm.isScreenOn()), 4);
|
||||
Miscellaneous.logEvent("i", "ScreenStateReceiver", "keyguardManager.isKeyguardLocked(): " + String.valueOf(keyguardManager.isKeyguardLocked()), 4);
|
||||
Miscellaneous.logEvent("i", "ScreenStateReceiver", "keyguardManager.isDeviceLocked(): " + String.valueOf(keyguardManager.isDeviceLocked()), 4);
|
||||
|
||||
if(keyguardManager.isKeyguardLocked() && !keyguardManager.isDeviceLocked())
|
||||
{
|
||||
Actions.sendBroadcast(Miscellaneous.getAnyContext(), broadcastScreenLockedWithoutSecurity);
|
||||
}
|
||||
else if(keyguardManager.isDeviceLocked())
|
||||
{
|
||||
Actions.sendBroadcast(Miscellaneous.getAnyContext(), broadcastScreenLockedWithSecurity);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Lock may be activated delayed, not at power button press
|
||||
ScreenLockMonitor mon = new ScreenLockMonitor();
|
||||
mon.startMonitor();
|
||||
}
|
||||
}
|
||||
else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON))
|
||||
{
|
||||
ScreenStateReceiver.screenPowerState = SCREEN_STATE_ON;
|
||||
}
|
||||
else if (intent.getAction().equals(Intent.ACTION_USER_PRESENT))
|
||||
{
|
||||
ScreenStateReceiver.screenLockState = SCREEN_STATE_UNLOCKED;
|
||||
}
|
||||
else if (intent.getAction().equals(broadcastScreenLockedWithoutSecurity))
|
||||
{
|
||||
ScreenStateReceiver.screenLockState = SCREEN_STATE_LOCKED_WITHOUT_SECURITY;
|
||||
}
|
||||
else if (intent.getAction().equals(broadcastScreenLockedWithSecurity))
|
||||
{
|
||||
ScreenStateReceiver.screenLockState = SCREEN_STATE_LOCKED_WITH_SECURITY;
|
||||
}
|
||||
else
|
||||
{
|
||||
Miscellaneous.logEvent("e", "ScreenStateReceiver", "Unknown state received: " + intent.getAction(), 3);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "ScreenStateReceiver", "Error receiving screen state: " + e.getMessage(), 3);
|
||||
}
|
||||
|
||||
ArrayList<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger_Enum.screenState);
|
||||
for (int i = 0; i < ruleCandidates.size(); i++)
|
||||
{
|
||||
if (ruleCandidates.get(i).getsGreenLight(context))
|
||||
ruleCandidates.get(i).activate(automationServiceRef, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startListener(AutomationService automationService)
|
||||
{
|
||||
ScreenStateReceiver.startScreenStateReceiver(automationService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopListener(AutomationService automationService)
|
||||
{
|
||||
ScreenStateReceiver.stopScreenStateReceiver();
|
||||
}
|
||||
|
||||
public static boolean haveAllPermission()
|
||||
{
|
||||
return ActivityPermissions.havePermission(Manifest.permission.READ_PHONE_STATE, Miscellaneous.getAnyContext()) &&
|
||||
ActivityPermissions.havePermission(Manifest.permission.BATTERY_STATS, Miscellaneous.getAnyContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isListenerRunning()
|
||||
{
|
||||
return ScreenStateReceiver.isScreenStateReceiverActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Trigger_Enum[] getMonitoredTrigger()
|
||||
{
|
||||
return new Trigger_Enum[]{Trigger_Enum.screenState};
|
||||
}
|
||||
|
||||
class ScreenLockMonitor
|
||||
{
|
||||
long runs = 0;
|
||||
final long maxRuns = 20;
|
||||
final long interval = 1000;
|
||||
|
||||
Timer timer = new Timer();
|
||||
|
||||
TimerTask task = new TimerTask()
|
||||
{
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP_MR1)
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
KeyguardManager keyguardManager = (KeyguardManager) Miscellaneous.getAnyContext().getSystemService(Context.KEYGUARD_SERVICE);
|
||||
|
||||
Miscellaneous.logEvent("i", "ScreenStateReceiver", "keyguardManager.isKeyguardLocked(): " + String.valueOf(keyguardManager.isKeyguardLocked()), 4);
|
||||
Miscellaneous.logEvent("i", "ScreenStateReceiver", "keyguardManager.isDeviceLocked(): " + String.valueOf(keyguardManager.isDeviceLocked()), 4);
|
||||
|
||||
if(keyguardManager.isKeyguardLocked() && !keyguardManager.isDeviceLocked())
|
||||
{
|
||||
Actions.sendBroadcast(Miscellaneous.getAnyContext(), broadcastScreenLockedWithoutSecurity);
|
||||
timer.purge();
|
||||
timer.cancel();
|
||||
}
|
||||
else if(keyguardManager.isDeviceLocked())
|
||||
{
|
||||
Actions.sendBroadcast(Miscellaneous.getAnyContext(), broadcastScreenLockedWithSecurity);
|
||||
timer.purge();
|
||||
timer.cancel();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (runs++ > maxRuns)
|
||||
{
|
||||
Miscellaneous.logEvent("w", "ScreenStateReceiver->ScreenLockMonitor", "Lock never came.", 4);
|
||||
timer.purge();
|
||||
timer.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void startMonitor()
|
||||
{
|
||||
ContentResolver mResolver = Miscellaneous.getAnyContext().getContentResolver();
|
||||
long lockscreen_timeout = 0;
|
||||
|
||||
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1)
|
||||
lockscreen_timeout = Settings.System.getInt(mResolver, "lock_screen_lock_after_timeout", 0);
|
||||
else
|
||||
lockscreen_timeout = Settings.Secure.getInt(mResolver, "lock_screen_lock_after_timeout", 0);
|
||||
|
||||
if(lockscreen_timeout > 0)
|
||||
timer.schedule(task, lockscreen_timeout);
|
||||
else
|
||||
timer.scheduleAtFixedRate(task, 0, interval);
|
||||
}
|
||||
}
|
||||
}
|
@ -17,7 +17,7 @@ public class StartupIntentReceiver extends BroadcastReceiver
|
||||
{
|
||||
Settings.readFromPersistentStorage(context);
|
||||
|
||||
Miscellaneous.logEvent("i", "Boot event", "Received event: " + intent.getAction(), 5);
|
||||
// Miscellaneous.logEvent("i", "Boot event", "Received event: " + intent.getAction(), 5);
|
||||
|
||||
if(Settings.startServiceAtSystemBoot)
|
||||
{
|
||||
|
@ -0,0 +1,151 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.wifi.WifiManager;
|
||||
|
||||
import com.jens.automation2.AutomationService;
|
||||
import com.jens.automation2.Miscellaneous;
|
||||
import com.jens.automation2.Rule;
|
||||
import com.jens.automation2.Trigger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class SubSystemStateReceiver extends BroadcastReceiver implements AutomationListenerInterface
|
||||
{
|
||||
public static AutomationService automationServiceRef = null;
|
||||
private static IntentFilter subSystemStateIntentFilter = null;
|
||||
private static BroadcastReceiver subSystemStateReceiverInstance = null;
|
||||
private static Intent subSystemStatusIntent = null;
|
||||
private static boolean subSystemStateReceiverActive = false;
|
||||
static SubSystemStateReceiver instance;
|
||||
|
||||
final static String stateBluetooth = "android.bluetooth.adapter.action.STATE_CHANGED";
|
||||
final static String stateWifi = "android.net.wifi.STATE_CHANGE";
|
||||
final static String connectivityBroadcast = "android.net.conn.CONNECTIVITY_CHANGE";
|
||||
|
||||
static Map<String, Boolean> stateMap = null;
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
if (intent == null)
|
||||
return;
|
||||
if (context == null)
|
||||
return;
|
||||
|
||||
Miscellaneous.logEvent("e", "ScreenStateReceiver", "Received: " + intent.getAction(), 3);
|
||||
|
||||
if(stateMap == null)
|
||||
stateMap = new HashMap<>();
|
||||
|
||||
try
|
||||
{
|
||||
/*if (intent.getAction().equals(stateWifi) || intent.getAction().equals(connectivityBroadcast))
|
||||
{
|
||||
if(intent.hasExtra(WifiManager.EXTRA_WIFI_STATE))
|
||||
{
|
||||
int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_UNKNOWN);
|
||||
|
||||
if (wifiState == WifiManager.WIFI_STATE_ENABLED)
|
||||
stateMap.put("wifi", true);
|
||||
else if (wifiState == WifiManager.WIFI_STATE_DISABLED)
|
||||
stateMap.put("wifi", false);
|
||||
}
|
||||
}
|
||||
else if (intent.getAction().equals(stateBluetooth))
|
||||
{
|
||||
if(intent.hasExtra(BluetoothAdapter.EXTRA_STATE))
|
||||
{
|
||||
int bluetoothState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR);
|
||||
|
||||
if (bluetoothState == BluetoothAdapter.STATE_ON)
|
||||
stateMap.put("bluetooth", true);
|
||||
else if (bluetoothState == BluetoothAdapter.STATE_OFF)
|
||||
stateMap.put("bluetooth", false);
|
||||
}
|
||||
}*/
|
||||
if (intent.getAction().equals(stateWifi) || intent.getAction().equals(connectivityBroadcast) || intent.getAction().equals(stateBluetooth))
|
||||
{
|
||||
ArrayList<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger.Trigger_Enum.subSystemState);
|
||||
for (int i = 0; i < ruleCandidates.size(); i++)
|
||||
{
|
||||
if (ruleCandidates.get(i).getsGreenLight(context))
|
||||
ruleCandidates.get(i).activate(automationServiceRef, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Miscellaneous.logEvent("e", "SubSystemStateReceiver", "Unknown state received: " + intent.getAction(), 3);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "SubSystemStateReceiver", "Error receiving screen state: " + e.getMessage(), 3);
|
||||
}
|
||||
}
|
||||
|
||||
public static SubSystemStateReceiver getInstance()
|
||||
{
|
||||
if(instance == null)
|
||||
instance = new SubSystemStateReceiver();
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startListener(AutomationService automationService)
|
||||
{
|
||||
if (!subSystemStateReceiverActive)
|
||||
{
|
||||
automationServiceRef = automationService;
|
||||
|
||||
if (subSystemStateReceiverInstance == null)
|
||||
subSystemStateReceiverInstance = new SubSystemStateReceiver();
|
||||
|
||||
if (subSystemStateIntentFilter == null)
|
||||
{
|
||||
subSystemStateIntentFilter = new IntentFilter();
|
||||
subSystemStateIntentFilter.addAction(stateWifi);
|
||||
subSystemStateIntentFilter.addAction(connectivityBroadcast);
|
||||
subSystemStateIntentFilter.addAction(stateBluetooth);
|
||||
}
|
||||
|
||||
subSystemStatusIntent = automationServiceRef.registerReceiver(subSystemStateReceiverInstance, subSystemStateIntentFilter);
|
||||
|
||||
subSystemStateReceiverActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopListener(AutomationService automationService)
|
||||
{
|
||||
if (subSystemStateReceiverActive)
|
||||
{
|
||||
if (subSystemStateReceiverInstance != null)
|
||||
{
|
||||
automationServiceRef.unregisterReceiver(subSystemStateReceiverInstance);
|
||||
subSystemStateReceiverInstance = null;
|
||||
}
|
||||
|
||||
subSystemStateReceiverActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isListenerRunning()
|
||||
{
|
||||
return subSystemStateReceiverActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Trigger.Trigger_Enum[] getMonitoredTrigger()
|
||||
{
|
||||
return new Trigger.Trigger_Enum[]{Trigger.Trigger_Enum.subSystemState};
|
||||
}
|
||||
}
|
@ -0,0 +1,205 @@
|
||||
package com.jens.automation2.receivers;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import com.jens.automation2.ActivityManageTriggerTethering;
|
||||
import com.jens.automation2.AutomationService;
|
||||
import com.jens.automation2.Miscellaneous;
|
||||
import com.jens.automation2.Rule;
|
||||
import com.jens.automation2.Trigger;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
public class TetheringReceiver extends android.content.BroadcastReceiver implements AutomationListenerInterface
|
||||
{
|
||||
public static AutomationService automationServiceRef = null;
|
||||
private static boolean receiverActive = false;
|
||||
private static TetheringReceiver receiverInstance = null;
|
||||
private static IntentFilter intentFilter = null;
|
||||
|
||||
private static List<String> lastTetheringTypes = null;
|
||||
private static boolean tetheringActive = false;
|
||||
|
||||
public static List<String> getLastTetheringTypes()
|
||||
{
|
||||
return lastTetheringTypes;
|
||||
}
|
||||
|
||||
public static TetheringReceiver getInstance()
|
||||
{
|
||||
if(receiverInstance == null)
|
||||
receiverInstance = new TetheringReceiver();
|
||||
|
||||
return receiverInstance;
|
||||
}
|
||||
|
||||
public static boolean isTetheringActive()
|
||||
{
|
||||
return tetheringActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "TetheringReceiver", "Received " + intent.getAction(), 5);
|
||||
|
||||
/*
|
||||
DETECT BY DATA DELIVERED IN INTENT
|
||||
*/
|
||||
|
||||
// if(intent.getAction().equals("android.net.conn.TETHER_STATE_CHANGED"))
|
||||
// {
|
||||
String searchArray = null;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 26)
|
||||
searchArray = "tetherArray";
|
||||
else
|
||||
searchArray = "activeArray";
|
||||
|
||||
for (String key : intent.getExtras().keySet())
|
||||
{
|
||||
// Miscellaneous.logEvent("i", "Broadcast extra", "Broadcast " + intent.getAction() + " has extra " + key + " and type " + intent.getExtras().get(key).getClass().getName(), 4);
|
||||
Object ob = intent.getExtras().get(key);
|
||||
|
||||
if (key.equals(searchArray) && ob instanceof ArrayList)
|
||||
{
|
||||
if (((ArrayList<String>) ob).size() > 0)
|
||||
{
|
||||
tetheringActive = true;
|
||||
if (lastTetheringTypes == null)
|
||||
lastTetheringTypes = new ArrayList<>();
|
||||
else
|
||||
lastTetheringTypes.clear();
|
||||
|
||||
for (String adapterName : (ArrayList<String>) ob)
|
||||
{
|
||||
if (adapterName.contains("wlan"))
|
||||
lastTetheringTypes.add(ActivityManageTriggerTethering.tetheringTypeWifi);
|
||||
else if (adapterName.contains("bluetooth"))
|
||||
lastTetheringTypes.add(ActivityManageTriggerTethering.tetheringTypeBluetooth);
|
||||
else if (adapterName.contains("rndis"))
|
||||
lastTetheringTypes.add(ActivityManageTriggerTethering.tetheringTypeUsb);
|
||||
else if (adapterName.contains("ndis"))
|
||||
lastTetheringTypes.add(ActivityManageTriggerTethering.tetheringTypeCable);
|
||||
}
|
||||
}
|
||||
else
|
||||
tetheringActive = false;
|
||||
}
|
||||
|
||||
// Miscellaneous.logEvent("i", "Broadcast extra", "Broadcast " + intent.getAction() + " has extra " + key + " and type " + intent.getExtras().get(key).getClass().getName(), 4);
|
||||
}
|
||||
// }
|
||||
// else if(intent.getAction().equals("android.net.conn.CONNECTIVITY_CHANGE"))
|
||||
/*
|
||||
DETECT BY CHECKING ALL NETWORK INTERFACES
|
||||
*/
|
||||
// {
|
||||
/*try
|
||||
{
|
||||
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); )
|
||||
{
|
||||
NetworkInterface intf = en.nextElement();
|
||||
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements(); )
|
||||
{
|
||||
InetAddress inetAddress = enumIpAddr.nextElement();
|
||||
if (!intf.isLoopback())
|
||||
{
|
||||
if (intf.getName().contains("rndis"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "TetheringReceiver", "Tethering on interface " + intf.getName() + " seems to be active.", 4);
|
||||
lastTetheringTypes.add(ActivityManageTriggerTethering.tetheringTypeUsb);
|
||||
tetheringActive = true;
|
||||
}
|
||||
else if (intf.getName().contains("ndis"))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "TetheringReceiver", "Tethering on interface " + intf.getName() + " seems to be active.", 4);
|
||||
lastTetheringTypes.add(ActivityManageTriggerTethering.tetheringTypeCable);
|
||||
tetheringActive = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "TetheringReceiver", Log.getStackTraceString(e), 1);
|
||||
}*/
|
||||
// }
|
||||
|
||||
ArrayList<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger.Trigger_Enum.tethering);
|
||||
for(int i=0; i<ruleCandidates.size(); i++)
|
||||
{
|
||||
if(ruleCandidates.get(i).getsGreenLight(context))
|
||||
ruleCandidates.get(i).activate(automationServiceRef, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startListener(AutomationService automationService)
|
||||
{
|
||||
if(!receiverActive)
|
||||
{
|
||||
TetheringReceiver.automationServiceRef = automationService;
|
||||
|
||||
if(receiverInstance == null)
|
||||
receiverInstance = new TetheringReceiver();
|
||||
|
||||
if(intentFilter == null)
|
||||
{
|
||||
intentFilter = new IntentFilter();
|
||||
intentFilter.addAction("android.net.conn.TETHER_STATE_CHANGED");
|
||||
// intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
automationServiceRef.registerReceiver(receiverInstance, intentFilter);
|
||||
receiverActive = true;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
/*
|
||||
We might be confronted with permission issues here.
|
||||
*/
|
||||
Miscellaneous.logEvent("e", "TetheringReceiver", Log.getStackTraceString(e), 1);
|
||||
receiverActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopListener(AutomationService automationService)
|
||||
{
|
||||
if(receiverActive)
|
||||
{
|
||||
if(receiverInstance != null)
|
||||
{
|
||||
automationServiceRef.unregisterReceiver(receiverInstance);
|
||||
receiverInstance = null;
|
||||
}
|
||||
|
||||
receiverActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isListenerRunning()
|
||||
{
|
||||
return receiverActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Trigger.Trigger_Enum[] getMonitoredTrigger()
|
||||
{
|
||||
return new Trigger.Trigger_Enum[] { Trigger.Trigger_Enum.tethering};
|
||||
}
|
||||
}
|
@ -14,14 +14,13 @@ import com.jens.automation2.Trigger.Trigger_Enum;
|
||||
public class TimeZoneListener extends BroadcastReceiver implements AutomationListenerInterface
|
||||
{
|
||||
private static TimeZoneListener timeZoneListenerInstance = null;
|
||||
protected static boolean timeZoneListenerActive = false;
|
||||
protected static boolean timezoneListenerActive = false;
|
||||
protected static AutomationService automationServiceRef = null;
|
||||
protected static IntentFilter timeZoneListenerIntentFilter = null;
|
||||
|
||||
protected static IntentFilter timezoneListenerIntentFilter = null;
|
||||
|
||||
public static boolean isTimeZoneListenerActive()
|
||||
public static boolean isTimezoneListenerActive()
|
||||
{
|
||||
return timeZoneListenerActive;
|
||||
return timezoneListenerActive;
|
||||
}
|
||||
|
||||
public static void startTimeZoneListener(AutomationService automationService)
|
||||
@ -33,19 +32,19 @@ public class TimeZoneListener extends BroadcastReceiver implements AutomationLis
|
||||
|
||||
try
|
||||
{
|
||||
if(!timeZoneListenerActive && Rule.isAnyRuleUsing(Trigger_Enum.timeFrame))
|
||||
if(!timezoneListenerActive && Rule.isAnyRuleUsing(Trigger_Enum.timeFrame))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "TimeZoneListener", "Starting TimeZoneListener", 4);
|
||||
timeZoneListenerActive = true;
|
||||
timezoneListenerActive = true;
|
||||
|
||||
if(timeZoneListenerIntentFilter == null)
|
||||
if(timezoneListenerIntentFilter == null)
|
||||
{
|
||||
timeZoneListenerIntentFilter = new IntentFilter();
|
||||
timeZoneListenerIntentFilter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
|
||||
timeZoneListenerIntentFilter.addAction(Intent.ACTION_TIME_CHANGED);
|
||||
timezoneListenerIntentFilter = new IntentFilter();
|
||||
timezoneListenerIntentFilter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
|
||||
timezoneListenerIntentFilter.addAction(Intent.ACTION_TIME_CHANGED);
|
||||
}
|
||||
|
||||
automationService.registerReceiver(timeZoneListenerInstance, timeZoneListenerIntentFilter);
|
||||
automationService.registerReceiver(timeZoneListenerInstance, timezoneListenerIntentFilter);
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
@ -57,11 +56,11 @@ public class TimeZoneListener extends BroadcastReceiver implements AutomationLis
|
||||
{
|
||||
try
|
||||
{
|
||||
if(timeZoneListenerActive)
|
||||
if(timezoneListenerActive)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "TimeZoneListener", "Stopping TimeZoneListener", 4);
|
||||
automationServiceRef.unregisterReceiver(timeZoneListenerInstance);
|
||||
timeZoneListenerActive = false;
|
||||
timezoneListenerActive = false;
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
@ -81,7 +80,7 @@ public class TimeZoneListener extends BroadcastReceiver implements AutomationLis
|
||||
}
|
||||
else if(action.equals(Intent.ACTION_TIME_CHANGED))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "TimeZoneListener", "Device time changed. Reloading alarms.", 4);
|
||||
Miscellaneous.logEvent("i", "TimeZoneListener", "Device time changed. Reloading alarms.", 3);
|
||||
DateTimeListener.reloadAlarms();
|
||||
}
|
||||
}
|
||||
@ -104,7 +103,7 @@ public class TimeZoneListener extends BroadcastReceiver implements AutomationLis
|
||||
@Override
|
||||
public boolean isListenerRunning()
|
||||
{
|
||||
return TimeZoneListener.isTimeZoneListenerActive();
|
||||
return TimeZoneListener.isTimezoneListenerActive();
|
||||
}
|
||||
@Override
|
||||
public Trigger_Enum[] getMonitoredTrigger()
|
||||
|
BIN
app/src/main/res/drawable-hdpi/coffee.png
Normal file
BIN
app/src/main/res/drawable-hdpi/coffee.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
BIN
app/src/main/res/drawable-hdpi/megaphone.png
Normal file
BIN
app/src/main/res/drawable-hdpi/megaphone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/drawable-hdpi/script.png
Normal file
BIN
app/src/main/res/drawable-hdpi/script.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 679 B |
BIN
app/src/main/res/drawable-hdpi/subsystemstate.png
Normal file
BIN
app/src/main/res/drawable-hdpi/subsystemstate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
10
app/src/main/res/drawable/info.xml
Normal file
10
app/src/main/res/drawable/info.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
|
||||
</vector>
|
@ -16,14 +16,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
|
||||
android:text="@string/settings"
|
||||
android:text="@string/controlCenter"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bMoreSettings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/moreSettings" />
|
||||
android:text="@string/settings" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
@ -83,12 +83,38 @@
|
||||
android:layout_margin="@dimen/default_margin"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bShareConfigAndLog"
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/emailPretext" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chkShareConfigAndLog"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/shareConfigAndLogFilesWithDev" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSendEmailToDev"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/sendEmailToDev" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/logsExplanation" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_span="2"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="@dimen/default_margin"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFileStoreLocation"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
@ -0,0 +1,242 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/default_margin" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/closeNotifications"
|
||||
android:textSize="25dp"
|
||||
android:layout_marginBottom="@dimen/default_margin" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/notificationCloseActionExplanation" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:shrinkColumns="1"
|
||||
android:stretchColumns="1">
|
||||
|
||||
<TableRow
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/application" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_marginHorizontal="@dimen/default_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/etActivityOrActionPath"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/anyApp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSelectApp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/selectApplication" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</TableRow>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/comparisonCaseInsensitive"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/regularExpressionsIfEquals"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/title" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinnerTitleDirection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etNotificationTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</TableRow>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/comparisonCaseInsensitive"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/regularExpressionsIfEquals"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/text" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinnerTextDirection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etNotificationText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</TableRow>>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<TableRow>
|
||||
|
||||
<RadioGroup>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbNotificationDismissSimple"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/simplyDismissNotification" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbNotificationDismissButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/clickNotificationButton" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<EditText
|
||||
android:layout_gravity="bottom"
|
||||
android:id="@+id/etNotificationDismissalButtonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:inputType="text" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView />
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/comparisonCaseInsensitive"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView />
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/mayUseRegularExpressions"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveActionCloseNotification"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/default_margin" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/actionMediaControl" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/actionMediaControlNotice" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbMediaPlayPause"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/playPause" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbMediaPlay"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/play" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbMediaPause"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pause" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbMediaStop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/stop" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbMediaPrevious"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/previous" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbMediaNext"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/next" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveControlMediaAction"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/default_margin" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/createNotification"
|
||||
android:textSize="25dp"
|
||||
android:layout_marginBottom="@dimen/default_margin" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:shrinkColumns="1"
|
||||
android:stretchColumns="1">
|
||||
|
||||
<TableRow
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/default_margin"
|
||||
android:text="@string/title" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etNotificationTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/text" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etNotificationText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLegend"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
android:text="@string/urlLegend" />
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveActionNotification"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="@dimen/default_margin" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/runExecutable" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/runExecutableExplanation" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="1"
|
||||
android:shrinkColumns="1">
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/runAsRoot" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chkRunExecAsRoot"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
</CheckBox>
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/path" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etRunExecutablePath"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="textUri" >
|
||||
|
||||
</EditText>
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/default_margin"
|
||||
android:text="@string/parameters" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etRunExecutableParameters"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="text" >
|
||||
|
||||
</EditText>
|
||||
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bChooseExecutable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/chooseExecutable" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLegend"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
android:text="@string/urlLegend" />
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveActionRunExec"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/default_margin" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/sendBroadcast" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/broadcastExplanation" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Broadcast:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBroadcastToSend"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bBroadcastSendShowSuggestions"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:text="@string/broadcastsShowSuggestions" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:stretchColumns="1"
|
||||
android:shrinkColumns="1" >
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/addParameters" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_span="2"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/intentDataComment" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/parameterType" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinnerParameterType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCurrentNfcIdValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/parameterName" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etParameterName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/parameterValue" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etParameterValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bAddIntentPair"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/addIntentValue" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<ListView
|
||||
android:id="@+id/lvIntentPairs"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="115dp"
|
||||
android:layout_marginBottom="@dimen/default_margin" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveSendBroadcast"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
@ -2,13 +2,22 @@
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="10dp" >
|
||||
android:layout_margin="@dimen/default_margin" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/actionSpeakText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRuleTitle"
|
||||
android:layout_width="wrap_content"
|
||||
@ -40,7 +49,7 @@
|
||||
</ScrollView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveTriggerUrl"
|
||||
android:id="@+id/bSaveSpeakText"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -110,7 +110,7 @@
|
||||
</ScrollView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveTriggerUrl"
|
||||
android:id="@+id/bSaveSpeakText"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
100
app/src/main/res/layout/activity_manage_action_wakelock.xml
Normal file
100
app/src/main/res/layout/activity_manage_action_wakelock.xml
Normal file
@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="@dimen/default_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/keepDeviceAwake" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:shrinkColumns="1"
|
||||
android:stretchColumns="1">
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/direction" />
|
||||
|
||||
<RadioGroup>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbWakeLockActivate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/activate" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbWakeLockDeactivate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/deactivate" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:text="@string/wakeLockExplanation"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_span="2"
|
||||
android:layout_marginVertical="@dimen/default_margin" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:text="@string/wakeLockTimeout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chkWakeLockTimeout"
|
||||
android:text=""
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/duration" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWakeLockDuration"
|
||||
android:inputType="number"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveWakelock"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
100
app/src/main/res/layout/activity_manage_action_wifi.xml
Normal file
100
app/src/main/res/layout/activity_manage_action_wifi.xml
Normal file
@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="@dimen/default_margin" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/actionSetWifi"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWifiExplanation1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/wifiExplanation1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWifiExplanation2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:text="@string/wifiExplanation2" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:stretchColumns="1"
|
||||
android:shrinkColumns="1" >
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/runAsRoot" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chkWifiRunAsRoot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/runAsRoot" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="@dimen/default_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/default_margin"
|
||||
android:text="@string/state" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbActionWifiOn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/on" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbActionWifiOff"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/off" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bActionWifiSave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
@ -46,7 +46,7 @@
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTimeFrameHelpText"
|
||||
android:id="@+id/tvLastRule"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/latitude"
|
||||
@ -57,7 +57,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="numberSigned" />
|
||||
android:inputType="text" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="numberSigned" />
|
||||
android:inputType="text" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
|
@ -52,6 +52,15 @@
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/profileWarning"
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat"
|
||||
android:textColor="@color/lightRed"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -29,6 +29,14 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="10dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBluetoothNotPresentNotice"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/red"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:text="@string/deviceDoesNotHaveBluetooth" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
|
@ -0,0 +1,81 @@
|
||||
<?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:orientation="vertical"
|
||||
android:layout_margin="@dimen/default_margin">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/broadcastReceivedTitle" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/explanationBroadcastTrigger" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBroadcastUrl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:text="@string/broadcastListUrl" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbBroadcastReceived"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/broadcastReceived" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbBroadcastNotReceived"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/broadcastNotReceived" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBroadcastTriggerAction"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bBroadcastShowSuggestions"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/broadcastsShowSuggestions" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveTriggerBroadcast"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/save" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
@ -97,6 +97,22 @@
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/comparisonCaseInsensitive"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/regularExpressionsIfEquals"
|
||||
android:layout_marginBottom="@dimen/default_margin"/>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin">
|
||||
|
||||
@ -165,7 +181,7 @@
|
||||
</TableLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSaveTriggerNotification"
|
||||
android:id="@+id/bSaveActionCloseNotification"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView 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" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/subSystemState" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbSubSystemStateWifi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/wifi" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbSubSystemStateBluetooth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/bluetooth" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_span="2"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbSubSystemStateEnabled"
|
||||
android:checked="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/activated" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbSubSystemStateDisabled"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/deactivated" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSubSystemStateSave"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
132
app/src/main/res/layout/activity_manage_trigger_tethering.xml
Normal file
132
app/src/main/res/layout/activity_manage_trigger_tethering.xml
Normal file
@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="@dimen/default_margin" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_span="2"
|
||||
android:textSize="25dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/default_margin"
|
||||
android:text="@string/tetheringState"/>
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:stretchColumns="1"
|
||||
android:shrinkColumns="1" >
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="@dimen/default_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/default_margin"
|
||||
android:text="@string/state" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbTetheringOn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/on" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbTetheringOff"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/off" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
</TableRow>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/default_margin"
|
||||
android:text="@string/type" />
|
||||
|
||||
<RadioGroup>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbTetheringTypeAny"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/any" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbTetheringTypeWifi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/wifi" />
|
||||
|
||||
<RadioButton
|
||||
android:visibility="gone"
|
||||
android:id="@+id/rbTetheringTypeBluetooth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/bluetooth" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbTetheringTypeUsb"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/usb" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbTetheringTypeCable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/cable" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/red"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:text="@string/tetheringBluetoothNotPossible" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bTriggerTetheringSave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
@ -23,7 +23,7 @@
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTimeFrameHelpText"
|
||||
android:id="@+id/tvLastRule"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/end"
|
||||
@ -71,13 +71,20 @@
|
||||
android:layout_margin="10dp"
|
||||
android:background="#aa000000" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCurrentNfcIdValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/timeFrameWhichDays"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCurrentNfcIdValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/timeFrameWhichDays"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDaysHint"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/red" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkMonday"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -47,6 +47,19 @@
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView
|
||||
android:id="@+id/tvWifiTriggerNameLocationNotice"
|
||||
android:layout_span="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:textColor="@color/red"
|
||||
android:text="@string/locationRequiredToDetermineWifiName"
|
||||
android:layout_marginVertical="@dimen/default_margin"
|
||||
android:visibility="gone" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
@ -62,6 +75,16 @@
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView />
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/mayUseRegularExpressions"/>
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<Button
|
||||
@ -81,7 +104,7 @@
|
||||
</TableLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btriggerWifiSave"
|
||||
android:id="@+id/bTriggerWifiSave"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -292,6 +292,18 @@
|
||||
android:inputType="number"></EditTextPreference>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:summary="@string/musicPlayingDetection"
|
||||
android:title="@string/musicPlayingDetection">
|
||||
|
||||
<EditTextPreference
|
||||
android:key="musicCheckFrequency"
|
||||
android:summary="@string/musicCheckFrequencySummary"
|
||||
android:title="@string/musicCheckFrequencyTitle"
|
||||
android:inputType="number"></EditTextPreference>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
</PreferenceScreen>
|
@ -151,7 +151,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="10dp" >
|
||||
<TextView
|
||||
android:id="@+id/tvTimeFrameHelpText"
|
||||
android:id="@+id/tvLastRule"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/helpTextTimeFrame" />
|
||||
|
@ -193,7 +193,7 @@
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTimeFrameHelpText"
|
||||
android:id="@+id/tvLastRule"
|
||||
android:layout_width="0dip"
|
||||
android:layout_weight="5"
|
||||
android:layout_height="wrap_content"
|
||||
@ -203,6 +203,34 @@
|
||||
android:singleLine="false"
|
||||
android:textSize="20dp" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="20dp" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dip"
|
||||
android:layout_weight="5"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:text="@string/lastProfile"
|
||||
android:scrollHorizontally="false"
|
||||
android:singleLine="false"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLastProfile"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="5"
|
||||
android:scrollHorizontally="false"
|
||||
android:singleLine="false"
|
||||
android:text="n./a."
|
||||
android:textSize="20dp" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
@ -327,11 +355,11 @@
|
||||
android:text="@string/privacy" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSettings"
|
||||
android:id="@+id/bControlCenter"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:text="@string/settings" />
|
||||
android:text="@string/controlCenter" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bDonate"
|
||||
@ -340,7 +368,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:text="@string/donate" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/default_margin"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/emailContactNotice" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -51,7 +51,7 @@
|
||||
android:background="@color/barBackgroundColor" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTimeFrameHelpText"
|
||||
android:id="@+id/tvLastRule"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ruleList"
|
||||
|
@ -11,7 +11,7 @@
|
||||
<string name="pleaseSpecifiyTrigger">Bitte geben Sie mindestens einen Auslöser an.</string>
|
||||
<string name="pleaseSpecifiyAction">Bitte geben Sie mindestens eine Aktion an.</string>
|
||||
<string name="serviceWontStart">Weder Orte noch Regeln sind definitiv. Dienst wird nicht starten.</string>
|
||||
<string name="serviceStarted">Automations-Dienst gestarted.</string>
|
||||
<string name="serviceStarted">Automations-Dienst gestartet.</string>
|
||||
<string name="version">Version %1$s.</string>
|
||||
<string name="distanceBetween">Der Abstand zwischen GPS- und Mobilfunk-Position beträgt %1$d m. Dies +1 sollte der minimale Radius sein.</string>
|
||||
<string name="positioningWindowNotice">Falls Sie in einem Gebäude sind, wird empfohlen das Gerät in die Nähe eines Fensters zu bringen bis eine Position ermittelt werden konnte. Andernfalls kann es sehr lange dauern oder es funktioniert gar nicht.</string>
|
||||
@ -57,7 +57,7 @@
|
||||
<string name="end">Ende</string>
|
||||
<string name="save">Speichern</string>
|
||||
<string name="urlToTrigger">URL, die ausgelöst werden soll:</string>
|
||||
<string name="urlLegend">Variablen:\nSie können die folgenden Variablen verwenden. Vor dem Auslösen werden sie mit dem entsprechenden Wert Ihres Geräts ersetzt. Die Klammern müssen in den Text mit aufgenommen werden.\n\n[uniqueid] - Die Unique ID Ihres Geräts\n[serialnr] - Die Seriennummer Ihres Geräts\n[latitude] - Ihr gegenwärtiger Breitengrad\n[longitude] - Ihr gegenwärtiger Längengrad\n[phonenr] - Nummer des letzten ein- oder ausgehenden Anrufs\n[d] - Tag des Monats, 2-stellig mit führender Null\n[m] - Monat als Zahl, mit führenden Nullen\n[Y] - Vierstellige Jahreszahl\n[h] - Stunde im 12-Stunden-Format, mit führenden Nullen\n[H] - Stunde im 24-Stunden-Format, mit führenden Nullen\n[i] - Minuten, mit führenden Nullen\n[s] - Sekunden, mit führenden Nullen\n[ms] - milliseconds\n[notificationTitle] - Titel der letzten Benachrichtigung\n[notificationText] - Text der letzten Benachrichtigung</string>
|
||||
<string name="urlLegend">Variablen:\nSie können die folgenden Variablen verwenden. Vor dem Auslösen werden sie mit dem entsprechenden Wert Ihres Geräts ersetzt. Die Klammern müssen in den Text mit aufgenommen werden.\n\n[uniqueid] - Die Unique ID Ihres Geräts\n[serialnr] - Die Seriennummer Ihres Geräts (< Android 9)\n[latitude] - Ihr gegenwärtiger Breitengrad\n[longitude] - Ihr gegenwärtiger Längengrad\n[phonenr] - Nummer des letzten ein- oder ausgehenden Anrufs\n[d] - Tag des Monats, 2-stellig mit führender Null\n[m] - Monat als Zahl, mit führenden Nullen\n[Y] - Vierstellige Jahreszahl\n[h] - Stunde im 12-Stunden-Format, mit führenden Nullen\n[H] - Stunde im 24-Stunden-Format, mit führenden Nullen\n[i] - Minuten, mit führenden Nullen\n[s] - Sekunden, mit führenden Nullen\n[ms] - milliseconds\n[notificationTitle] - Titel der letzten Benachrichtigung\n[notificationText] - Text der letzten Benachrichtigung</string>
|
||||
<string name="wifi">WLAN</string>
|
||||
<string name="activating">Aktiviere</string>
|
||||
<string name="deactivating">Deaktiviere</string>
|
||||
@ -403,7 +403,7 @@
|
||||
<string name="startNewThreadForRuleExecution">Für Regelaktivierung neuen Thread starten.</string>
|
||||
<string name="newThreadRules">Neuer Thread</string>
|
||||
<string name="showIcon">Symbol</string>
|
||||
<string name="showIconWhenServiceIsRunning">Symbol anzeigen, wenn Dienst läuft (verstecken funktioniert nur unterhalb Android 7)</string>
|
||||
<string name="showIconWhenServiceIsRunning">Symbol anzeigen, wenn Dienst läuft (verstecken funktioniert nur unterhalb Android 7). Wenn Sie auf einer höheren Version sind, gehen Sie in die System Einstellungen, dann Automation und dann Benachrichtigungen. Deaktivieren Sie die \"Service notification\".</string>
|
||||
<string name="ruleHistory">Regel Historie (letzte zuerst):</string>
|
||||
<string name="someOptionsNotAvailableYet">Manche Optionen sind deaktiviert, da sie noch nicht funktionieren. Sie kommen in einer späteren Programmversion dazu.</string>
|
||||
<string name="lockSoundChanges">Tonänderungen sperren</string>
|
||||
@ -413,7 +413,7 @@
|
||||
<string name="volumeTest">Lautstärkekalibrierung</string>
|
||||
<string name="volumeCalibrationExplanation">Um einen dB Wert für die Lautstärkemessung zu berechnen müssen Sie einen sogenannten physikalischen Referenzwert angeben. Bitte lesen Sie bei Wikipedia nach, um mehr zu erfahren. Dieser Wert wird höchstwahrscheinlich für jedes Smartphone oder Tablet anders sein, deshalb diese Testanwendung. Verschieben Sie den Regler, um den gegenwärtig definierten Wert zu ändern. Je höher der Referenzwert desto niedriger wird der dB Wert. Es werden alle paar %1$s Sekunden neue Messungen vorgenommen und das Ergebnis unten angezeigt. Drücken Sie den zurück-Button, wenn Sie einen passenden Wert gefunden haben.</string>
|
||||
<string name="settingsWillTakeTime">Manche Einstellungen können nicht übernommen werden bevor der Dienst neu gestartet wird.</string>
|
||||
<string name="rootExplanation">Sie müssen Ihr Telefon rooten, damit diese Funktion funktionieren kann. Danach müssen Sie "Regel manuell ausführen", um den SuperUser Berechtigungsdialog zu zeigen. Wenn dieser erscheint, müssen Sie den Haken setzen, der es immer erlaubt. Ansonsten kann die Regel nicht funktionieren, wenn Sie das Telefon gerade nicht benutzen und demnach den nächsten Dialog nicht genehmigen können.</string>
|
||||
<string name="rootExplanation">Sie müssen Ihr Telefon rooten, damit diese Funktion funktionieren kann. Danach müssen Sie die Regel manuell ausführen, um den SuperUser Berechtigungsdialog zu zeigen. Wenn dieser erscheint, müssen Sie den Haken "immer erlauben" setzen. Ansonsten wird die Regel nicht funktionieren, wenn Sie das Telefon gerade nicht benutzen.</string>
|
||||
<string name="errorWritingConfig">Fehler beim Schreiben der Konfiguration. Gibt es einen beschreibbaren Speicher, und wurde alle Berechtigungen gegeben?</string>
|
||||
<string name="phoneNrReplacementError">Die letzte Telefonnummer konnte nicht in die Variable integriert werden. Sie liegt mir nicht vor.</string>
|
||||
<string name="username">Benutzername</string>
|
||||
@ -519,7 +519,7 @@
|
||||
<string name="notification">Benachrichtigung</string>
|
||||
<string name="title">Titel</string>
|
||||
<string name="text">Text</string>
|
||||
<string name="anyApp">Irgendeine Anwendung</string>
|
||||
<string name="anyApp">irgendeine Anwendung</string>
|
||||
<string name="postsNotification">%1$s zeigt eine Benachrichtung an</string>
|
||||
<string name="removedNotification">Benachrichtigung von %1$s wurde entfernt</string>
|
||||
<string name="notificationAppears">Benachrichtigung wird angezeigt</string>
|
||||
@ -532,7 +532,7 @@
|
||||
<string name="fileDoesNotExist">Datei existiert nicht.</string>
|
||||
<string name="noFileManageInstalled">Kein Dateimanager installiert.</string>
|
||||
<string name="alwaysPlayExplanation">Wenn diese Einstellung aktiv ist, wird der Ton immer abgespielt. Wenn die Einstellung inaktiv ist, wird der Ton nur dann abgespielt, wenn das Telefon weder auf stumm noch auf Vibration steht, d.h. Klingeltöne aktiv sind. Allerdings hat es keinen Einfluß auf die Medien-Lautstärke. D.h., wenn diese stumm ist, werden Sie so oder so nichts zu hören bekommen.</string>
|
||||
<string name="shareConfigAndLogFilesWithDev">Konfigurations- und Logdatei mit Entwickler teilen (via email).</string>
|
||||
<string name="shareConfigAndLogFilesWithDev">Konfigurations- und Logdateien anhängen</string>
|
||||
<string name="shareConfigAndLogExplanation">Dies wird eine neue Email öffnen mit Konfigurations- und Logdateien als Zip-Anhang. Sie wird nicht automatisch versendet. D.h. Sie können so z.B. auch den Adressaten zu sich selbst ändern.</string>
|
||||
<string name="notificationTriggerExplanation">Dieser Auslöser reagiert auf Benachrichtigungen anderer Anwendung im Benachrichtigungsbereich von Android (oder wenn diese geschlossen werden). Sie können eine bestimmte Anwendung festlegen, von die Nachricht stammen muß. Wenn nicht, zählt jede Benachrichtigung. Sie können auch Zeichenketten für Titel oder Nachrichteninhalt festlegen, die enthalten sein müssen. Die Groß-/Kleinschreibung wird hierbei nicht berücksichtigt.</string>
|
||||
<string name="addParameters">Parameter hinzufügen</string>
|
||||
@ -557,7 +557,7 @@
|
||||
<string name="noFilesImported">Keine Dateien konnten importiert werden.</string>
|
||||
<string name="notAllFilesImported">Nicht alle passenden Dateien konnten importiert werden.</string>
|
||||
<string name="openExamplesPage">Webseite mit Beispielen öffnen</string>
|
||||
<string name="phoneNumberExplanation">Sie können eine bestimmte Nummer eingeben, aber müssen nicht. Wenn Sie eine angeben wollen, können Sie auch eine aus dem Adressbuch auswählen. Außerdem können Sie reguläre Audrücke verwenden. Zum Testen selbiger mag ich die Seite:</string>
|
||||
<string name="phoneNumberExplanation">Sie können eine bestimmte Nummer eingeben (des Anrufpartners), aber müssen nicht. Wenn Sie eine angeben wollen, können Sie auch eine aus dem Adressbuch auswählen. Außerdem können Sie reguläre Audrücke verwenden. Zum Testen selbiger mag ich die Seite:</string>
|
||||
<string name="prefsImportError">Fehler beim Importieren der Einstellungen.</string>
|
||||
<string name="rulesImportedSuccessfully">Regeln und Orte wurden erfolgreich importiert.</string>
|
||||
<string name="rulesImportError">Fehler beim Importieren der Regeln.</string>
|
||||
@ -648,7 +648,7 @@
|
||||
<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="ruleXIsUsingProfileY">Dieses Profil kann nicht gelöscht werden. Regel %1$s verwendet noch Profil %2$s.</string>
|
||||
<string name="noRepetition">keine Wiederholung</string>
|
||||
<string name="usingAuthentication">mit Authentifizierung</string>
|
||||
<string name="toNumber">zu Nummer</string>
|
||||
@ -659,4 +659,99 @@
|
||||
<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>
|
||||
<string name="enterTitle">Geben Sie einen Titel ein.</string>
|
||||
<string name="enterText">Geben Sie einen Text ein.</string>
|
||||
<string name="info">Info</string>
|
||||
<string name="createNotification">Benachrichtigung erstellen</string>
|
||||
<string name="profileWasNotFound">Das Profil, das in dieser Regel referenziert wird, existiert scheinbar nicht mehr. Das alphabetisch erste wurde stattdessen ausgewählt.</string>
|
||||
<string name="closeNotifications">Benachrichtigung(en) schließen</string>
|
||||
<string name="comparisonCaseInsensitive">Groß-/Kleinschreibung ist egal.</string>
|
||||
<string name="notificationCloseActionExplanation">Wenn Sie keine Kriterien angeben, werden ALLE Benachrichtigungen geschlossen. Es wird also empfohlen, zumindest eine Anwendung zu spezifizieren und/oder Titel oder Text anzugeben.</string>
|
||||
<string name="profileWarning">Die Einstellungen, die Sie hier vornehmen, können dazu führen, dass Sie bestimmte Dinge auf Ihrem Telefon nicht mehr mitbekommen. Sie können sogar Ihren Wecker zum Schweigen bringen. Was auch immer Sie hier einstellen - es wird empfohlen, daß Sie es testen - auch nach Android Updates.</string>
|
||||
<string name="ifString">falls</string>
|
||||
<string name="pleaseSelectActionValue">Bitte wählen Sie eine Aktion!</string>
|
||||
<string name="android.permission.MEDIA_CONTENT_CONTROL">Medien steuern</string>
|
||||
<string name="play">abspielen</string>
|
||||
<string name="stop">stop</string>
|
||||
<string name="next">nächster</string>
|
||||
<string name="previous">vorheriger</string>
|
||||
<string name="pause">pausieren</string>
|
||||
<string name="playPause">abspielen/pause umschalten</string>
|
||||
<string name="selectCommand">Kommando auswählen</string>
|
||||
<string name="unlocked">entsperrt</string>
|
||||
<string name="on">an</string>
|
||||
<string name="off">aus</string>
|
||||
<string name="actionMediaControlNotice">Bedenken Sie, daß diese Aktion nicht notwendigerweise mit allen Playern funktioniert. Und selbst, wenn es mit einem grundsätzlich funktioniert, müssen auch nicht alle der u.g. Kommandos funktionieren.</string>
|
||||
<string name="screenState">Bildschirm Status</string>
|
||||
<string name="actionMediaControl">Medien steuern</string>
|
||||
<string name="selectDesiredState">Bitte gewünschten Zustand wählen</string>
|
||||
<string name="screenIs">Bildschirm ist %1$s</string>
|
||||
<string name="sendEmailToDev">Email an Entwickler schicken</string>
|
||||
<string name="controlCenter">Steuerungszentrale</string>
|
||||
<string name="emailContactNotice">Email ist mein bevorzugtes Kommunikationsmittel, um Fehler zu melden, Fragen zu stellen or Vorschläge zu machen. Bitte gehen Sie für weitere Infos in die Steuerungszentrale.\nViele Fragen können nicht einfach gleich beantwortet werden, sondern erfordern eine technische Prüfung. Haben Sie also bitte etwas Geduld.</string>
|
||||
<string name="featureCeasedToWorkLastWorkingAndroidVersion">Aufgrund Google\'s unendlicher Weisheit, ist die letzte Android Version, mit der diese Funktion noch funktioniert, die Version %1$s. Sie können es hier einrichten, aber vermutlich wird es keine Auswirkung haben.</string>
|
||||
<string name="musicPlaying">Musik läuft</string>
|
||||
<string name="selectParameters">Wählen Sie die Parameter</string>
|
||||
<string name="musicIsPlaying">Musik läuift</string>
|
||||
<string name="musicIsNotPlaying">Musik läuft nicht</string>
|
||||
<string name="musicCheckFrequencyTitle">Prüffrequenz</string>
|
||||
<string name="musicCheckFrequencySummary">Millisekunden zwischen Prüfungen</string>
|
||||
<string name="musicPlayingDetection">Musik-läuft Erkennung</string>
|
||||
<string name="locationNotWorkingOn12">Das Abrufen des Standorts scheint unter Android 12 derzeit nicht zu funktionieren. Wenn es bei Ihnen nicht klappt, tut mir das leid. Ich werde versuchen die Ursache zu beheben, sobald mir die Ursache bekannt ist. Wenn der Donut bei Ihnen also nicht aufhört sich zu drehen, wissen Sie warum.</string>
|
||||
<string name="profileXrequiresThis">Profil \"%1$s\" benötigt dies.</string>
|
||||
<string name="lastProfile">Letztes Profil:</string>
|
||||
<string name="queryAllPackages">Liste von installierten Anwendungen auslesen</string>
|
||||
<string name="timeFrameDaysHint">Wenn Sie ein Zeitfenster verwenden, das sich über Mitternacht erstreckt, müssen Sie auch den Folgetag auswählen, wenn der Auslöser auch nach Mitternacht noch auslösen soll.</string>
|
||||
<string name="featureNotInGooglePlayVersion">Diese Funktion ist in der Google Play-Version nicht mehr verfügbar.\n\nHin und wieder schikaniert Google Entwickler. Wenn Sie bestimmte Funktionen weiterhin verwenden möchten, müssen Sie Unterlagen einreichen. Leider besteht eine 99% ige Chance, dass der Papierkram abgelehnt wird. Es ist so ziemlich wie im Asterix-Comic/Film.\n\nIch habe in der Vergangenheit Wochen damit verbracht, mit ihnen über solche Fälle zu streiten, aber ich bekam immer wieder Ablehnungen - entweder von Bots oder von Leuten, die ungefähr so intelligent sind wie Bots. Ich kann mich dann nur entscheiden, ob die App vollständig aus dem Play Store fliegen soll oder die Funktion aus der Play Store Version entfernen.\n\nBitte erwägen Sie, die APK-Version von meiner Website oder die von F-Droid zu verwenden, wenn Sie diese Funktionen benötigen.</string>
|
||||
<string name="startActivityInsertManually">Diese Einschränkung betrifft nur die Auswahl einer App, nicht den eigentlichen Start. So können Sie den Namen einer Anwendung immer noch manuell eingeben, falls Sie ihn kennen.</string>
|
||||
<string name="serviceStarts">Dienst startet</string>
|
||||
<string name="deviceStarts">Gerät startet</string>
|
||||
<string name="deviceIsStarting">Gerät startet gerade</string>
|
||||
<string name="serviceIsStarting">Dienst startet gerade</string>
|
||||
<string name="broadcastReceived">Broadcast empfangen</string>
|
||||
<string name="broadcastNotReceived">Broadcast nicht empfangen</string>
|
||||
<string name="broadcastReceivedTitle">Broadcast empfangen</string>
|
||||
<string name="broadcastsShowSuggestions">Vorschläge anzeigen</string>
|
||||
<string name="selectBroadcast">Broadcast auswählen</string>
|
||||
<string name="lockedWithoutSecurity">gesperrt (nur wischen, keine PIN, etc.)</string>
|
||||
<string name="lockedWithSecurity">gesperrt (mit PIN, etc.)</string>
|
||||
<string name="lockedCommentScreenMustBeOff">Jeglicher Sperrzustand wird nur erkannt werden, wenn gleichzeitig der Bildschirm aus ist.</string>
|
||||
<string name="emailPretext">Wenn Sie ein Problem, einen Vorschlag oder eine Frage haben, schreiben Sie bitte auch etwas in die Email. Senden Sie mir nicht einfach die Dateien mit dem Standard-Mailtext. Ich werde solche Nachrichten ignorieren, sollten wir nicht bereits in einer Konversation sein.</string>
|
||||
<string name="sendBroadcast">Broadcast verschicken</string>
|
||||
<string name="enterBroadcast">Geben Sie eine Aktion für den Broadcast ein.</string>
|
||||
<string name="broadcastExplanation">Diese Aktion erlaubt es, einen Broadcast über das Nachrichtensystem von Android zu verschicken. Das ist für den Benutzer nicht sichtbar, aber Anwendungen, die sich für bestimmte Broadcasts registriert haben, können darauf reagieren.</string>
|
||||
<string name="explanationBroadcastTrigger">La mayoría de los eventos en su teléfono se \"publicado\" transmitiéndolos a través del sistema operativo.\nPor ejemplo, activar / desactivar el modo avión activará dicha transmisión. Esas transmisiones no son automáticamente visibles / audibles, pero si una aplicación (como Automatización) está interesada, puede conectarse a ellas. Cuando ocurran, se le notificará y podrá reaccionar.\n\nPuede definir aquí un evento de difusión para el que la aplicación esperará. Puede ingresarlo manualmente, copiarlo y pegarlo desde algún lugar o elegir uno de la lista de sugerencias. Como este desencadenante está destinado a ser y seguir siendo muy flexible, no puedo proporcionarle explicaciones para los elementos.\n\nLa lista de sugerencias no pretende estar completa. Visite la siguiente URL para echar un vistazo a la documentación de Android.\nTambién cualquier aplicación puede enviar eventos personalizados que no aparecerán en la documentación de Android, por supuesto.\n\nMuchas transmisiones requieren permisos específicos para funcionar. Intento solicitar permisos donde sé que serán necesarios. Si cree que se requiere un permiso para la acción que ingresó, hágamelo saber.\n\nNo recibido significa que no ha habido tal transmisión desde que se inició el servicio. Responder a ciertos parámetros está en desarrollo.</string>
|
||||
<string name="logsExplanation">Um eine unnötige Abnutzung Ihres Speichers zu vermeiden, werden Protokolle standardmäßig nicht gespeichert. Wenn Sie also ein Problem haben, aktivieren Sie bitte zuerst die Anmeldeeinstellungen und setzen Sie den Protokollpegel auf 5. Reproduzieren Sie dann das Problem. Erst dann können Protokolle angehängt werden.</string>
|
||||
<string name="directionStringDoesNotContain">enthält nicht</string>
|
||||
<string name="path">Pfad</string>
|
||||
<string name="runExecutable">Programm/Script ausführen</string>
|
||||
<string name="parameters">Parameter</string>
|
||||
<string name="chooseExecutable">Datei auswählen</string>
|
||||
<string name="runAsRoot">Als root ausführen</string>
|
||||
<string name="selectValidExecutable">Wählen Sie eine gültige ausführbare Datei aus.</string>
|
||||
<string name="fileNotExecutable">Diese Datei ist nicht ausführbar.</string>
|
||||
<string name="usingRoot">als root</string>
|
||||
<string name="tetheringActive">Tethering ist aktiv</string>
|
||||
<string name="tetheringNotActive">Tethering ist nicht aktiv</string>
|
||||
<string name="tetheringState">Tethering Status</string>
|
||||
<string name="wifiExplanation2">Während der Flugmodus aktiv ist, kann WLAN nur von Anwendungen ein- oder ausgeschaltet werden, wenn root-Rechte dafür verwendet werden.</string>
|
||||
<string name="wifiExplanation1">Anwendungen, die auf Android Q oder höher ausgerichtet sind, können WLAN nicht mehr ein- oder ausschalten. Daran ist Google schuld, nicht ich.\n\nSie können diese Einschränkung umgehen, indem Sie Ihr Gerät rooten und die Checkbox unten aktivieren. Alternativ laden Sie sich diese Anwendung von F-Droid oder meiner Webseite herunter. In diesen Versionen bin ich nicht gezwungen, die Anwendungen auf die neuesten API Level zu unterstützen.</string>
|
||||
<string name="runExecutableExplanation">Sie können ein Script oder eine andere ausführbare Datei auswählen, die dann als Aktion ausgeführt wird.\n\nAllerdings gibt es ein paar Voraussetzungen, um die Sie sich selbst kümmern müssen. Google hat es sehr schwer gemacht, irgendetwas außer normalen Android Anwendungen auszuführen.\n\n1.\nDie Datei muß im Dateisystem als ausführbar markiert sein. Auf einem normalen Android-System (ohne Root) ist das in der Tat der schwierigste Teil.\n\n2.\nDas bedeutet auch, daß auch Automation in der Lage sein muß, die Datei auszuführen, nicht nur der Besitzer oder die Gruppe.\n\n3.\nWenn es ein Script ist, muß eine gültige Shell im Header des Scripts definiert sein.</string>
|
||||
<string name="regularExpressionsIfEquals">Falls \"ist gleich\" ausgewählt ist, können Sie reguläre Ausdrücke eingeben.</string>
|
||||
<string name="enter_a_number">Geben Sie eine Zahl ein.</string>
|
||||
<string name="duration">Dauer [ms]</string>
|
||||
<string name="keepDeviceAwake">Gerät wach halten</string>
|
||||
<string name="wakeLockTimeout">Zeitlimit angeben</string>
|
||||
<string name="wakeLockExplanation">Aktivieren wird den Bildschirm anbehalten, während deaktivieren dem Bildschirm erlaubt, auszugehen. Um ihn anzubehalten, können Sie entweder eine Dauer angeben, nach der er ausgehen darf, oder Sie können Sie unendlich lange anlassen. Im letzteren Fall müßten Sie eine neue Gerät wach halten-Aktion definieren, in der Sie \"deaktivieren\" auswählen.</string>
|
||||
<string name="mayUseRegularExpressions">Sie können hier auch einen regulären Ausdruck eingeben.</string>
|
||||
<string name="locationRequiredToDetermineWifiName">Um die SSID auslesen zu können, benötigt die Anwendung das Recht Ihren Standort zu erkennen. Weil die Google-Version das nicht kann, können Sie in diesem Auslöser keine SSID spezifizieren. Sie können ihn nur wenden, um zu erkennen, ob WLAN verbunden ist oder nicht.</string>
|
||||
<string name="withButton">mit der Schaltfläche %1$s</string>
|
||||
<string name="bluetooth">Bluetooth</string>
|
||||
<string name="subSystemState">Subsystem Status</string>
|
||||
<string name="clickNotificationButton">Eine Schaltfläche klicken</string>
|
||||
<string name="simplyDismissNotification">Regulär schließen</string>
|
||||
<string name="usb">USB</string>
|
||||
<string name="cable">Kabel</string>
|
||||
<string name="tetheringBluetoothNotPossible">Bluetooth tethering kann gegenwärtig nicht detektiert werden. Nur die anderen Verbindungsarten werden diesen Auslöser aktivieren.</string>
|
||||
<string name="type">Art</string>
|
||||
</resources>
|
@ -117,7 +117,7 @@
|
||||
<string name="actionSetUsbTethering">Enrutador USB</string>
|
||||
<string name="actionTurnBluetoothOn">encender Bluetooth</string>
|
||||
<string name="actionTurnWifiOn">encender wifi</string>
|
||||
<string name="actionTurnWifiOff">desactivar Bluetooth</string>
|
||||
<string name="actionTurnWifiOff">desactivar wifi</string>
|
||||
<string name="actionTurnBluetoothOff">desactivar Bluetooth</string>
|
||||
<string name="actionTriggerUrl">Abrir URL en antecedentes</string>
|
||||
<string name="actionChangeSoundProfile">Cambiar perfil sonido</string>
|
||||
@ -127,10 +127,10 @@
|
||||
<string name="actionTurnWifiTetheringOff">desactivar enrutador wifi</string>
|
||||
<string name="actionTurnAirplaneModeOn">encender modo de vuelo</string>
|
||||
<string name="actionTurnAirplaneModeOff">desactivar modo de vuelo</string>
|
||||
<string name="activePoi">sitio activo</string>
|
||||
<string name="activePoi">Sitio activo:</string>
|
||||
<string name="closestPoi">sitio mas cerca</string>
|
||||
<string name="poi">Posición</string>
|
||||
<string name="pois">posiciónes</string>
|
||||
<string name="pois">Posiciones</string>
|
||||
<string name="serviceNotRunning">Servicio no está activo</string>
|
||||
<string name="general">General</string>
|
||||
<string name="startServiceAfterAppUpdate">Encender servicio después de un update si estuvo activado.</string>
|
||||
@ -294,7 +294,7 @@
|
||||
<string name="parameterValue">Valor del parámetro</string>
|
||||
<string name="addIntentValue">Añadir pareja intento</string>
|
||||
<string name="parameterType">Tipo del parámetro</string>
|
||||
<string name="phoneNumberExplanation">Puedes introducir un número, pero es opciónal. Si quieres usar uno puedes elegir uno de su directorio o introducir uno manualmente. Adiciónalmente puedes usar expresiónes regulares. Para probar esos me gusta la pagina:</string>
|
||||
<string name="phoneNumberExplanation">Puedes introducir un número remoto, pero es opciónal. Si quieres usar uno puedes elegir uno de su directorio o introducir uno manualmente. Adiciónalmente puedes usar expresiónes regulares. Para probar esos me gusta la pagina:</string>
|
||||
<string name="screenRotationEnabled">Rotación del monitor activado.</string>
|
||||
<string name="screenRotationDisabled">Rotación del monitor desactivado.</string>
|
||||
<string name="noPoisDefinedShort">No hay sitios.</string>
|
||||
@ -358,12 +358,12 @@
|
||||
<string name="networkAccuracy">Red exactitud [m]</string>
|
||||
<string name="minimumTimeForLocationUpdates">Tiempo mínimo para cambio en milisegundos para actualizar posición</string>
|
||||
<string name="timeForUpdate">Tiempo para actualizar [milisegundos]</string>
|
||||
<string name="urlLegend">Variables: Puede usar esas variables. Mientras ejecuta van a sustituir con los valores correspondientes en su dispositivo. Incluya las paréntecis en su texto. [uniqueid] - el número único de su dispositivo [serialnr] - el número de serie de su dispositivo [latitude] - su latitud [longitude] - su longitud [phonenr] - Ùltimo número de llamada realizada tanto de salida como entrante [d] - Dia del mes, 2 digitos con cero al comienzo [m] - número del mes, 2 digitos con cero al comienzo [Y] - Número del año, 4 digitos [h] - Hora, formato 12 horas con cero al comienzo [H] - Hora, formato 24 horas con cero al comienzo [i] - Minutos con cero al comienzo [s] - Segundos con cero al comienzo [ms] - milisegundos [notificationTitle] - Título de la última notificación [notificationText] - Texto de la última notificación</string>
|
||||
<string name="urlLegend">Variables: Puede usar esas variables. Mientras ejecuta van a sustituir con los valores correspondientes en su dispositivo. Incluya las paréntecis en su texto.\n\n[uniqueid] - el número único de su dispositivo\n[serialnr] - el número de serie de su dispositivo (< Android 9)\n[latitude] - su latitud\n[longitude] - su longitud\n[phonenr] - Ùltimo número de llamada realizada tanto de salida como entrante\n[d] - Dia del mes, 2 digitos con cero al comienzo\n[m] - número del mes, 2 digitos con cero al comienzo\n[Y] - Número del año, 4 digitos\n[h] - Hora, formato 12 horas con cero al comienzo\n[H] - Hora, formato 24 horas con cero al comienzo\n[i] - Minutos con cero al comienzo\n[s] - Segundos con cero al comienzo\n[ms] - milisegundos\n[notificationTitle] - Título de la última notificación\n[notificationText] - Texto de la última notificación</string>
|
||||
<string name="screenRotationAlreadyEnabled">Rotación del monitor todavia esta activado.</string>
|
||||
<string name="screenRotationAlreadyDisabled">Rotación del monitor todavia esta desactivado.</string>
|
||||
<string name="needLocationPermForWifiList">Se puede usar la lista de wifis conocidos para determinar los sitios en los cuales estuvo. Por eso el permiso de localización es necesario para cargar la lista de wifis. Si quiere elegir uno de la lista tiene que conceder el permiso. En caso contrario todavia puede introducir un nombre wifi manualmente.</string>
|
||||
<string name="com.wireguard.android.permission.CONTROL_TUNNELS">Controlar conexiones de la app Wireguard</string>
|
||||
<string name="shareConfigAndLogFilesWithDev">Enviar configuración y procotolo al desarollador (vía email).</string>
|
||||
<string name="shareConfigAndLogFilesWithDev">Adjuntar configuración y procotolo.</string>
|
||||
<string name="rootExplanation">Necesita permiso root para esta función. Después encienda la función \"ejecutar regla manualmente\" para presentar el permiso superuser dialogo. Es necesario elegir \"siempre permitir root para esta app\". En caso contrario la regla no puede funcionar en segundo plano.</string>
|
||||
<string name="helpTextRules">Todas las condiciones están \"Y\"-conectadas. La regla solo va a aplicarse cuando todas las condiciones se aplican. Si quiere \"O\", cree otra regla.</string>
|
||||
<string name="timeBetweenNoiseLevelMeasurementsSummary">Segundos entre dos ensayos de nivel de ruido</string>
|
||||
@ -470,7 +470,7 @@
|
||||
<string name="noMapsApplicationFound">Parece que no hay una aplicación de mapa en su dispositivo.</string>
|
||||
<string name="soundMode">Modo de sonido de llamada.</string>
|
||||
<string name="showIcon">Monstrar icono</string>
|
||||
<string name="showIconWhenServiceIsRunning">Monstrar icono cuando el servicio esta activo (ocultando solo funciona antes Android 7)</string>
|
||||
<string name="showIconWhenServiceIsRunning">Monstrar icono cuando el servicio esta activo (ocultando solo funciona antes Android 7). Si está en una versión superior, vaya a configuración del sistema, luego Automatización, luego notificaciones y deshabilite \"Service notification\".</string>
|
||||
<string name="currentVolume">Volumen actual</string>
|
||||
<string name="volumeTest">Calibrado de volumen</string>
|
||||
<string name="permissionsTitle">Permisos necesarios</string>
|
||||
@ -588,7 +588,7 @@
|
||||
<string name="vibrate">Vibrar</string>
|
||||
<string name="test">Probar</string>
|
||||
<string name="VibrateExplanation">Elija la duración de la vibración, seguido de un coma y una duración de una pausa. Puedes concatenar tantos como quiere. Separelos con comas tambien. Por ejemplo el patrón 100,500,500,1000,100 va a vibrar 100, esperar 500, vibrar 500, esperar 1000, vibrar 100 ms. Si cree que una vibración está perdida, pruebe incrementar la pausa antes de esta vibración.</string>
|
||||
<string name="pleaseEnterValidVibrationPattern">Por favor introduzca un patrón de vibración válido.</string>
|
||||
<string name="pleaseEnterValidVibrationPattern">Por favor inserte un patrón de vibración válido.</string>
|
||||
<string name="tabsPlacementSummary">Elija done la barra de tabs está puesto.</string>
|
||||
<string name="intentDataComment">Si su parametro es de tipo Uri y especifica \"IntentData\" como nombre (minúscula/mayáscula no es importante), el parametro no está añadido como un parametro normal con puExtra(), pero estará añadido al intent con setData().</string>
|
||||
<string name="locationEngineDisabledLong">Desafortunadamente su posición todavia no puede ser determinada. Gratitud va para Google por su sabiduria y amabilidad infinita.\n\nDejenme explicarselo mas. Comenzando con Android 10 un nuevo permiso se introdujo que es necesario para determinar la posición en el fondo (que es necesario para una app como esta). Aunque lo considero una buena idea, conlleva a una chicana para desarolladores.\n\nCuando se esta desarrollando una app se puede intentar calificar para este permiso mientras se sigue un catalogo de condiciones. Desafortunadamente nuevas versiones de mi app fueron rechazadas por un periodo de trés meses. Cumplé todas las condiciones, pero Google\'s mierda servicio para desarolladores afirmó que no. Despues de presentar pruebas, que cumplí con todo, recibí una respuesta de \"No puedo ayudarte mas.\". En algun momento me rendí.\n\nComo consecuencia la version Google Play todavia no sabe usar la locación como una condición. Mi única alternativa fue remover la applicación de Google Play.\n\nLo siento mucho, pero hicé todo lo posible para discutir con un support que no sabe aprobar la prueba de Turing repetidamente.\n\nLa noticia positiva: Usted todavia puede tener todo!\n\nAutomation ahora es open source y se puede encontrar en F-Droid. Es un app store que se preocupa por su privacidad - en vez de solo simular eso. Simplemente guarde su configuración, desinstale la app, instale la de F-Droid, restaure su configuración - terminado.\n\nCliquee aqui para averiguar más:</string>
|
||||
@ -626,7 +626,7 @@
|
||||
<string name="automationNotificationsIgnored">Si no elige una aplicación específica, sino que elige \"Cualquier aplicación\", las notificaciones de Automatización se ignorarán para evitar bucles.</string>
|
||||
<string name="enterRepetitionTime">Debe insertar un valor positivo no decimal para el tiempo de repetición.</string>
|
||||
<string name="elementSkipped">No se pudo leer un elemento del archivo de configuración. El archivoo puede haber sido creado por una versión más reciente del programa.</string>
|
||||
<string name="enterValidNumbersIntoAllFields">Introduzca números válidos en todos los campos.</string>
|
||||
<string name="enterValidNumbersIntoAllFields">Inserte números válidos en todos los campos.</string>
|
||||
<string name="toleranceOf180OnlyAllowedIn2Fields">Se permite una tolerancia de 180 solo para 2 campos de tolerancia, no para todos los 3. De lo contrario, el disparador SIEMPRE se aplicaría.</string>
|
||||
<string name="triggerWrong">Hay algo mal con este condición. No se pudo cargar correctamente.</string>
|
||||
<string name="deviceOrientationTimeAcceptIntervalSummary">Aceptar nuevas señales de movimiento cada x milisegundos</string>
|
||||
@ -646,7 +646,7 @@
|
||||
<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="ruleXIsUsingProfileY">No se puede eliminar este perfil. La regla %1$s hace referencia al perfil %2$s.</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>
|
||||
@ -658,4 +658,99 @@
|
||||
<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>
|
||||
<string name="info">Info</string>
|
||||
<string name="createNotification">Crear notificación</string>
|
||||
<string name="enterTitle">Inserte un título.</string>
|
||||
<string name="enterText">Inserte un texto.</string>
|
||||
<string name="profileWasNotFound">El perfil utilizado en esta regla ya no parece existir. Se ha seleccionado el primero alfabéticamente.</string>
|
||||
<string name="notificationCloseActionExplanation">Si no especifica ningún criterio, esta acción cerrará TODAS las notificaciones. Por lo tanto, se recomienda al menos especificar criterios para al menos 1 de la aplicación, título o texto.</string>
|
||||
<string name="closeNotifications">Cerrar notificación(es)</string>
|
||||
<string name="comparisonCaseInsensitive">Las comparaciones se realizan sin distinción de mayúsculas y minúsculas</string>
|
||||
<string name="profileWarning">La configuración que realice aquí puede hacer que ya no note ciertas cosas de su teléfono. Incluso puede silenciar su alarma de despertar. Así que hagas lo que hagas, se recomienda que lo pruebe - tambien despues upgrades de Android.</string>
|
||||
<string name="ifString">si</string>
|
||||
<string name="on">encendido</string>
|
||||
<string name="off">apagado</string>
|
||||
<string name="unlocked">desbloqueado</string>
|
||||
<string name="play">reproducir</string>
|
||||
<string name="pause">pausar</string>
|
||||
<string name="previous">ultimo</string>
|
||||
<string name="next">proximo</string>
|
||||
<string name="stop">parar</string>
|
||||
<string name="android.permission.MEDIA_CONTENT_CONTROL">Controlar la reproducción de medios</string>
|
||||
<string name="actionMediaControl">Controlar la reproducción de medios</string>
|
||||
<string name="pleaseSelectActionValue">Por favor elije una acción!</string>
|
||||
<string name="playPause">alternar reproducir/pausar</string>
|
||||
<string name="selectCommand">Elije el comando</string>
|
||||
<string name="screenState">Estado de la pantalla</string>
|
||||
<string name="selectDesiredState">Elije el estado deseado</string>
|
||||
<string name="controlCenter">Centro de control</string>
|
||||
<string name="screenIs">pantalla esta %1$s</string>
|
||||
<string name="sendEmailToDev">Enviar email al desrollador</string>
|
||||
<string name="featureCeasedToWorkLastWorkingAndroidVersion">Debido a la infinita sabiduría de Google, la última versión de Android en la que se sabe que funciona esta función es %1$s. Puede configurarlo, pero probablemente no tendrá ningún efecto.</string>
|
||||
<string name="emailContactNotice">El correo electrónico es mi método preferido de contacto para informar errores, hacer preguntas o hacer propuestas. Vaya al centro de control para obtener más información.\nMuchas preguntas no se pueden responder de inmediato, pero requieren cierta investigación técnica. Así que, por favor, tengan un poco de paciencia.</string>
|
||||
<string name="actionMediaControlNotice">Ten en cuenta que esta acción puede no funcionar con TODOS los jugadores. E incluso si lo hace, no todos los botones funcionan necesariamente.</string>
|
||||
<string name="musicPlaying">Musica esta reproduciendo</string>
|
||||
<string name="selectParameters">Elije parametros</string>
|
||||
<string name="musicIsPlaying">musica esta reproduciendo</string>
|
||||
<string name="musicIsNotPlaying">musica no esta reproduciendo</string>
|
||||
<string name="musicCheckFrequencyTitle">Frecuencia de los controles</string>
|
||||
<string name="musicCheckFrequencySummary">Millisegundos entre controles</string>
|
||||
<string name="musicPlayingDetection">Musica tocando deteción</string>
|
||||
<string name="locationNotWorkingOn12">Obtener la locación no parece estar funcionando en dispositivos Android 12 actualmente. Si no está funcionando para ti, lo siento. Intentaré arreglar esto tan pronto como conozca la causa. Así que si la rosquilla no deja de girar, ya sabes por qué.</string>
|
||||
<string name="profileXrequiresThis">El perfil \"%1$s\" requiere esto.</string>
|
||||
<string name="lastProfile">Último perfil:</string>
|
||||
<string name="queryAllPackages">Obtener una lista de las aplicaciones instaladas</string>
|
||||
<string name="timeFrameDaysHint">Si utiliza un marco de tiempo que se extiende más allá de la medianoche, también debe seleccionar el día siguiente si desea que la condición se aplique después de la medianoche.</string>
|
||||
<string name="featureNotInGooglePlayVersion">Esta función ya no está disponible en la versión de Google Play.\n\nTodo de vez en cuando Google intimida a los desarrolladores. Si desea seguir utilizando ciertas funciones, debe presentar documentos. Desafortunadamente, hay un 99% de posibilidades de que el papeleo sea rechazado. Es más o menos como en el cómic/la película de Astérix.\n\nHe pasado semanas discutiendo con ellos sobre casos como ese en el pasado, pero seguí recibiendo rechazos, ya sea por bots o personas que son tan inteligentes como los bots. En el puedo decidir entre que la aplicación se elimine de Play Store por completo o eliminar la función.\n\nPor favor, considere usar la versión APK de mi sitio web o la de F-Droid si necesita esas características.</string>
|
||||
<string name="startActivityInsertManually">Esta limitación se refiere solo a la selección de una aplicación, no al inicio real. Por lo tanto, aún puede ingresar el nombre de una aplicación manualmente si lo conoce.</string>
|
||||
<string name="deviceStarts">Dispositivo esta enciendo</string>
|
||||
<string name="serviceStarts">Servicio esta enciendo</string>
|
||||
<string name="deviceIsStarting">el dispositivo justamente esta encendido</string>
|
||||
<string name="serviceIsStarting">el servicio justamente esta encendido</string>
|
||||
<string name="emailPretext">Si tiene un problema, sugerencia o pregunta, escriba algo en el correo electrónico. No solo envíeme los archivos con el cuerpo de correo predeterminado. Ignoraré todo eso a menos que ya estemos en una conversación.</string>
|
||||
<string name="lockedCommentScreenMustBeOff">Cualquier estado de bloqueo solo se detectará si la pantalla está apagada.</string>
|
||||
<string name="lockedWithSecurity">bloqueado (con PIN, etc.)</string>
|
||||
<string name="lockedWithoutSecurity">bloqueado (solo deslizar, sin PIN)</string>
|
||||
<string name="selectBroadcast">Seleccionar broadcast</string>
|
||||
<string name="broadcastsShowSuggestions">Mostrar sugerencias</string>
|
||||
<string name="broadcastReceivedTitle">Broadcast recibido</string>
|
||||
<string name="broadcastReceived">broadcast recibido</string>
|
||||
<string name="broadcastNotReceived">broadcast no recibido</string>
|
||||
<string name="broadcastExplanation">Esta acción permite enviar una transmisión a través del sistema de mensajes de Android. Esto no es visible para el usuario, pero las aplicaciones que se han registrado para ciertas transmisiones pueden responder a ello.</string>
|
||||
<string name="sendBroadcast">Enviar broadcast</string>
|
||||
<string name="enterBroadcast">Introduzca una acción de broadcast.</string>
|
||||
<string name="explanationBroadcastTrigger">La mayoría de los eventos en su teléfono se \"publicado\" transmitiéndolos a través del sistema operativo.\nPor ejemplo, activar / desactivar el modo avión activará dicha transmisión. Esas transmisiones no son automáticamente visibles / audibles, pero si una aplicación (como Automatización) está interesada, puede conectarse a ellas. Cuando ocurran, se le notificará y podrá reaccionar.\n\nPuede definir aquí un evento de difusión para el que la aplicación esperará. Puede ingresarlo manualmente, copiarlo y pegarlo desde algún lugar o elegir uno de la lista de sugerencias. Como este desencadenante está destinado a ser y seguir siendo muy flexible, no puedo proporcionarle explicaciones para los elementos.\n\nLa lista de sugerencias no pretende estar completa. Visite la siguiente URL para echar un vistazo a la documentación de Android.\nTambién cualquier aplicación puede enviar eventos personalizados que no aparecerán en la documentación de Android, por supuesto.\n\nMuchas transmisiones requieren permisos específicos para funcionar. Intento solicitar permisos donde sé que serán necesarios. Si cree que se requiere un permiso para la acción que ingresó, hágamelo saber.\n\nNo recibido significa que no ha habido tal transmisión desde que se inició el servicio. Responder a ciertos parámetros está en desarrollo.</string>
|
||||
<string name="logsExplanation">Para evitar el uso innecesario del almacenamiento, los registros no se guardan de forma predeterminada. Entonces, si tiene un problema, active primero la configuración de inicio de sesión y establezca el nivel de registro en 5. A continuación, reproduzca el problema. Solo entonces se pueden adjuntar registros.</string>
|
||||
<string name="directionStringDoesNotContain">no contiene</string>
|
||||
<string name="enter_a_number">Introduzca un número.</string>
|
||||
<string name="regularExpressionsIfEquals">Si se selecciona \"igual\", puede introducir una expresión regular.</string>
|
||||
<string name="duration">Duración [ms]</string>
|
||||
<string name="keepDeviceAwake">Mantenga el dispositivo despierto</string>
|
||||
<string name="wakeLockTimeout">Especificar el tiempo de espera</string>
|
||||
<string name="runAsRoot">Ejecutar con root</string>
|
||||
<string name="path">Ruta de acceso</string>
|
||||
<string name="runExecutable">Ejecutar script o ejecutable</string>
|
||||
<string name="parameters">Parámetros</string>
|
||||
<string name="chooseExecutable">Elegir ejecutable</string>
|
||||
<string name="selectValidExecutable">Elija valido archivo ejecutable.</string>
|
||||
<string name="fileNotExecutable">Este archivo no es ejecutable.</string>
|
||||
<string name="usingRoot">con root</string>
|
||||
<string name="tetheringActive">tethering esta activo</string>
|
||||
<string name="tetheringNotActive">tethering no esta activo</string>
|
||||
<string name="tetheringState">Estado de tethering</string>
|
||||
<string name="wifiExplanation2">Mientras modo vuelo esta activo, solo aplicaciones que tienen el permiso root pueden encender/desactivar wifi.</string>
|
||||
<string name="wifiExplanation1">Las aplicaciones dirigidas a Android Q o superior ya no pueden activar o desactivar el wifi. Por favor, culpe a Google por esta restricción, no a mí. Puede omitir esta restricción rooteando su dispositivo y activando la casilla de verificación a continuación. Alternativamente, descargue esta aplicación de F-Droid o mi sitio web, ya que no estoy obligado a apuntar al último nivel de API en esas versiones.</string>
|
||||
<string name="runExecutableExplanation">Puede seleccionar un script o un archivo ejecutable aquí que se ejecutará como una acción. Pero hay algunos requisitos previos con los que tienes que lidiar por tu cuenta. Google ha hecho que sea muy difícil ejecutar cualquier otra cosa que no sean aplicaciones normales de Android. 1. El archivo debe estar marcado como ejecutable en el sistema de archivos. En un sistema Android normal (sin root) esta es en realidad la parte difícil. 2. Eso también significa que la automatización debe poder ejecutar el archivo, no solo el propietario o el grupo. 3. Si se trata de un script, se especificará un shell válido en el encabezado del script.</string>
|
||||
<string name="wakeLockExplanation">Activar mantendrá la pantalla encendida mientras desactiva la dejará apagarla. Para mantenerlo encendido, puede ingresar una duración después de la cual puede apagarse nuevamente o puede mantenerlo encendido indefinidamente. En este último caso, deberá crear otra acción de mantenerse despierto (en esta u otra regla) en la que seleccione desactivar.</string>
|
||||
<string name="mayUseRegularExpressions">Aqui tambien puede insertar expressiones regulares.</string>
|
||||
<string name="locationRequiredToDetermineWifiName">Para obtener el SSID wifi, la aplicación requiere permisos de ubicación. Debido a que la versión de Google no puede obtener eso, solo puede usar este desencadenador si no especifica un SSID. Por lo tanto, solo se puede usar para detectar si wifi está conectado o no.</string>
|
||||
<string name="withButton">con botón %1$s</string>
|
||||
<string name="bluetooth">Bluetooth</string>
|
||||
<string name="subSystemState">Estado del subsystema</string>
|
||||
<string name="clickNotificationButton">Cliquar un botón</string>
|
||||
<string name="simplyDismissNotification">Simplemente desestimar</string>
|
||||
<string name="usb">USB</string>
|
||||
<string name="cable">Cable</string>
|
||||
<string name="tetheringBluetoothNotPossible">Actualmente no se puede detectar Bluetooth tethering. Solo los otros tipos de connection van a activar este condición.</string>
|
||||
<string name="type">Tipo</string>
|
||||
</resources>
|
756
app/src/main/res/values-fr/strings.xml
Normal file
756
app/src/main/res/values-fr/strings.xml
Normal file
@ -0,0 +1,756 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="ruleActivate">Activation de la règle %1$s</string>
|
||||
<string name="profileActivate">Activation du profil %1$s</string>
|
||||
<string name="ruleActivateToggle">Activation de la règle %1$s en mode alternatif</string>
|
||||
<string name="addPoi">Ajouter une localisation</string>
|
||||
<string name="addRule">Ajouter une règle</string>
|
||||
<string name="poiList">Liste des localisation:</string>
|
||||
<string name="ruleList">Liste des règles:</string>
|
||||
<string name="pleaseEnterValidName">Veuillez entrer un nom valide.</string>
|
||||
<string name="pleaseSpecifiyTrigger">Veuillez spécifier au moins un dćlencheur.</string>
|
||||
<string name="pleaseSpecifiyAction">Veuillez spécifier au moins une action.</string>
|
||||
<string name="serviceWontStart">Aucune règle définie. Le service ne démarrera pas.</string>
|
||||
<string name="serviceStarted">Automation démarre.</string>
|
||||
<string name="version">Version %1$s.</string>
|
||||
<string name="distanceBetween">La distance entre la position GPS et la position du réseau est de %1$d mètres. +1m est le rayon absolue minimal.</string>
|
||||
<string name="positioningWindowNotice">Si vous êtes dans un bâtiment il est fortement recommandé de vous approcher d\'une fenêtre pour qu\'une géolocalisation soit trouvée. Sinon la géolocalisation peut prendre beaucoup de temps ou ne pas fonctionner.</string>
|
||||
<string name="gettingPosition">Acquisition de la géolocalisation. Veuillez patienter...</string>
|
||||
<string name="yes">Oui</string>
|
||||
<string name="no">Non</string>
|
||||
<string name="pleaseEnterValidLatitude">Veuillez saisir une latitude valide.</string>
|
||||
<string name="pleaseEnterValidLongitude">Veuillez saisir une longitude valide.</string>
|
||||
<string name="pleaseEnterValidRadius">Veuillez entrer une valeur de rayon positive.</string>
|
||||
<string name="selectOneDay">Sélectionnez au moins un jour.</string>
|
||||
<string name="whatToDoWithRule">Que faire avec la règle ?</string>
|
||||
<string name="whatToDoWithPoi">Que faire avec la géolocalisation ?</string>
|
||||
<string name="whatToDoWithProfile">Que faire avec le profil ?</string>
|
||||
<string name="delete">supprimer</string>
|
||||
<string name="deleteCapital">Supprimer</string>
|
||||
<string name="serviceStopped">Automation s\'arrête.</string>
|
||||
<string name="logServiceStopping">Arrêt du service.</string>
|
||||
<string name="stillGettingPosition">Géolocalisation en cours d\'acquisition</string>
|
||||
<string name="lastRule">Dernière règle:</string>
|
||||
<string name="at">à</string>
|
||||
<string name="service">Service:</string>
|
||||
<string name="getCurrentPosition">Acquérir la géolocalisation actuelle</string>
|
||||
<string name="savePoi">Enregistrer la géolocalisation</string>
|
||||
<string name="deletePoi">Supprimer la géolocalisation</string>
|
||||
<string name="latitude">Latitude</string>
|
||||
<string name="longitude">Longitude</string>
|
||||
<string name="ruleName">Nom de la règle</string>
|
||||
<string name="triggers">Déclencheur(s)</string>
|
||||
<string name="triggersComment">(tous les déclencheurs s\'appliqueront simultanément)</string>
|
||||
<string name="addTrigger">Ajouter une déclencheur</string>
|
||||
<string name="actions">Action(s)</string>
|
||||
<string name="actionsComment">(sera éxécuter dans cet ordre)</string>
|
||||
<string name="addAction">Ajouter une action</string>
|
||||
<string name="saveRule">Enregistrer la règle</string>
|
||||
<string name="monday">Lundi</string>
|
||||
<string name="tuesday">Mardi</string>
|
||||
<string name="wednesday">Mercredi</string>
|
||||
<string name="thursday">Jeudi</string>
|
||||
<string name="friday">Vendredi</string>
|
||||
<string name="saturday">Samedi</string>
|
||||
<string name="sunday">Dimanche</string>
|
||||
<string name="start">Démarrage</string>
|
||||
<string name="end">Arrêt</string>
|
||||
<string name="save">Enregistrer</string>
|
||||
<string name="urlToTrigger">URL à déclencher:</string>
|
||||
<string name="urlLegend">Variables:\nVous pouvez utiliser les variables suivantes. Lors du déclenchement, elles seront remplacées par les variables correspondantes sur votre appareil. Insérez les parenthèses dans votre texte.\n\n[uniqueid] - Identifiant unique de votre appareil\n[serialnr] - Numéro de série de votre appraeil (< Android 9)\n[latitude] - Latitude de votre appraeil\n[longitude] - Longitude de votre appraeil\n[phonenr] - Nombre des derniers appels entrants ou sortants\n[d] - Jour du mois, @ chiffres commençant par 0\n[m] - Valeur numérique du mois, avec @ chiffres\n[Y] - Valeur numérique de l\'année, $ chiffres\n[h] - Format horaire 12 heures, 2 chiffres\n[H] - Format horaire 24 heures, 2 chiffres\n[i] - Nombre de minutes, 2 chiffres\n[s] - Nombre de secondes, 2 chiffres\n[ms] - Nombre de milisecondes\n[notificationTitle] - tire de la dernière notification\n[notificationText] - texte de la dernière notification</string>
|
||||
<string name="wifi">wifi</string>
|
||||
<string name="activating">Allumer</string>
|
||||
<string name="deactivating">Éteindre</string>
|
||||
<string name="bluetoothFailed">Échec de l\'activation du Bluetooth. Votre appareil a le Bluetooth ?</string>
|
||||
<string name="urlTooShort">L\'url saisie doit être de 10 caractères minimum.</string>
|
||||
<string name="enterPhoneNumberAndText">Saisissez le numéro de télephone et le message.</string>
|
||||
<string name="selectTypeOfTrigger">Sélectionnez le type de déclencheur</string>
|
||||
<string name="entering">enterant</string>
|
||||
<string name="leaving">sortant</string>
|
||||
<string name="noPoisSpecified">Vous n\'avez pas spécifié de géolocalisation. Indiquez en une.</string>
|
||||
<string name="started">En charge</string>
|
||||
<string name="stopped">Hors charge</string>
|
||||
<string name="connected">connecté</string>
|
||||
<string name="disconnected">déconnecté</string>
|
||||
<string name="selectPoi">Sélectionnez une géolocalisation</string>
|
||||
<string name="selectTypeOfAction">Sélectionnez une action</string>
|
||||
<string name="selectSoundProfile">Sélectionnez une profil audio</string>
|
||||
<string name="whatToDoWithTrigger">Que faire avec le déclencheur ?</string>
|
||||
<string name="whatToDoWithAction">Que faire avec l\'action ?</string>
|
||||
<string name="radiusHasToBePositive">Le rayon doit être une valeur positive.</string>
|
||||
<string name="poiStillReferenced">Ceratines règles se réfèrent toujours à cette position (%1$s). Impossible de la supprimer maintenant.</string>
|
||||
<string name="generalSettings">Réglages généraux</string>
|
||||
<string name="startAtSystemBoot">Lancement au démarrage du système</string>
|
||||
<string name="onOff">On/Off</string>
|
||||
<string name="writeLogFile">Écriture du fichier de log</string>
|
||||
<string name="useTextToSpeechOnNormalSummary">Utiliser la synthèse vocale en mode sonnerie</string>
|
||||
<string name="useTextToSpeechOnVibrateSummary">Utiliser la synthèse vocale en mode vibreur</string>
|
||||
<string name="useTextToSpeechOnSilentSummary">Utiliser la synthèse vocale en mode silenceuse</string>
|
||||
<string name="useTextToSpeechOnNormalTitle">Synthèse vocale en sonnerie</string>
|
||||
<string name="useTextToSpeechOnVibrateTitle">Synthèse vocale en vibreur</string>
|
||||
<string name="useTextToSpeechOnSilentTitle">Synthèse vocale en silence</string>
|
||||
<string name="positioningSettings">Paramètre de géolocalisation</string>
|
||||
<string name="listenToWifiState">Écoute des changements d\'état du wifi si possible</string>
|
||||
<string name="wifiState">État du wifi</string>
|
||||
<string name="listenToAccelerometerState">Surveillance des mouvement de l\'appareil quand le wifi n\'est pas disponible</string>
|
||||
<string name="accelerometer">Accéléromètre</string>
|
||||
<string name="accelerometerTimer">Utilisation de l\'accéléromètre après x minutes sans changement de tour relais cellulaire</string>
|
||||
<string name="cellMastIdleTime">Temps d\'inactivité de la tour cellulaire</string>
|
||||
<string name="accelerometerThresholdDescription">Seuil limite pour les mouevments de laccéléromètre</string>
|
||||
<string name="accelerometerThreshold">Seuil de l\'accéléromètre</string>
|
||||
<string name="positioningThresholds">Seuil de positionnement</string>
|
||||
<string name="minimumDistanceChangeForGpsLocationUpdates">Changement de distance minimum pour les mises à jour de la localisation GPS</string>
|
||||
<string name="distanceForGpsUpdate">Distance pour la mise à jour du GPS [m]</string>
|
||||
<string name="minimumDistanceChangeForNetworkLocationUpdates">Changement de distance minimum pour les mises à jour de la localisation par le réseau cellulaire</string>
|
||||
<string name="distanceForNetworkUpdate">Distance pour la mise à jour du réseau [m]</string>
|
||||
<string name="satisfactoryAccuracyGps">Précision acceptable en mètres lors de l\'acquisition de la localisation par GPS</string>
|
||||
<string name="gpsAccuracy">Précision du GPS [m]</string>
|
||||
<string name="satisfactoryAccuracyNetwork">Précision acceptable en mètres lors de l\'acquisition de la localisation par les relais téléphoniques</string>
|
||||
<string name="networkAccuracy">Précision du réseau [m]</string>
|
||||
<string name="minimumTimeForLocationUpdates">Variation minimale du temps en millisecondes pour les mises à jour de localisation</string>
|
||||
<string name="timeForUpdate">Délais de mise à jour [millisecondes]</string>
|
||||
<string name="soundSettings">Réglages audio</string>
|
||||
<string name="showHelp">Afficher l\'aide</string>
|
||||
<string name="rules">Règles</string>
|
||||
<string name="helpTextRules">Tous les déclencheurs d\'une règle sont reliés par un lien logique ET. La règle ne s\'applique que si tous les déclencheurs sont satisfaits. Si vous voulez une lien logique OU, créez une autre règle.</string>
|
||||
<string name="timeframes">Délais d\'éxécution</string>
|
||||
<string name="helpTextTimeFrame">Si vous créez une règle avec une période d\'éxécution vous avez deux options. Vous pouvez choisir d\'éxécuter dans la période OU hors de la période. Quel que soit votre choix l\'\action ne sera déclenchée qu\'une seule fois. Si vous créez une règle qui une déclencheur \"dans une période xyz\" qui modifie votre profil audio en le passant en mode vibreur cela ne signifie pas que votre téléphone repassera automatiquement en mode sonnerie à la fin de la période. Si vous souhaitez le faire vous devez définir une autre règle avec une autre période.</string>
|
||||
<string name="helpTextSound">Sur l\'écran principal vous pouvez utiliser le vérouillage des modifications audio pour temporairement ne pas utiliser les règles de changement des paramètres audio. Par exmple vous pouvez 6etre dans une encroit ou à un moment où les sonneries peuvent être dérangeantes. Cette fonctionnalité se désactivera automatiquement une fois le temps configuré écoulé. Cliquez sur le bouton +15 min pour ajouter la durée souhaitée. Une fois activé vous pouvez le désactiver en appuyant sur le bouton \"OUI\" (ainsi la règle de gestion des paramètres audio sera de nouveau active).</string>
|
||||
<string name="toggableRules">Inverser la règle</string>
|
||||
<string name="helpTextToggable">Les règles ont un indicateur appelé \"Inversion"\. Cela signifie que si une règle est exécutée et qu\'ensuite les mêmes déclencheurs s\'appliquent à nouveau, la règle sera exécutée dans un mode opposé. Pour l\'instant, cela n\'est possible qu'avec les étiquettes NFC. Si vous les touchez deux fois et qu\'il y a un inverseur associé, cela fera l\'inverse de la situation actuelle, par exemple désactiver le wifi s\'il est actuellement actif.</string>
|
||||
<string name="helpTextProcessMonitoring">Si vous spécifiez une règle avec une surveillance de processus, l\'application vérifira ce processus toutes les x secondes (vous pouvez modifier cette variable dans les réglages). Je sais que ça peut être un peu lent, mais un contrôle continu viderait la batterie trop vite. Et il n\'y a pas de transmission de l\'OS pour cet événement.</string>
|
||||
<string name="helpTitleEnergySaving">Économie d\'énergie</string>
|
||||
<string name="helpTextEnergySaving">Beaucoup de fabriquants d\'appareil Android essaient d\'économiser en limitant les activités des applications en tâches de fond. Malheureusement cela signifie souvent ques ces applications ne fonctionnent pas correctement, Automation en fait partie. Consultez cette <a href="https://dontkillmyapp.com/">page weeb</a> pour savoir comment exclure Automation de ces restrictions.</string>
|
||||
<string name="speedMaximumTimeBetweenLocations">Durée maximale entre 2 géolocalisations pour le détermination de la vitesse.</string>
|
||||
<string name="speedMaximumTime">Durée en minutes</string>
|
||||
<string name="exceeds">au dessus de </string>
|
||||
<string name="dropsBelow">en dessous de</string>
|
||||
<string name="settingsCategoryNoiseLevelMeasurements">Mesure du niveau sonore</string>
|
||||
<string name="timeBetweenNoiseLevelMeasurementsSummary">Temps en secondes entre les mesures du niveau sonore</string>
|
||||
<string name="timeBetweenNoiseLevelMeasurementsTitle">Temps en secondes entre les mesures du niveau sonore</string>
|
||||
<string name="lengthOfNoiseLevelMeasurementsSummary">Durée en seconde pour chaque mesure de niveau sonore</string>
|
||||
<string name="lengthOfNoiseLevelMeasurementsTitle">Durée en seconde pour chaque mesure de niveau sonore</string>
|
||||
<string name="referenceValueForNoiseLevelMeasurementsSummary">Valeur de référence physique pour la mesure du niveau sonore</string>
|
||||
<string name="referenceValueForNoiseLevelMeasurementsTitle">Référence pour la mesure du niveau sonore</string>
|
||||
<string name="logLevelSummary">Niveau de log (1=minimum, 5=maximum)</string>
|
||||
<string name="logLevelTitle">Niveau de log</string>
|
||||
<string name="ruleActive">Règle active</string>
|
||||
<string name="triggerPointOfInterest">Géolocalisation</string>
|
||||
<string name="triggerTimeFrame">Délai</string>
|
||||
<string name="triggerCharging">Batterie en charge</string>
|
||||
<string name="triggerUsb_host_connection">Connexion USB à un ordinateur</string>
|
||||
<string name="triggerSpeed">Vitesse</string>
|
||||
<string name="triggerNoiseLevel">Niveau du bruit de fond</string>
|
||||
<string name="actionSetWifi">Wifi</string>
|
||||
<string name="actionSetBluetooth">Bluetooth</string>
|
||||
<string name="actionSetUsbTethering">connexion USB</string>
|
||||
<string name="actionSetWifiTethering">connexion wifi</string>
|
||||
<string name="actionSetBluetoothTethering">connexion Bluetooth</string>
|
||||
<string name="actionSetDisplayRotation">Rotation de l\'écran</string>
|
||||
<string name="actionTurnWifiOn">allumer le Wifi</string>
|
||||
<string name="actionTurnWifiOff">eteindre le Wifi</string>
|
||||
<string name="actionTurnBluetoothOn">allumer le Bluetooth</string>
|
||||
<string name="actionTurnBluetoothOff">\'eteindre le Bluetooth</string>
|
||||
<string name="actionTriggerUrl">Atteindre une URL</string>
|
||||
<string name="actionChangeSoundProfile">Changer de profil audio</string>
|
||||
<string name="actionTurnUsbTetheringOn">activer la connexion USB</string>
|
||||
<string name="actionTurnUsbTetheringOff">éteindre la connexion USB</string>
|
||||
<string name="actionTurnWifiTetheringOn">activer la connexion Wifi</string>
|
||||
<string name="actionTurnWifiTetheringOff">éteindre la connexion Wifi</string>
|
||||
<string name="actionTurnBluetoothTetheringOn">Activer la connexion Bluetooth</string>
|
||||
<string name="actionTurnBluetoothTetheringOff">éteindre la connexion Bluetooth</string>
|
||||
<string name="actionTurnAirplaneModeOn">activer le mode avion</string>
|
||||
<string name="actionTurnAirplaneModeOff">désactiver le mode avion</string>
|
||||
<string name="actionEnableScreenRotation">activer la rotation de l\'écran</string>
|
||||
<string name="actionDisableScreenRotation">désactiver la rotation de l\'écran</string>
|
||||
<string name="screenRotationEnabled">Rotation de l\'écran active.</string>
|
||||
<string name="screenRotationDisabled">Rotation de l\'écran inactive.</string>
|
||||
<string name="screenRotationAlreadyEnabled">Rotation de l\'écran déjà active.</string>
|
||||
<string name="screenRotationAlreadyDisabled">Rotation de l\'écran déjà inactive.</string>
|
||||
<string name="noPoisDefinedShort">Aucune géolocalisation définie.</string>
|
||||
<string name="activePoi">Géolocalisation active:</string>
|
||||
<string name="closestPoi">Géolocalisation proche:</string>
|
||||
<string name="overview">Aperçu</string>
|
||||
<string name="poi">Géolocalisation</string>
|
||||
<string name="pois">\Geolocalisations</string>
|
||||
<string name="helpTextPoi">Une géolocalisation est définie par des coordonnées GPS et un rayon. La géolocalisation par les antennes relais téléphonique est plutôt imprécise (mais rapide et peu gourmande en data) ne définissez pas un rayon trop petit. L\'application vous indiquera un rayon minimal lors de la création d\'une géolocalisation.</string>
|
||||
<string name="serviceNotRunning">Le service n\'est pas actif.</string>
|
||||
<string name="general">Général</string>
|
||||
<string name="generalText">Pour utiliser cette application vous devez définir des règles, qui contiennent des déclencheur, par exemple si vous êtes dans un endroit précis ou à une certaine heure. Une fois cela fait, cliquez sur le bouton on/off sur l\'écran principal.</string>
|
||||
<string name="failedToTriggerBluetooth">Impossible de lancer le Bluetooth. Votre appraeil a le BluetoothFailed to trigger Bluetooth. ?</string>
|
||||
<string name="startServiceAfterAppUpdate">Redémarrer le service après une mise à jour si l\'application fonctionnait avant.</string>
|
||||
<string name="startServiceAfterAppUpdateShort">Démarrer le service après une mise à jour</string>
|
||||
<string name="wifiConnection">connexion Wifi</string>
|
||||
<string name="wifiName">Nom du Wifi</string>
|
||||
<string name="enterWifiName">Saisissez le nom d\'un réseau Wifi. Laissez vide pour n\'importe quel réseau.</string>
|
||||
<string name="cancel">Annuler</string>
|
||||
<string name="starting">démarrer</string>
|
||||
<string name="stopping">arrêter</string>
|
||||
<string name="connecting">connecter</string>
|
||||
<string name="disconnecting">déconnecté</string>
|
||||
<string name="exceeding">au dessus</string>
|
||||
<string name="droppingBelow">en dessous</string>
|
||||
<string name="connectedToWifi">connecté au Wifi \"%1$s\"</string>
|
||||
<string name="disconnectedFromWifi">déconnecté du Wifi \"%1$s\"</string>
|
||||
<string name="anyWifi">tous les réseaux wifi</string>
|
||||
<string name="cantStopIt">impossible à arrêter.</string>
|
||||
<string name="settingsCategoryHttp">requêtes HTTP(s)</string>
|
||||
<string name="httpAcceptAllCertificatesTitle">Acceptez tous les certificats</string>
|
||||
<string name="httpAcceptAllCertificatesSummary">Passer le contrôle de validité des certificats SSL (non recommandé)</string>
|
||||
<string name="httpAttemptsSummary">Nombre d\'essais suite à des problèmes de connectivité des requêtes HTTP</string>
|
||||
<string name="httpAttemptsTitle">Nombre d\'essais HTTP</string>
|
||||
<string name="httpAttemptsTimeoutSummary">Délais d\'expiration des requêtes HTTP</string>
|
||||
<string name="httpAttemptsTimeoutTitle">Délais d\'expiration [sec]</string>
|
||||
<string name="httpAttemptGapSummary">Délais avant le prochain essais [secondes]</string>
|
||||
<string name="httpAttemptGapTitle">Pause [sec]</string>
|
||||
<string name="runManually">Lancer manuellement</string>
|
||||
<string name="serviceHasToRunForThat">Le service doit être actif pour cette action.</string>
|
||||
<string name="gpsComparison">Comparaison GPS</string>
|
||||
<string name="timeoutForGpsComparisonsTitle">Délais d\'expiration GPS [sec]</string>
|
||||
<string name="timeoutForGpsComparisonsSummary">Durée maximum en secondes de comparaison des positions GPS. Si le délais est dépassé, la dernière position connue sera utilisée.</string>
|
||||
<string name="rememberLastActivePoiSummary">Si vous vous trouvez dans un lieu, que vous redémarrez votre appareil ou l\'application et que vous quittez ce lieu, l\'application exécutera les règles associées au dernier lieu connu lors de son prochain démarrage.</string>
|
||||
<string name="rememberLastActivePoiTitle">Se souvenir de la dernière position active</string>
|
||||
<string name="muteTextToSpeechDuringCallsTitle">Couper le son durant les appels</string>
|
||||
<string name="muteTextToSpeechDuringCallsSummary">Couper la synthèse vocale durant les appels</string>
|
||||
<string name="anotherPoiByThatName">Une autre géolocalisation possède le même nom.</string>
|
||||
<string name="anotherRuleByThatName">Une autre règle possède le même nom.</string>
|
||||
<string name="startOtherActivity">Démarrer un autre programme</string>
|
||||
<string name="selectApplication">Selectionnez une application</string>
|
||||
<string name="selectPackageOfApplication">Selectionnez le paquet de l\'application</string>
|
||||
<string name="selectActivityToBeStarted">Selectionnez l\'activité du paquet choisit</string>
|
||||
<string name="errorStartingOtherActivity">Erreur de démarrage d\'une autre activité</string>
|
||||
<string name="anotherAppIsRunning">Démarrage/arrêt d\'une application</string>
|
||||
<string name="settingsCategoryProcessMonitoring">Surveillance des processus</string>
|
||||
<string name="timeBetweenProcessMonitoringsTitle">Intervalle en secondes entre deux surveillances des processus</string>
|
||||
<string name="timeBetweenProcessMonitoringsSummary">Plus la valeur est basse, plus l\'utilisation de la batterie est élevée</string>
|
||||
<string name="processes">Processus</string>
|
||||
<string name="processMonitoring">Surveillance des processus</string>
|
||||
<string name="settings">Réglages</string>
|
||||
<string name="settingsErased">Effacer les réglages.</string>
|
||||
<string name="settingsSetToDefault">Réinitialiser les réglages.</string>
|
||||
<string name="batteryLevel">Niveau de la batterie</string>
|
||||
<string name="selectSpeed">Sélectionnez la vitesse</string>
|
||||
<string name="selectBattery">Sélectionnez le niveau de batterie</string>
|
||||
<string name="privacy">Politique de confidentialité</string>
|
||||
<string name="privacyConfirmationText">Ouverture du navigateur internet et chargement de la politique de confidentialité depuis le site web du développeur.</string>
|
||||
<string name="waitBeforeNextAction">Attente avant la prochaine action</string>
|
||||
<string name="wakeupDevice">Réveil</string>
|
||||
<string name="waitBeforeNextActionEnterValue">Saisissez la durée en miliseccondes du délais d\'attente avant la prochaine action.</string>
|
||||
<string name="wakeupDeviceValue">Saisissez la durée en milisecondes durant laquelle le téléphone doit rester actif.La valeur par défaut est 0.</string>
|
||||
<string name="enterAPositiveValidNonDecimalNumber">Entrez une valeur sans décimale positive.</string>
|
||||
<string name="moveUp">Monter</string>
|
||||
<string name="moveDown">Déscendre</string>
|
||||
<string name="cantMoveUp">Impossible de déplacer l\'objet en haut. Il est déjà tout en haut.</string>
|
||||
<string name="cantMoveDown">Impossible de déplacer l\'objet en bas. Il est déjà tout en bas.</string>
|
||||
<string name="airplaneMode">Mode avion</string>
|
||||
<string name="activate">Activatation</string>
|
||||
<string name="deactivate">Désactivation</string>
|
||||
<string name="airplaneModeSdk17Warning">Depuis la version 4.2 d\'Android cette fonctionnalité requiert un téléphone rooté.</string>
|
||||
<string name="addIntentValue">ajouter Intent pair</string>
|
||||
<string name="parameterName">Nom du paramètre</string>
|
||||
<string name="parameterValue">Valeur du paramètre</string>
|
||||
<string name="parameterType">Type du paramètre</string>
|
||||
<string name="selectTypeOfIntentPair">Selectionnew le type d\'intent pair.</string>
|
||||
<string name="enterNameForIntentPair">Saisissez un nom pourl\'intent pair.</string>
|
||||
<string name="enterValueForIntentPair">Saisissez une valeur pour l\'intent pair.</string>
|
||||
<string name="whatToDoWithIntentPair">Que faire avec le pair?</string>
|
||||
<string name="gettingListOfInstalledApplications">Création de liste des applications...</string>
|
||||
<string name="timeFrameWhichDays">Quels jours ?</string>
|
||||
<string name="insideOrOutsideTimeFrames">Dans ou hors du délais ?</string>
|
||||
<string name="selectToggleDirection">Allumer ou éteindre ?</string>
|
||||
<string name="name">Nom</string>
|
||||
<string name="radiusWithUnit">Rayon [m]</string>
|
||||
<string name="status">Statut</string>
|
||||
<string name="actionDataConnection">Réseau mobile</string>
|
||||
<string name="actionSetDataConnectionOn">Activer le réseau mobile</string>
|
||||
<string name="actionSetDataConnectionOff">Désactiver le réseau mobile</string>
|
||||
<string name="roaming">Itinérance</string>
|
||||
<string name="activated">activaté</string>
|
||||
<string name="deactivated">désactivé</string>
|
||||
<string name="until">jusqu\'à</string>
|
||||
<string name="application">Application</string>
|
||||
<string name="is">est</string>
|
||||
<string name="phoneCall">Appel téléphonique</string>
|
||||
<string name="with">avec</string>
|
||||
<string name="phoneNumber">Numéro de téléphone</string>
|
||||
<string name="enterPhoneNumber">Saisissez un numéro de téléphone. Laissez vide pour n\'importe quel numéro.</string>
|
||||
<string name="phoneDirection">Sélectionnez le type \nd\'appel</string>
|
||||
<string name="any">tout</string>
|
||||
<string name="incoming">entrant</string>
|
||||
<string name="outgoing">sortant</string>
|
||||
<string name="incomingAdjective">entrant</string>
|
||||
<string name="outgoingAdjective">sortant</string>
|
||||
<string name="anyNumber">tous les numéros</string>
|
||||
<string name="number">numéro</string>
|
||||
<string name="nfcTag">Tag NFC</string>
|
||||
<string name="closeTo">proche de</string>
|
||||
<string name="withLabel">avec une étiquette</string>
|
||||
<string name="deviceDoesNotHaveNfc">Il semble que votre apprail n\'est pas de NFC.</string>
|
||||
<string name="nfcReadTag">Lire l\'identité depuis le tag</string>
|
||||
<string name="nfcWriteTag">Écrire le tag</string>
|
||||
<string name="nfcEnterValidIdentifier">Saisissez un identifiant valide pour le tag (comme \"Porte d\'entrée\").</string>
|
||||
<string name="nfcTagWrittenSuccessfully">Succès d\'écriture du Tag.</string>
|
||||
<string name="nfcTagWriteError">Erreur d\'écriture du Tag. Est il à porté?</string>
|
||||
<string name="nfcTagDiscovered">Tag trouvé.</string>
|
||||
<string name="nfcBringTagIntoRange">Tag NFC à portée.</string>
|
||||
<string name="nfcTagFoundWithText">Tag trouvé:</string>
|
||||
<string name="nfcUnsupportedEncoding">Codage non supporté:</string>
|
||||
<string name="nfcNoNdefIntentBut">Aucun NFC NDEF atteint, mais</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC non encore supporté dans cette version Android.</string>
|
||||
<string name="cantRunRule">Impossible d\'éxécuter les règles.</string>
|
||||
<string name="nfcApplyTagToRule">Affecter le Tag à la règle</string>
|
||||
<string name="nfcTagReadSuccessfully">Succès de lecture du Tag.</string>
|
||||
<string name="nfcValueNotSuitable">Valeur stockée ne convient pas.</string>
|
||||
<string name="nfcNoTag">Aucun Tag présent.</string>
|
||||
<string name="newNfcId">Écriture d\'une nouvelle identitié NFC</string>
|
||||
<string name="useExistingTag">Utilisation d\'un Tag NFC existant</string>
|
||||
<string name="newId">Nouvelle identité:</string>
|
||||
<string name="currentId">Identité actuelle:</string>
|
||||
<string name="nfcTagDataNotUsable">Données du Tag inutilisable, écrivez en un nouveau.</string>
|
||||
<string name="nfcBringTagIntoRangeToRead">Approcher un tag pour le lire.</string>
|
||||
<string name="toggleRule">Changer de règle</string>
|
||||
<string name="toggling">Changement</string>
|
||||
<string name="toggle">changer</string>
|
||||
<string name="overlapBetweenPois">Chevauchement de géolocalisation %1$s de %2$s mètres. Réduisez le rayon.</string>
|
||||
<string name="none">aucun</string>
|
||||
<string name="anyLocation">n\'importe quelle géolocalisation</string>
|
||||
<string name="invalidPoiName">Nom invalide pour une géolocalisation.</string>
|
||||
<string name="eraseSettings">Effacer les réglages</string>
|
||||
<string name="defaultSettings">Réglages par défaut</string>
|
||||
<string name="areYouSure">Êtes vous sûr?</string>
|
||||
<string name="activityDetection">Détection d\'activité</string>
|
||||
<string name="android.permission.ACTIVITY_RECOGNITION">Détection d\'activité</string>
|
||||
<string name="detectedActivity">Activité détectée:</string>
|
||||
<string name="detectedActivityInVehicle">Dans un véhicule (voiture/bus)</string>
|
||||
<string name="detectedActivityOnBicycle">En vélo</string>
|
||||
<string name="detectedActivityOnFoot">À pied</string>
|
||||
<string name="detectedActivityStill">Encore</string>
|
||||
<string name="detectedActivityUnknown">Inconnu</string>
|
||||
<string name="detectedActivityTilting">Inclinaison</string>
|
||||
<string name="detectedActivityWalking">Marche</string>
|
||||
<string name="detectedActivityRunning">Course</string>
|
||||
<string name="detectedActivityInvalidStatus">Activité non valide</string>
|
||||
<string name="selectTypeOfActivity">Sélectionnez le type d\'activité</string>
|
||||
<string name="triggerOnlyAvailableIfPlayServicesInstalled">Ce déclencheur n\'est disponible que si les services Google sont installés.</string>
|
||||
<string name="activityDetectionFrequencyTitle">Fréquence de détection de l\'activité [sec]</string>
|
||||
<string name="activityDetectionFrequencySummary">Secondes entre les tentatives de détection de l\'activité.</string>
|
||||
<string name="activityDetectionRequiredProbabilityTitle">Probabilité de détection de l\'activité</string>
|
||||
<string name="activityDetectionRequiredProbabilitySummary">Degré de certitude à partir duquel les activités sont acceptées comme des faits.</string>
|
||||
<string name="incomingCallFrom">Appel entrant de %1$s.</string>
|
||||
<string name="outgoingCallTo">Appel sortant vers %1$s.</string>
|
||||
<string name="actionSpeakText">Synthèse vocale</string>
|
||||
<string name="textToSpeak">Texte à lire</string>
|
||||
<string name="toggleNotAllowed">L\'inversion de règle n\'est autorisé que pour les règles basés sur un déclencheur NFC.</string>
|
||||
<string name="errorReadingPoisAndRulesFromFile">Erreur de lecture des géolocalisation et des règles depuis le fichier.</string>
|
||||
<string name="noDataChangedReadingAnyway">Les modifications n\'ont aps éte enregistrées. Cependant, il peut y avoir eu des changements dans la mémoire qui doivent être rechargés. Relecture du fichier.</string>
|
||||
<string name="bluetoothConnection">connexion Bluetooth</string>
|
||||
<string name="bluetoothConnectionTo">connexion Bluetooth à %1$s</string>
|
||||
<string name="bluetoothDisconnectFrom">connexion Bluetooth à %1$s perdue</string>
|
||||
<string name="bluetoothDeviceInRange">Dispositif Bluetooth %1$s à portée.</string>
|
||||
<string name="bluetoothDeviceOutOfRange">Dispositif Bluetooth %1$s hors de portée.</string>
|
||||
<string name="anyDevice">n\'importe quel appareil</string>
|
||||
<string name="noDevice">aucun appareil</string>
|
||||
<string name="selectDeviceFromList">sélectionnez un appareil</string>
|
||||
<string name="connectionToDevice">connexion à l\'appareil</string>
|
||||
<string name="disconnectionFromDevice">déconnexion de l\'appareil</string>
|
||||
<string name="deviceInRange">appareil à portée</string>
|
||||
<string name="deviceOutOfRange">appareil hors de portée</string>
|
||||
<string name="selectDeviceOption">Choisissez une option.</string>
|
||||
<string name="selectConnectionOption">Choissez une option de connexion.</string>
|
||||
<string name="triggerHeadsetPlugged">Connection écouteurs</string>
|
||||
<string name="actionPlayMusic">Lancer le lecteur de musique</string>
|
||||
<string name="headsetConnected">Écouteurs (type: %1$s) est connecté</string>
|
||||
<string name="headsetDisconnected">Écouteurs (type: %1$s) est déconnecté</string>
|
||||
<string name="headphoneSimple">Écouteurs</string>
|
||||
<string name="headphoneMicrophone">Microphone</string>
|
||||
<string name="headphoneAny">Tous</string>
|
||||
<string name="headphoneSelectType">Choisissez le type d\'écouteurs</string>
|
||||
<string name="whatsThis">Qu\'est ce que c\'est?</string>
|
||||
<string name="privacyLocationingTitle">Géolocalisation privée uniquement</string>
|
||||
<string name="privacyLocationingSummary">Empêcher les méthodes de géolocalisation d\'envoyer vos données, par exemple à Google. Cette fonction utilise uniquement le GPS et peut donc être lente ou ne pas fonctionner de manière fiable.</string>
|
||||
<string name="noiseDetectionHint">Si vous pensez que la détection du bruit ne fonctionne pas correctement (en fonction de la valeur que vous avez défini) gardez à l\'esprit que chaque téléphone est différent. Cependant vous pouvez changer You can therefore change la \"Référence de mesure du bruit\" dans les réglages. Visitez http://fr.wikipedia.org/wiki/Decibel pour plus d\'informations. Vous pouvez utiliser le calibrateur de volume à partir de l\'écran principal pour calibrer votre appareil.</string>
|
||||
<string name="hint">Indication</string>
|
||||
<string name="selectNoiseLevel">Choisissez le niveau sonore</string>
|
||||
<string name="showOnMap">Montrer sur la carte</string>
|
||||
<string name="noMapsApplicationFound">Aucune application de géolocalisation trouvée sur votre téléphone.</string>
|
||||
<string name="locationEngineNotActive">Géolocalisation non activée.</string>
|
||||
<string name="addProfile">Ajouter un profil</string>
|
||||
<string name="profile">profil</string>
|
||||
<string name="soundMode">Mode audio</string>
|
||||
<string name="volumes">Volumes</string>
|
||||
<string name="incomingCallsRingtone">Sonnerie des appels entrants</string>
|
||||
<string name="notificationRingtone">Sonnerie des notifications</string>
|
||||
<string name="hapticFeedback">Vibration au toucher</string>
|
||||
<string name="volumeMusicVideoGameMedia">Musiques, vidéos, jeux and autres médias</string>
|
||||
<string name="volumeRingtoneNotifications">Sonnerie et notifications</string>
|
||||
<string name="volumeAlarms">Alarmes</string>
|
||||
<string name="change">Changement</string>
|
||||
<string name="audibleSelection">Son de sélection (son émis lors d\'une sélection à l\'écran)</string>
|
||||
<string name="screenLockUnlockSound">Son de vérouillage/dévérouillage de l\'écran</string>
|
||||
<string name="vibrateWhenRinging">Sonnerie et vibration</string>
|
||||
<string name="profiles">profils</string>
|
||||
<string name="soundModeNormal">Normal</string>
|
||||
<string name="soundModeVibrate">Vibration</string>
|
||||
<string name="soundModeSilent">Silence</string>
|
||||
<string name="enterAname">Entrez un nom.</string>
|
||||
<string name="noChangeSelectedProfileDoesntMakeSense">Pas de changement sélectionné. Le profil n\'a pas de sens.</string>
|
||||
<string name="noProfilesCreateOneFirst">Aucun profil audio dans votre configuration. Créez en un.</string>
|
||||
<string name="errorActivatingProfile">Erreur d\'activation du profil:</string>
|
||||
<string name="anotherProfileByThatName">Un porfile portant le même nom existe déjà.</string>
|
||||
<string name="invalidProfileName">Nom de profil invalide.</string>
|
||||
<string name="errorWritingFile">Erreur d\'enregistrement des paramètres.</string>
|
||||
<string name="unknownError">Erreur inconnue.</string>
|
||||
<string name="noWritableFolderFound">Aucun dossier accessible en écriture pour enregistrer le fichier de configuration.</string>
|
||||
<string name="usbTetheringFailForAboveGingerbread">Cela ne fonctionnera pas si votre version d\'Adnroid est inférieure à 2.3.Vous pouvez utiliser le réseau Wifi à la place.</string>
|
||||
<string name="usingNewThreadForRuleExecution">Utilisation d\'un nouveau flux pour l\'activation de la règle.</string>
|
||||
<string name="startNewThreadForRuleExecution">Démarrage d\'un nouveau flux pour l\'activation de la règle.</string>
|
||||
<string name="newThreadRules">Nouveau flux</string>
|
||||
<string name="showIcon">Montrer l\'icône</string>
|
||||
<string name="showIconWhenServiceIsRunning">Montrer l\'icône lorsque l\'application fonctionne (la cacher ne fonctionne que pour les version en dessous d\'Android 7). Si votre version est supérieure, allez dans les paramètres système, puis Automation, désactivez les notifications.</string>
|
||||
<string name="ruleHistory">Historique des règles (la plus récente en premier):</string>
|
||||
<string name="someOptionsNotAvailableYet">Certaines fonctionnalités sont désactivées et ne peuvent pas être utilisées pour le moment. Elles seront activés dans une version ultérieure.</string>
|
||||
<string name="lockSoundChanges">Voir les modifications de son</string>
|
||||
<string name="noProfileChangeSoundLocked">Le profil ne sera pas activé. Le dernier profil actif est vérouillé.</string>
|
||||
<string name="currentVolume">Volume actuel</string>
|
||||
<string name="enterValidReferenceValue">Saisissez une valeur de référence valide.</string>
|
||||
<string name="volumeTest">Étalonnage du volume</string>
|
||||
<string name="volumeCalibrationExplanation">Pour calculer une valeur en dB pour la surveillance du bruit, vous devez spécifier une valeur de référence dite physique. Veuillez lire Wikipedia pour plus d\'informations. Cette valeur est très probablement différente pour chaque téléphone. Faites glisser la barre pour modifier la valeur de référence physique définie. Plus la valeur de référence est élevée, plus la valeur en dB sera faible. Des mesures constantes seront effectuées toutes les %1$s secondes et les résultats seront affichés ci-dessous. Appuyez sur la touche retour lorsque vous avez trouvé une valeur appropriée.</string>
|
||||
<string name="settingsWillTakeTime">Certains réglages ne seront actifs qu\'après la modifications de certains réglages d\'environnement ou le redémarrage de l\'application.</string>
|
||||
<string name="rootExplanation">Vous devez rooté votre téléphone pour que cette action fonctionne. Ensuite, vous devez \"exécuter la règle manuellement\" pour faire apparaître la question de l\'autorisation du superutilisateur. Lorsque la fenêtre du super-utilisateur s\'affiche, vous devez toujours autoriser l\'application à le faire. Sinon, la règle ne peut pas fonctionner lorsque le téléphone est sans surveillance.</string>
|
||||
<string name="errorWritingConfig">Erreur lors de l\'écriture de la configuration. Avez vous les droits d\'écriture ?</string>
|
||||
<string name="phoneNrReplacementError">Absence de dernier numéro de téléphone, impossible de l\'insérer dans la variable..</string>
|
||||
<string name="username">Nom d\'utilisateur</string>
|
||||
<string name="password">Mot de passe</string>
|
||||
<string name="useAuthentication">Authentification</string>
|
||||
<string name="permissionsTitle">Permissions requises</string>
|
||||
<string name="permissionsExplanation">Explication des autorisations requises</string>
|
||||
<string name="ok">Ok</string>
|
||||
<string name="disabledFeatures">Désactiver les fonctionnalités</string>
|
||||
<string name="theFollowingPermissionsHaveBeenDenied">Les permissions suivantes n\'ont pas été autorisées :</string>
|
||||
<string name="permissionsExplanationGeneric">L\'application fonctionne actuellement en mode limité et a désactivé certaines fonctionnalités. Pour fonctionner pleinement, elle nécessite des autorisations. Si vous voulez utiliser toutes les fonctionnalités, vous devez accorder les permissions dans les boites de dialogues suivantes. Si vous ne le faites pas, certaines règles ne pourront pas être exécutées. Dans ce qui suit, vous trouverez une explication des permissions demandées. Cliquez sur "continuer", lorsque vous êtes prêt à poursuivre..</string>
|
||||
<string name="permissionsExplanationSmall">Pour utiliser cette fonctionnalité vous devez accorder plus de permissions. Cliquez sur continuer.</string>
|
||||
<string name="continueText">continuer</string>
|
||||
<string name="rule">Règle</string>
|
||||
<string name="storeSettings">Lire et stocker les réglages</string>
|
||||
<string name="featuresDisabled">ATTENTION: les fonctionnalités sont désactivées, Automation fonctionne en mode limité. Cliquer ici pour plus d\'informations.</string>
|
||||
<string name="ruleLegend">Vert = actif, rouge = inactif, jaune = permissions manquantes</string>
|
||||
<string name="systemSettingsNote1">Il faut la permission de modifier les paramètres de l\'OS (même pour des choses basiques comme activer le Wifi ou le Bluetooth). Après avoir appuyé sur "continue" une fenêtre s\'affichera, vous devez alors donner l\'autorisation.Ensuite cliquez sur le bouton retour.</string>
|
||||
<string name="systemSettingsNote2">D\'autres autoristaions seront demandées dans une seconde fenêtre.</string>
|
||||
<string name="appRequiresPermissiontoAccessExternalStorage">Automation doit accéder au stockage externe pour lire les paramètres et les règless.</string>
|
||||
<string name="mainScreenPermissionNote">Automation a besoin de plus d\'autorisation pour pleinement fonctionner. Cliquez sur ce texte pour en savoir plus et les accorder.</string>
|
||||
<string name="invalidDevice">Appareil non valide</string>
|
||||
<string name="logFileMaxSizeSummary">Taille maximum du journal de log en Mégabyte.</string>
|
||||
<string name="logFileMaxSizeTitle">Taille maximum du journal de log [Mb]</string>
|
||||
<string name="android.permission.READ_CALL_LOG">Accéder au journal des appels</string>
|
||||
<string name="android.permission.READ_CALENDAR">Accéder aux enrées du calendrier</string>
|
||||
<string name="android.permission.ACCESS_FINE_LOCATION">Accéder à la position précise</string>
|
||||
<string name="android.permission.ACCESS_COARSE_LOCATION">Accéder à la position approximative</string>
|
||||
<string name="readLocation">Accéder à la position</string>
|
||||
<string name="android.permission.INTERNET">Envoyer des données via le réseau cellulaire</string>
|
||||
<string name="android.permission.ACCESS_NETWORK_STATE">Consulter l\'état du réseau</string>
|
||||
<string name="android.permission.ACCESS_WIFI_STATE">Consulter l\'état du Wifi</string>
|
||||
<string name="android.permission.BLUETOOTH">Modifier les paramètres Bluetooth</string>
|
||||
<string name="android.permission.BLUETOOTH_ADMIN">Modifier les paramètres Bluetooth</string>
|
||||
<string name="android.permission.NFC">Utiliser le NFC</string>
|
||||
<string name="android.permission.VIBRATE">Activer le vibreur</string>
|
||||
<string name="android.permission.WAKE_LOCK">Garder le téléphone actif</string>
|
||||
<string name="android.permission.MODIFY_AUDIO_SETTINGS">Modifier les paramètres de son</string>
|
||||
<string name="android.permission.RECORD_AUDIO">Enregistrer l\'audio</string>
|
||||
<string name="android.permission.PROCESS_OUTGOING_CALLS">Détecter les appels sortants</string>
|
||||
<string name="android.permission.MODIFY_PHONE_STATE">Modifier les paramètres du téléphone</string>
|
||||
<string name="android.permission.READ_PHONE_STATE">Détecter l\'état du téléphone</string>
|
||||
<string name="android.permission.READ_EXTERNAL_STORAGE">Lire la mémoire</string>
|
||||
<string name="android.permission.WRITE_EXTERNAL_STORAGE">Ëcrire dans la méemoire</string>
|
||||
<string name="android.permission.GET_TASKS">Détecter les processus actifs</string>
|
||||
<string name="android.permission.WRITE_SETTINGS">Modifier les paramètres du téléphone</string>
|
||||
<string name="android.permission.RECEIVE_BOOT_COMPLETED">Détecter le redémarrage du téléphone</string>
|
||||
<string name="android.permission.WRITE_SECURE_SETTINGS">Modifier les paramètres du téléphone</string>
|
||||
<string name="android.permission.BATTERY_STATS">Lire l\'état de la batterie</string>
|
||||
<string name="android.permission.CHANGE_BACKGROUND_DATA_SETTING">Modifier la connexion</string>
|
||||
<string name="android.permission.SEND_SMS">Envoyer des messages</string>
|
||||
<string name="android.permission.READ_CONTACTS">Accéder aux contacts</string>
|
||||
<string name="android.permission.ACCESS_NOTIFICATION_POLICY">Remplacer le mode "ne pas déranger"</string>
|
||||
<string name="theseAreThePermissionsRequired">Ces permissions sont requises:</string>
|
||||
<string name="ruleXrequiresThis">La règle \"%1$s\" requiert.</string>
|
||||
<string name="profileXrequiresThis">Le profil \"%1$s\" requiert.</string>
|
||||
<string name="helpTextActivityDetection">Cette fonctionnalité peut détecter si vous êtes actuellement en déplacement et si c\'est à pied ou dans n\'importe quel type de véhicule (dans une certaine mesure). Cette fonctionnalité n\'est pas entièrement intégrée à Automation, mais est fournie par les services Google Play. Techniquement, elle ne donne pas un résultat oui/non, mais renvoie à un pourcentage de détection de votre statut. Vous pouvez définir la valeur du pourcentage à partir duquel Automation acceptera un résultat. Deux remarques : 1) Plus d\'un statut peut se produire en même temps. Par exemple, vous pouvez être en train de marcher dans un bus en marche. 2) Ce capteur est relativement gourmand en termes d\'utilisation de la batterie. Si cela est possible, vous pouvez utiliser des alternatives, par exemple exiger que le dispositif mains libres de votre voiture soit connecté pour détecter que vous êtes en train de conduire.</string>
|
||||
<string name="sendTextMessage">Envoyer un message</string>
|
||||
<string name="textToSend">Message à envoyer</string>
|
||||
<string name="textMessageAnnotations">Vous pouvez saisir un numéro de téléphone. Sinon vous pouvez sélectionnner un contact. Souvenez vous : le numéro de téléphon est enregistré ici, pas dans la fiche du contact. Si vous modifier le numéro d\'un contact, vous devez mettre à jour la règle, cela ne se fait automatiquement..</string>
|
||||
<string name="importNumberFromContacts">Importer le numéro d\'un contact</string>
|
||||
<string name="android9RecordAudioNotice">SI vous utilisez la détection de bruit : malheureusement depuis Android 9 Google interdit aux applications en tâche de fond d\'utiliser le microphone. Ce déclencheur n\' a plus d\'effet.</string>
|
||||
<string name="android10WifiToggleNotice">Malheureusement Google a décider de supprimer cette fonctionnalité dans Android 10. Les applications ne sont plus autorisées à activer ou désactiver le Wifi. Si vos téléphone est rooté cela fonctionnera toujours. Sinon, j\'ai bien peur que cela n\'est plus d\'effet.</string>
|
||||
<string name="messageNotShownAgain">Ce message ne sera plus affiché.</string>
|
||||
<string name="chooseActivityHint">Dans cette dernière fenêtre popup de sélection, vous devez choisir une activité spécifique. De manière simplifiée, il s\'agit d\'une fenêtre de l\'application souhaitée. Si vous ne savez pas laquelle, il est généralement conseillé de choisir celle dont le nom contient \"main\" ou \"launcher\"..</string>
|
||||
<string name="edit">Éditez</string>
|
||||
<string name="clickAndHoldForOptions">Cliquez et maintenez un objet pour les options.</string>
|
||||
<string name="positioningEngine">Outil de positionnement</string>
|
||||
<string name="googleSarcasm">Grâce à l\'infinie sagesse de Google et à son souci constant de protéger la vie privée de chacun, toutes les règles qui peuvent être utilisées pour envoyer des sms ou lire l\'état du téléphone ont été dépouillées de tous les déclencheurs et actions que Google considère comme risqués.</string>
|
||||
<string name="startAutomationAsService">Lancer Automation comme service</string>
|
||||
<string name="setScreenBrightness">Luminosité de l\'écran</string>
|
||||
<string name="setScreenBrightnessEnterValue">Saisissez la luminosité souhaitée (de 0 à 100).</string>
|
||||
<string name="autoBrightness">Activez la luminosité automatique</string>
|
||||
<string name="apply">appliquer</string>
|
||||
<string name="brightnessAuto">luminosité automatique</string>
|
||||
<string name="brightnessManual">luminosité manuelle</string>
|
||||
<string name="autoBrightnessNotice">If you use auto brightness the brightness value you use below will probably not be used long.</string>
|
||||
<string name="screenLockSoundNotice">Les sons de verrouillage d\'écran ne peuvent plus être modifiés automatiquement sur les appareils fonctionnant sous Android version 6.0 ou supérieure. Quel que soit le réglage effectué ici, il ne fonctionnera pas dans les deux sens..</string>
|
||||
<string name="startScreen">Écran de démarrage</string>
|
||||
<string name="startScreenSummary">Sélectionnez l\'écran de démarrage de l\'application.</string>
|
||||
<string name="executeRulesAndProfilesWithSingleClickTitle">Lancer les règles/profils d\'un seul clique.</string>
|
||||
<string name="googleLocationChicanery">Cette application collecte les informations de géolocalisations pour activer les règles basées sur la géolocalisation et de l\'accéléromètre pour les règles basées sur la détection de la vitesse même si l\'application est fermée.</string>
|
||||
<string name="googleLocationChicaneryOld">Cette application collecte les données de géolocalisation pour déterminer si vous vous trouvé dans un lieu que vous avez créé. De plus l\'application détermine votre vitesse actuelle si vous utilisez un déclencheur de ce type dans vos règles. Cela se produit même si l\'application est fermée ou non en cours d\'utilisation (mais uniquement sir le service est actif).</string>
|
||||
<string name="android.permission.ACCESS_BACKGROUND_LOCATION">Accéder à la géolocalisation en arrière plan.</string>
|
||||
<string name="deviceDoesNotHaveBluetooth">Il semble que votre téléphone ne dispose pas du Bluetooth. Vous pouvez poursuivre votre configuration, mais elle n\'aura pas d\'effet.</string>
|
||||
<string name="manageLocations">Créer ou modifier des géolocalisations</string>
|
||||
<string name="error">Erreur</string>
|
||||
<string name="featureNotInFdroidVersion">Cette fonctionnalité est basée sur un logiciel non libre. Donc elle n\'est pas disponible dans la version F-Droid.</string>
|
||||
<string name="settingsReferringToRestrictedFeatures">Vos réglages et/ou règles font référence à des fonctionnalités non libre qui ne sont pas disponibles dans la version F-Droid. Cela inclue la détection de votre activité physique.</string>
|
||||
<string name="publishedOn">publié le</string>
|
||||
<string name="displayNewsOnMainScreen">Afficher les nouveautés de l\'application sur l\'écran principal</string>
|
||||
<string name="displayNewsOnMainScreenDescription">Les annonces concernent uniquement cette application, 1 à 2 fois par an, pas plus.</string>
|
||||
<string name="filesHaveBeenMovedTo">Automation utilise maintenant un nouveau chemin pour enregistrer vos fichiers. Tous les fichiers d\'Automation ont été déplacer ici : \"%s\". L\'autorisation d\'accès au stockage externe n\'est plus requise; vous pouvez la révoquer. Elle sera révoqué dans une version future.</string>
|
||||
<string name="locationDisabled">Géolocalisation désactivée</string>
|
||||
<string name="locationEngineDisabledShort">La géolocalisation en tâche de fond ne peut plus être utilisée. ľiquer ici pour plus d\'informations.</string>
|
||||
<string name="locationEngineDisabledLong">Malheureusement, votre position ne peut plus être déterminée. \\n\\nToute ma gratitude à Google pour son infinie sagesse et son amabilité. Laissez-moi vous expliquer cela plus en détail. Depuis Android 10, une nouvelle autorisation a été introduite pour déterminer votre position en arrière-plan (ce qui est bien sûr nécessaire pour une application comme celle-ci). Bien que je considère que c\'est une bonne idée en général, les chicaneries que cela implique pour les développeurs ne le sont pas. \\n\\nLorsque vous développez une application, vous pouvez essayer de vous qualifier pour cette permission en vous conformant à un ensemble d\'exigences. Malheureusement, de nouvelles versions de mon application ont été rejetées pour une période de trois mois. J\'ai rempli toutes les exigences, le support de développement merdique de Google\ a prétendu que je ne le fesais pas. Après leur avoir donné la preuve que je l\'avais fait, j\'ai reçu une réponse du genre: \"Je ne peux plus vous aider\". J\'ai fini par abandonner. \\n\\nEn conséquence, la version Google Play ne peut plus utiliser votre position comme déclencheur. Ma seule option alternative aurait été de faire retirer cette application de la boutique entièrement. \\n\\nJe suis vraiment désolé, mais j\'ai fait de mon mieux pour argumenter avec un \"support\" qui a échoué à plusieurs reprises le test de Turing. \\n\\nLa bonne nouvelle : vous pouvez encore tout avoir! \\n\\nAutomation est maintenant open source et peut être trouvé dans F-Droid. C\'est un magasin d\'applications qui se soucie vraiment de votre vie privée - plutôt que de simplement agir comme tel. Il suffit de sauvegarder votre fichier de configuration, de désinstaller cette application, de l\'installer à nouveau depuis F-Droid, de restaurer votre fichier de configuration - c\'est fait. \\n\\nCliquez ici pour en savoir plus:</string>
|
||||
<string name="filesStoredAt">Les fichiers de configuration et de log sont stockés dans le dossier %1$s. Cliquez sur ce texte pour ouvrir l\'explorateur de fichiers. Malheureusement cela ne fonctionnera que sur un appareil rooté. POUR TOUS LES AUTRES APPAREILS: cliquez sur le bouton d\'export pour faire une sauvegarde.</string>
|
||||
<string name="notification">Notification</string>
|
||||
<string name="title">Titre</string>
|
||||
<string name="text">Texte</string>
|
||||
<string name="directionStringEquals">égal à</string>
|
||||
<string name="directionStringContains">contient</string>
|
||||
<string name="directionStringStartsWith">commence par</string>
|
||||
<string name="directionStringEndsWith">se termine par</string>
|
||||
<string name="directionStringNotEquals">n\'est pas égal à</string>
|
||||
<string name="anyApp">n\'importe quelle application</string>
|
||||
<string name="notificationTriggerExplanation">Ce déclencheur répondra à l\'ouverture (ou à la fermeture) de notifications par d\'autres applications dans la zone de notification. Vous pouvez spécifier l\'application émettrice de la notification. Si vous ne le faites pas, les notifications de toute autre application qu\'Automation seront prises en compte. Vous pouvez également spécifier des chaînes qui doivent ou ne doivent pas figurer dans le titre ou le texte de la notification. La comparaison est effectuée en tenant compte de la casse.</string>
|
||||
<string name="postsNotification">%1$s notification de messages</string>
|
||||
<string name="removedNotification">la notification de %1$s a été supprimée</string>
|
||||
<string name="notificationAppears">La notification s\'affiche</string>
|
||||
<string name="notificationDisappears">La notification disparait</string>
|
||||
<string name="direction">Direction</string>
|
||||
<string name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">Accès aux notifications système</string>
|
||||
<string name="playSound">Jouer le son</string>
|
||||
<string name="alwaysPlay">toujours jouer</string>
|
||||
<string name="alwaysPlayExplanation">Si ce paramètre est activé, le son sera toujours joué. S\'il est désactivé, il ne sera joué que si votre téléphone n\'est ni en mode silencieux ni en mode vibreur. Cependant, s\'il est actif, il n\'aura pas d\'effet sur le volume. Ainsi, si votre téléphone est en mode sonnerie, il n\'augmentera pas le volume des médias. Ainsi, si le volume des médias est en mode silencieux, vous n\'entendrez rien non plus..</string>
|
||||
<string name="selectSoundFile">Sélectionnez le fichier son</string>
|
||||
<string name="fileDoesNotExist">Le fichier n\'existe pas.</string>
|
||||
<string name="noFileManageInstalled">Il n\' y a pas de gestionnaire de fichier d\'installer.</string>
|
||||
<string name="shareConfigAndLogFilesWithDev">Joindre les fichiers de configuration et les journaux de log.</string>
|
||||
<string name="shareConfigAndLogExplanation">Cela lancera un nouvel email avec votre configuration et les fichiers de logs attachés en fichier zip. Il ne sera pas envoyé automatiquement, vous devez toujours cliquer sur "envoyer". Vous pouvez également changer le destinataire pour vous-même, par exemple.</string>
|
||||
<string name="startAppChoiceNote">Ici, vous disposez de 2 options générales : \n\n1. Vous pouvez démarrer un programme en sélectionnant une activité. Imaginez cela comme la présélection de l\'écran/fenêtre spécifique d\'une application. Gardez à l\'esprit que cela ne fonctionne pas toujours. En effet, les fenêtres d\'une application peuvent interagir les unes avec les autres, par exemple en transmettant des paramètres. En démarrant simplement un écran spécifique, cette interaction n\'a pas eu lieu et la fenêtre peut se fermer instantanément (elle n\'est donc jamais vraiment affichée). Essayez quand même! Vous pouvez saisir un chemin d\'activité manuellement, mais il est recommandé d\'utiliser le bouton \"Sélectionner\". Si vous décidez de le saisir manuellement, entrez le nom du package de l\'application dans le champ supérieur et le chemin complet de l\'activité dans le champ inférieur.\n\n2. Sélection par action. Contrairement à la sélection d\'une fenêtre spécifique, vous pouvez également lancer un programme par une action. Cela revient à demander "Je voudrais xyz" et si une application installée peut vous aider, elle sera lancée. Un bon exemple serait le démarrage du navigateur - vous pouvez même en avoir plusieurs installés (l\'un d\'eux est généralement celui par défaut). Vous devez entrer ceci manuellement, PackageName est optionnel ici. Gardez à l\'esprit qu\'aucune variable ne sera résolue. Si vous voulez démarrer la caméra, par exemple, en utilisant \"MediaStore.ACTION_IMAGE_CAPTURE\", cela ne fonctionnera pas. Vous devez jeter un coup d\'œil à la documentation Android et utiliser la valeur réelle de cette variable qui, dans cet exemple, serait \"android.media.action.IMAGE_CAPTURE\".</string>
|
||||
<string name="errorRunningRule">une erreur s\'est produite lors de l\'éxécution d\'une règle.</string>
|
||||
<string name="cantFindSoundFile">Impossible de trouver le fichier audio %1$s et donc de le lire.</string>
|
||||
<string name="addParameters">Ajouter des paramètres</string>
|
||||
<string name="com.wireguard.android.permission.CONTROL_TUNNELS">Autorisation de contrôle des tunnels de l\'application wiregard</string>
|
||||
<string name="startAppSelectionType">Sélection \n de l\'application</string>
|
||||
<string name="startAppByActivity">par activité</string>
|
||||
<string name="startAppByAction">par action</string>
|
||||
<string name="enterValidAction">Saisissez une action valide</string>
|
||||
<string name="enterPackageName">Saisissez un nom de package valide.</string>
|
||||
<string name="state">État</string>
|
||||
<string name="phoneNumberExplanation">Vous pouvez saisir un numéro de téléphone distant spécifique, mais ce n\'est pas obligatoire. Si vous souhaitez en spécifier un, vous pouvez soit le choisir dans votre carnet d\'adresses, soit le saisir manuellement. En outre, vous pouvez utiliser des expressions régulières. Pour tester une expression régulière, j\'aime cette page:</string>
|
||||
<string name="importConfiguration">Importer la configuration</string>
|
||||
<string name="exportConfiguration">Exporter la configuration</string>
|
||||
<string name="moreSettings">Réglages supplémentaires</string>
|
||||
<string name="configurationExportedSuccessfully">Configuration exportée avec succès.</string>
|
||||
<string name="ConfigurationExportError">Une erreur est survenue lors de l\'export de la configuration.</string>
|
||||
<string name="rulesImportedSuccessfully">Les règles et les géolocalisations ont été importées avec succès.</string>
|
||||
<string name="rulesImportError">Une erreur est survenue lors de l\'import des règles et géolocalisations.</string>
|
||||
<string name="configurationImportedSuccessfully">Configuration importée avec succès.</string>
|
||||
<string name="prefsImportError">Une erreur est survenue lors de l\'import des préférences.</string>
|
||||
<string name="noApplicableFilesFoundInDirectory">Aucun fichier compatible n\'a pu être trouvé dans ce répertoire.</string>
|
||||
<string name="noFilesImported">Aucun fichier ne peut être importé.</string>
|
||||
<string name="notAllFilesImported">Aucun fichiers compatible ne peut être importé.</string>
|
||||
<string name="importExportExplanation">Lorsque vous cliquez sur importer ou exporter, vous sélectionnez le répertoire à partir duquel les fichiers sont importés ou exportés. Lors de l\'exportation, les fichiers existants pourraient être écrasés.</string>
|
||||
<string name="intentDataComment">Si votre paramètre est de type Uri ET que vous spécifiez \"IntentData\" comme nom (la minuscule/majuscule n\'est pas importante), le paramètre ne sera pas ajouté comme un paramètre normal avec putExtra(), mais sera plutôt ajouté à l\'intention avec setData().</string>
|
||||
<string name="stringNotAllowed">La chaîne %1$s n\'est pas autorisée.</string>
|
||||
<string name="startAppStartType">Sélectionnez le type de lancement</string>
|
||||
<string name="startAppByStartActivity">par startActivity()</string>
|
||||
<string name="startAppBySendBroadcast">par sendBroadcast()</string>
|
||||
<string name="openExamplesPage">Ouvrir la page web des exemples</string>
|
||||
<string name="packageName">Nom du package</string>
|
||||
<string name="activityOrActionName">Nom de l\'activité/action </string>
|
||||
<string name="warning">Attention</string>
|
||||
<string name="ringing">sonnerie</string>
|
||||
<string name="from">de</string>
|
||||
<string name="to">à</string>
|
||||
<string name="matching">correspondant à</string>
|
||||
<string name="loadWifiList">Chargement de la liste des Wifi</string>
|
||||
<string name="needLocationPermForWifiList">La liste des réseaux wifis auxquels votre appareil a été connecté pourrait être utilisée pour déterminer les endroits où vous vous êtes rendu. C\'est pourquoi l\'autorisation de localisation est nécessaire pour charger la liste des wifis. Si vous voulez être en mesure d\'en choisir un dans la liste, vous devez accorder cette permission. Si vous ne le souhaitez pas, vous pouvez toujours entrer le nom de votre wifi manuellement..</string>
|
||||
<string name="noKnownWifis">Il n\'y a pas de réseau Wifi connu dans votre téléphone.</string>
|
||||
<string name="urlToTriggerExplanation">Cette fonctionnalité n\'ouvre PAS le navigateur, mais lance une URL en tâche de fond. Vous pouvez utiliser cette fonctionnalité pour commander votre domotique par exemple.</string>
|
||||
<string name="automaticUpdateCheck">Vérification des mises à jour</string>
|
||||
<string name="automaticUpdateCheckSummary">S\'applique seulement à la version APK.</string>
|
||||
<string name="updateAvailable">Une nouvelle mise à jour est disponible. Souhaitez vous ouvrir votre navigateur pour la télécharger ?</string>
|
||||
<string name="locationFound">Géolocalisation trouvée. Le rayon minimum suggéré pour cette géolocalisation est de %1$d m.</string>
|
||||
<string name="locationFoundInaccurate">Seul un emplacement avec une précision limitée a pu être trouvé. Il se peut qu\'il ne fonctionne pas de manière fiable. Le rayon minimum suggéré pour cette géolocalisation est de %1$d m."</string>
|
||||
<string name="clone">Copier</string>
|
||||
<string name="noLocationCouldBeFound">Aucune géolocalisation n\'a peut être trouvée après un délai de %1$s secondes.</string>
|
||||
<string name="pleaseGiveBgLocation">Sur l\'écran suivant allez dans les autorisations puis position. Sélectionnez \"Autorisé tout le temps\" pour per;ettre à Automation d\'accéder à votre position en tâche de fond.</string>
|
||||
<string name="vibrate">Vibreur</string>
|
||||
<string name="test">Test</string>
|
||||
<string name="VibrateExplanation">Saisissez une durée de vibration, suivie d\'une virgule, puis d\'une durée de pause. Vous pouvez concaténer autant de vibrations que vous le souhaitez. Séparez-les à nouveau par des virgules. Par exemple, le motif 100,500,500,1000,100 fera vibrer 100, attendre 500, vibrer 500, attendre 1000, vibrer 100 ms. Si vous pensez qu\'une vibration n\'a pas fonctionnée, essayez d\'augmenter la pause qui les précède.</string>
|
||||
<string name="pleaseEnterValidVibrationPattern">Veuillez entrer un modèle de vibration valide.</string>
|
||||
<string name="newsOptIn">Souhaitez-vous recevoir sur l\'écran principal les actualités (uniquement les actualités importantes) de cette application? Celles-ci sont récupérées depuis le site web du développeur. Il n\'y aura pas de notification intrusive, juste un texte sur l\'écran principal lorsque vous ouvrez l\'application..</string>
|
||||
<string name="top">Haut</string>
|
||||
<string name="bottom">Bas</string>
|
||||
<string name="tabsPlacement">Position de la barre de menu</string>
|
||||
<string name="tabsPlacementSummary">Choisissez la position de la barre de menu.</string>
|
||||
<string name="wifiApi30">Parce que Google s\'est encore planté sur une autre partie d\'Android, à partir de l\'API 30, seuls les wifis actuellement visibles peuvent être affichés, et non plus tous ceux auxquels votre appareil s\'est connecté.</string>
|
||||
<string name="silentTriggersDnd">REMARQUE: le mode silencieux déclenche souvent le mode NE PAS DÉRANGER sur les appareils récents.Si cela vous arrive, je vous recommande d\'utiliser le mode normal et de baisser le volume à zéro.</string>
|
||||
<string name="tones">Tonalité</string>
|
||||
<string name="miscellaneous">Divers</string>
|
||||
<string name="dnd">Ne pas déranger</string>
|
||||
<string name="dndOff">Désactiver ne pas déranger</string>
|
||||
<string name="dndPriority">Laisser afficher les notifications prioritaires</string>
|
||||
<string name="dndAlarms">Laisser les alarmes fonctionner</string>
|
||||
<string name="dndNothing">Ne rien laisser passer</string>
|
||||
<string name="dndRemarks">Les réglages précis (autoriser les appels,choisir des numéros, etc.) ne peuvent être effectués que depuis les paramètres système.</string>
|
||||
<string name="automationNotificationsIgnored">Si vous ne choisissez pas une application précise, mais \"n\'importe quel application\", les notifications d\'Automation seront ignorées pour éviter de créer une boucle.</string>
|
||||
<string name="repeatEveryXseconds">Répéter toues les x secondes</string>
|
||||
<string name="repeatEveryXsecondsWithVariable">répéter toutes les %1$s secondes</string>
|
||||
<string name="enterRepetitionTime">Pour la période de répétition, vous devez saisir une valeur positive, non décimale.</string>
|
||||
<string name="elementSkipped">Un élément du fichier de configuration ne peut pas être lu. Le fichier doit avoir éte créé avec une verions plus récente du programme.</string>
|
||||
<string name="donate">Faire un don</string>
|
||||
<string name="btTetheringNotice">Cette fonctionnalité est opérationnelle jusqu\'à la version 8.0 d\'Android. Pour les versions plus récentes elle ne fonctionne plus, mais de part le manque de capteurs physique, je ne peux savoir duquel il s\'agit. Sur Android 11, cela ne fonctionne définitvement plus. SI vous avez une version entre la 8.0 et la 11 et que cela focntionne, dites le moi.</string>
|
||||
<string name="notice">Information</string>
|
||||
<string name="deviceOrientation">Orientation de l\'appareil</string>
|
||||
<string name="tolerance">Tolérance (0-180)</string>
|
||||
<string name="orientationAzimuth">Azimut:</string>
|
||||
<string name="orientationPitch">Hauteur:</string>
|
||||
<string name="orientationRoll">Inclinaison:</string>
|
||||
<string name="enterValidNumbersIntoAllFields">Saisissez des chiffres valides dans tous les champs.</string>
|
||||
<string name="deviceOrientationExplanation">Lorsque vous bougez votre appareil, les chiffres ci-dessous sont mis à jour. Vous pouvez voir ici l\'orientation de votre appraeil indiquée en degrés. S\'il s\'\agit de l\'orientation souhaitée, cliquer sur le bouton appliquer pour copier les données dans les champs adéquats. Atteindre systématiquement cette orientation exacte est compliquée vous devez saisir une tolérance, il s\'agit d\'un nombre de degrés de déviation valable dans toutes les directions. 15° entrainera un angle total de 30°, soit 15° dans toutes les directions. Si vous voulez une tolérance sur un axe spécifique, saisissez une tolérance de 180° sur les deux autres axes.</string>
|
||||
<string name="wouldCurrentlyApply">Appliquer?</string>
|
||||
<string name="deviceIsInCertainOrientation">l\'appareil est dans une certaine rotation</string>
|
||||
<string name="toleranceOf180OnlyAllowedIn2Fields">Une tolérance de 180° est autorisé pour 2 axes uniquement, pas 3. Sinon le déclencheur sera TOUJOURS actif.</string>
|
||||
<string name="unknown">inconnu</string>
|
||||
<string name="orientation">Orientation</string>
|
||||
<string name="triggerWrong">quelque chose ne fonctionne pas avec ce déclencheur. Il ne peut pas être chargé correctement.</string>
|
||||
<string name="turnScreenOnOrOff">Allumer ou éteindre l\'écran</string>
|
||||
<string name="turnScreenOn">allumer l\'ran</string>
|
||||
<string name="turnScreenOff">étaindre l\'écran</string>
|
||||
<string name="mustApply">Doit être appliqué</string>
|
||||
<string name="deviceOrientationTimeAcceptIntervalTitle">Fréquence du signal</string>
|
||||
<string name="deviceOrientationTimeAcceptIntervalSummary">Accepter de nouveaux signaux de mouvement toutes les x millisecondes</string>
|
||||
<string name="deviceOrientationSettings">Réglages de l\'orientation de l\'appareil</string>
|
||||
<string name="android.permission.BIND_DEVICE_ADMIN">Administration de l\'appareil</string>
|
||||
<string name="deviceAdminNote">La permission d\'administration de l\'appareil est nécessaire pour au moins l\'une des règles que vous avez crées.</string>
|
||||
<string name="explanationDeviceOrientationDirection">Si la case est cochée, cela signifie que l\'appareil doit être dans une orientation spécifique. Si elle n\'est pas cochée, n\'importe quelle orientation ne correspondant PAS a vos critères sera le déclencheur.</string>
|
||||
<string name="permissionsRequiredNotAvailable">Vos règles nécessitent des autorisations qui ne peuvent pas être demandées à partir de cette version installée d\'Automation..</string>
|
||||
<string name="smsDialogNotice">Si vous n\'avez pas utilisé une action d\'envoi de SMS avant, Android vous demandera de confirmer l\'autorisation pour qu\'Automation puisse envoyer des messages. Vous devez sélectionner \"toujours autoriser\" et confirmer que cette action puisse fonctionner en arrière plan. Il est conseillé de lancer cette règle une fois manuellement pour afficher la fenêtre de demande d\'autorisation.</string>
|
||||
<string name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS">Exclure de l\'optimisation de la batterie</string>
|
||||
<string name="recommendedForBetterReliability">Recommandé pour une meilleure fiabilité</string>
|
||||
<string name="needsToBeActive">Doit être actif</string>
|
||||
<string name="checkSettings">Vérifiez les paramètres</string>
|
||||
<string name="profileActive">le profil %1$s est actif</string>
|
||||
<string name="profileNotActive">le profil %1$s n\'est plus actif</string>
|
||||
<string name="profileTriggerCheckSettings">Si cette case n\'est pas désactivée, elle ne sera cochée que si le profil sélectionné a été le dernier à être activé. Peu importe que les paramètres audio aient été modifiés en externe. Toutefois, si la case à cocher est activée, les paramètres audio actuels doivent vraiment être ceux définis dans le profil. ATTENTION : La vérification du fichier de sonnerie n\'est pas encore prise en charge.</string>
|
||||
<string name="ruleXIsUsingProfileY">Impossible de supprimer ce profil. La règle %1$s fait référence au profil %2$s.</string>
|
||||
<string name="profileCouldNotBeDeleted">Le profil ne peut pas être supprimé.</string>
|
||||
<string name="noRepetition">pas de répétition</string>
|
||||
<string name="usingAuthentication">utiliser l\'authentification</string>
|
||||
<string name="toNumber">au nombre</string>
|
||||
<string name="message">message</string>
|
||||
<string name="onDays">les jours</string>
|
||||
<string name="notSet">non fixé</string>
|
||||
<string name="takeLauncherActivity">Trouver automatiquement</string>
|
||||
<string name="pickActivityManually">Choisir manuellement</string>
|
||||
<string name="launcherOrManualExplanation">Mode facile : Automation essaye d\'identifier automatiquement le lenceur du programme. Sinon, vous pouvez sasir manuellement le lanceur du programme. que souhaitez vous faire ?</string>
|
||||
<string name="launcherNotFound">Aucun lanceur pour cette application n\'a pu être trouvé. Vous devez le saisir manuellement.</string>
|
||||
<string name="createNotification">Créer une notification</string>
|
||||
<string name="enterTitle">Saisissez un titre.</string>
|
||||
<string name="enterText">Saisissez le texte.</string>
|
||||
<string name="info">Info</string>
|
||||
<string name="profileWasNotFound">Le profil utiliser pour cette rêgle semble ne plus exister. Le premier profil dans l\'ordre alphabétique a été sélectionné.</string>
|
||||
<string name="notificationCloseActionExplanation">Si vous n\'indiquez aucun critère cette action clôturera toutes les notifications. Il est conseillé de définir au moins un critère, titre ou texte, par application.</string>
|
||||
<string name="closeNotifications">Fermer les notifications</string>
|
||||
<string name="comparisonCaseInsensitive">La coparaisonn est sensible à la casse du texte</string>
|
||||
<string name="profileWarning">Les paramètres que vous pouvez régler ici affecter les évènements audio sur votre télephone. Ils peuvent même annuler votre alarme de réveil. Donc, quoi que vous fassiez, il est fortement recommandé de le tester, même après les mises à jour d\'Android.</string>
|
||||
<string name="ifString">si</string>
|
||||
<string name="emailContactNotice">L\'e-mail est mon moyen de contact préféré pour signaler les bogues, poser des questions ou faire des propositions. Rendez-vous sur le centre de contrôle pour en savoir plus.\Plusieurs questions ne peuvent pas recevoir de réponse immédiate, mais nécessitent des recherches techniques. Veuillez donc faire preuve de patience.</string>
|
||||
<string name="controlCenter">Centre de contrôle</string>
|
||||
<string name="sendEmailToDev">Envoyer un email au développeur</string>
|
||||
<string name="screenIs">l\'écran est %1$s</string>
|
||||
<string name="on">en marche</string>
|
||||
<string name="off">à l\'arrêt</string>
|
||||
<string name="unlocked">déverroullé</string>
|
||||
<string name="selectDesiredState">Sélectionnez l\'état souhaité</string>
|
||||
<string name="screenState">État de l\'écran</string>
|
||||
<string name="featureCeasedToWorkLastWorkingAndroidVersion">En raison de l\'infinie sagesse de Google\, la dernière version d\'Android sur laquelle cette fonctionnalité est connue pour fonctionner est la %1$s. Vous pouvez la configurer, mais cela n\'aura probablement aucun effet.</string>
|
||||
<string name="actionMediaControl">Contrôle de lecture des médias</string>
|
||||
<string name="selectCommand">Sélectionnez une commande</string>
|
||||
<string name="playPause">play/pause</string>
|
||||
<string name="play">play</string>
|
||||
<string name="pause">pause</string>
|
||||
<string name="previous">précédent</string>
|
||||
<string name="next">suivant</string>
|
||||
<string name="android.permission.MEDIA_CONTENT_CONTROL">Contrôle de lecture des média</string>
|
||||
<string name="stop">stop</string>
|
||||
<string name="pleaseSelectActionValue">Veuillez choisir une action !</string>
|
||||
<string name="actionMediaControlNotice">Gardez à l\'esprit que cette action peut ne pas fonctionner avec tous les lecteurs de musique existants. Si cela fonctionne, certains boutons peuvent ne pas fonctionner.</string>
|
||||
<string name="musicPlaying">jouer la musique</string>
|
||||
<string name="selectParameters">Choisissez un paramètre</string>
|
||||
<string name="musicIsPlaying">la musique est est en cours de lecture</string>
|
||||
<string name="musicIsNotPlaying">aucune musaique en cours de lecture</string>
|
||||
<string name="musicPlayingDetection">Détection de la lecture de musique</string>
|
||||
<string name="musicCheckFrequencyTitle">Vérification de la fréquence [ms]</string>
|
||||
<string name="musicCheckFrequencySummary">Durée en millisecondes entre les vérifications</string>
|
||||
<string name="locationNotWorkingOn12">La géolocalisation semble ne pas fonctionner sur les appareils équipé d\'droid 12. Si vous êtes dans ce cas, j\'en suis désolé. Je corrigerai ce problème dès que la cause sera identifiée. Si la localisation tourne en continue, vous savez pourquoi.</string>
|
||||
<string name="lastProfile">Dernier profil:</string>
|
||||
<string name="queryAllPackages">Obtention de la liste des applications installées</string>
|
||||
<string name="timeFrameDaysHint">Si vous utilisez une période qui s\'étend au-delà de minuit, vous devez également sélectionner le jour suivant si vous voulez que le déclencheur s\'applique après minuit.</string>
|
||||
<string name="featureNotInGooglePlayVersion">Cette fonctionnalité n\'est plus disponible dans la version Google Play. De temps en temps, Google intimide les développeurs. Si vous voulez continuer à utiliser certaines fonctionnalités, vous devez remplir des papiers. Malheureusement, il y a 99% de chances que ces documents soient rejetés. C\'est un peu comme dans la bande dessinée ou le film Astérix. J\'ai passé des semaines à discuter avec eux de ce genre de cas dans le passé, mais je continuais à recevoir des refus - soit par des robots, soit par des personnes qui sont à peu près aussi intelligentes que des robots. Dans ce cas, je peux décider de retirer l\'application du Play Store ou de supprimer la fonctionnalité. Veuillez utiliser la version APK de mon site Web ou celle de F-Droid si vous avez besoin de ces fonctionnalités..</string>
|
||||
<string name="startActivityInsertManually">Cette limitation ne concerne que la sélection d\'une application, et non le démarrage proprement dit. Vous pouvez donc toujours entrer le nom d\'une application manuellement si vous le connaissez..</string>
|
||||
<string name="deviceStarts">Démarrage de l\'appareil</string>
|
||||
<string name="serviceStarts">Démarrage du servicce</string>
|
||||
<string name="deviceIsStarting">l\'appareil démarre</string>
|
||||
<string name="serviceIsStarting">le service démarre</string>
|
||||
<string name="broadcastReceived">réception de transmission</string>
|
||||
<string name="broadcastNotReceived">transmission non reçue</string>
|
||||
<string name="explanationBroadcastTrigger">La plupart des événements sur votre téléphone seront "publiés" en les diffusant à travers le système d\'exploitation. Par exemple, l\'activation ou la désactivation du mode avion déclenchera ce genre de diffusion. Ces diffusions ne sont pas automatiquement visibles/audibles, mais si une application (comme Automation) est intéressée, elle peut s\'y connecter et réagir. Vous pouvez définir ici un événement de diffusion que l\'application Automation attendra. Vous pouvez le saisir manuellement, le copier & le coller depuis n\'importe quelle application de votre téléphone ou en choisir un dans la liste des suggestions. Comme ce déclencheur est destiné à être et à rester très flexible, je ne peux pas vous fournir d\'explications sur les éléments.\n\nLa liste des suggestions ne prétend pas être complète. Veuillez visiter l\'URL ci-dessous pour consulter la documentation Android. \n\nDe plus, toute application peut envoyer des événements personnalisés qui n\'apparaîtront pas dans la documentation Android. J\'essaie de demander des autorisations uniquement lorsque je sais qu\'elles seront nécessaires. Si vous pensez qu\'une autorisation est nécessaire pour l\'action que vous avez crée, veuillez me le faire savoir.\n\nNon reçu signifie qu\'il n\'y a pas eu de diffusion de ce type depuis que le service a été lancé. La réponse à certains paramètres est en cours de développement.</string>
|
||||
<string name="broadcastReceivedTitle">Émission reçue</string>
|
||||
<string name="logsExplanation">Pour éviter d\'utiliser inutilement votre espace de stockage, les journaux ne sont pas enregistrés par défaut. Donc, si vous avez un problème, veuillez d\'abord activer la journalisation dans les paramètres et définir le niveau de journalisation à 5. Reproduisez ensuite le problème. Ce n\'est qu\'alors que les journaux pourront être joints.</string>
|
||||
<string name="broadcastsShowSuggestions">Montrer les suggestions</string>
|
||||
<string name="selectBroadcast">Sélectionnez l\'emission</string>
|
||||
<string name="lockedWithoutSecurity">vérouiller (balayez l\'écran, pas de code PIN)</string>
|
||||
<string name="lockedWithSecurity">vérouiller (avec un code PIN, etc.)</string>
|
||||
<string name="lockedCommentScreenMustBeOff">Les états de vérouillage ne sont détecter que si l\'"ecran est éteind.</string>
|
||||
<string name="emailPretext">Si vous rencontrez un problème, que vous avez une question ou une suggestion, faites m\'en part par email. Ne vous contentez pas d\'envoyer uniquement les fichiers dans le corps du mail. J\'ignorerai ce type de mail sauf si une converstaion est déjà entamée.</string>
|
||||
<string name="sendBroadcast">Envoyer l\'émission</string>
|
||||
<string name="enterBroadcast">Saisissez une action d\'envoi.</string>
|
||||
<string name="broadcastExplanation">Cette action permet d\'envoyer des diffusion à travers le système de message d\'Android. Cela n\'est pas visible par l\'utilisateur, mais les applications écoutent ces messages et peuvent y répondrent.</string>
|
||||
<string name="directionStringDoesNotContain">ne contient pas</string>
|
||||
<string name="runExecutable">Éxécuter le script</string>
|
||||
<string name="path">Chemin</string>
|
||||
<string name="parameters">Paramètres</string>
|
||||
<string name="chooseExecutable">Choisir l\'exécutable</string>
|
||||
<string name="runAsRoot">Exécuter en tant que root</string>
|
||||
<string name="selectValidExecutable">Sélectionnez un fichier exécutable valide.</string>
|
||||
<string name="fileNotExecutable">Le fichier n\'est pas exécutable.</string>
|
||||
<string name="wifiExplanation1">Les applications ciblant Android Q ou supérieur ne peuvent plus activer ou désactiver le wifi. Veuillez blâmer Google pour cette restriction, pas moi. Vous pouvez contourner cette restriction en rootant votre appareil et en activant la case à cocher ci-dessous. Vous pouvez également télécharger cette application depuis F-Droid ou mon site web car je ne suis pas obligé de cibler le dernier niveau d\'API dans ces versions.</string>
|
||||
<string name="wifiExplanation2">Lorsque le mode avion est activé, le wifi ne peut être activé qu\'à partir d\'applications pour lesquelles vous disposez des droits d\'accès root.</string>
|
||||
<string name="usingRoot">utilisation root</string>
|
||||
<string name="runExecutableExplanation">Vous pouvez sélectionner ici un script ou un fichier exécutable qui sera exécuté en tant qu\'action. Mais il y a quelques conditions préalables que vous devez gérer vous-même. Google a fait en sorte qu\'il soit très difficile d\'exécuter autre chose que des applications Android normales. 1. Le fichier doit être marqué comme exécutable dans le système de fichiers. Sur un système Android normal (sans root), c\'est en fait la partie la plus difficile. 2. Cela signifie également qu\'Automation doit être en mesure d\'exécuter le fichier, pas seulement le propriétaire ou le groupe. 3. Si c\'est un script, un shell valide doit être spécifié dans l\'en-tête du script.</string>
|
||||
<string name="tetheringActive">la connexion est active</string>
|
||||
<string name="tetheringNotActive">la connexion n\'est pas active</string>
|
||||
<string name="tetheringState">État de la connexion</string>
|
||||
<string name="regularExpressionsIfEquals">Si \"égal\" est sélectionné, vous pouvez saisir une expression régulière.</string>
|
||||
<string name="enter_a_number">Entrez un nombre.</string>
|
||||
<string name="duration">Durée [ms]</string>
|
||||
<string name="keepDeviceAwake">Garder mon téléphone actif</string>
|
||||
<string name="wakeLockTimeout">Définissez un délais d\'expiration</string>
|
||||
<string name="wakeLockExplanation">Activer permet de garder l\'écran allumé tandis que désactiver permet de l\'éteindre. Pour le maintenir allumé, vous pouvez soit entrer une durée après laquelle il peut s\'éteindre à nouveau, soit le maintenir allumé indéfiniment. Dans ce dernier cas, vous devrez créer une autre action de veille (dans cette règle ou une autre) dans laquelle vous sélectionnerez la désactivation.</string>
|
||||
<string name="mayUseRegularExpressions">Vous pouvez aussi saisir une expression régulière ici.</string>
|
||||
<string name="simplyDismissNotification">Rejeter simplement</string>
|
||||
<string name="clickNotificationButton">Appuyer sur un bouton</string>
|
||||
<string name="withButton">avec le bouton %1$s</string>
|
||||
<string name="subSystemState">État du sous système</string>
|
||||
<string name="bluetooth">Bluetooth</string>
|
||||
<string name="locationRequiredToDetermineWifiName">Pour obtenir le SSID wifi, l\'application a besoin des autorisations de localisation. Comme la version Google ne peut pas l\'obtenir, vous ne pouvez utiliser ce déclencheur que si vous ne spécifiez pas de SSID. Il ne peut donc être utilisé que pour détecter si le wifi est connecté ou non..</string>
|
||||
<string name="usb">USB</string>
|
||||
<string name="type">Type</string>
|
||||
<string name="cable">Cable</string>
|
||||
<string name="tetheringBluetoothNotPossible">Le partage de connexion Bluetooth ne peut actuellement pas être détecté. Seuls les autres moyens de connexion activeront ce déclencheur.</string>
|
||||
</resources>
|
@ -1,26 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="ConfigurationExportError">C\'è stato un errore durante l\'esportazione della configurazione.</string>
|
||||
<string name="ConfigurationExportError">È avvenuto un errore durante l\'esportazione della configurazione.</string>
|
||||
<string name="accelerometer">Accelerometro</string>
|
||||
<string name="accelerometerThreshold">Soglia accelerometro</string>
|
||||
<string name="accelerometerThresholdDescription">Soglia per i movimenti dell\'accelerometro</string>
|
||||
<string name="accelerometerTimer">Usa l\'accelerometro dopo x minuti senza lunghi cambiamenti delripetitore</string>
|
||||
<string name="accelerometerTimer">Usa l\'accelerometro dopo x minuti senza lunghi cambiamenti del ripetitore</string>
|
||||
<string name="actionChangeSoundProfile">Cambia il profilo sonoro</string>
|
||||
<string name="actionDataConnection">Connessione dati mobile</string>
|
||||
<string name="actionDataConnection">Connessione dati</string>
|
||||
<string name="actionDisableScreenRotation">disabilita la rotazione dello schermo</string>
|
||||
<string name="actionEnableScreenRotation">abilita la rotazione dello schermo</string>
|
||||
<string name="actionPlayMusic">Apri il lettore musicale</string>
|
||||
<string name="actionSetBluetooth">Bluetooth</string>
|
||||
<string name="actionSetDataConnectionOff">disattiva la connessione mobile</string>
|
||||
<string name="actionSetDataConnectionOn">attiva la connessione mobile</string>
|
||||
<string name="actionSetDataConnectionOff">disattiva la connessione dati</string>
|
||||
<string name="actionSetDataConnectionOn">attiva la connessione dati</string>
|
||||
<string name="actionSetDisplayRotation">Rotazione dello schermo</string>
|
||||
<string name="actionSetUsbTethering">USB Tethering</string>
|
||||
<string name="actionSetUsbTethering">Tethering USB</string>
|
||||
<string name="actionSetWifi">Wifi</string>
|
||||
<string name="actionSetWifiTethering">Wifi Tethering</string>
|
||||
<string name="actionSetWifiTethering">Tethering Wifi</string>
|
||||
<string name="actionSpeakText">Pronuncia testo</string>
|
||||
<string name="actionTriggerUrl">Apri indirizzo</string>
|
||||
<string name="actionTurnAirplaneModeOff">termina la modalità aereo</string>
|
||||
<string name="actionTurnAirplaneModeOn">passa a modalità aereo</string>
|
||||
<string name="actionTurnAirplaneModeOff">disattiva modalità aereo</string>
|
||||
<string name="actionTurnAirplaneModeOn">attiva modalità aereo</string>
|
||||
<string name="actionTurnBluetoothOff">disattiva Bluetooth</string>
|
||||
<string name="actionTurnBluetoothOn">attiva Bluetooth</string>
|
||||
<string name="actionTurnUsbTetheringOff">disattiva Tethering USB</string>
|
||||
@ -29,20 +29,20 @@
|
||||
<string name="actionTurnWifiOn">attiva Wifi</string>
|
||||
<string name="actionTurnWifiTetheringOff">disattiva Tethering Wifi</string>
|
||||
<string name="actionTurnWifiTetheringOn">attiva Tethering Wifi</string>
|
||||
<string name="actions">Azione(i)</string>
|
||||
<string name="actions">Azione/i</string>
|
||||
<string name="actionsComment">(saranno eseguite in quest\'ordine)</string>
|
||||
<string name="activate">Attiva</string>
|
||||
<string name="activated">attivo</string>
|
||||
<string name="activating">Sto attivando</string>
|
||||
<string name="activated">attivato</string>
|
||||
<string name="activating">Attivazione in corso</string>
|
||||
<string name="activePoi">Posizione attiva:</string>
|
||||
<string name="activityDetection">Rilevamento dell\'attività</string>
|
||||
<string name="activityDetectionFrequencySummary">Secondi tra i tentativi di rilevamento dell\'attività.</string>
|
||||
<string name="activityDetectionFrequencyTitle">Frequenza di rilevamento [sec]</string>
|
||||
<string name="activityDetectionRequiredProbabilitySummary">Attendibilità alla quale esecuzione delle attività è considerata corretta.</string>
|
||||
<string name="activityDetectionRequiredProbabilitySummary">Attendibilità minima per considerare le attività corrette.</string>
|
||||
<string name="activityDetectionRequiredProbabilityTitle">Probabilità di rilevamento dell\'attività</string>
|
||||
<string name="activityOrActionName">Nome attività/azione</string>
|
||||
<string name="addAction">Aggiungi azione</string>
|
||||
<string name="addIntentValue">Aggiungi una coppia di intenzioni</string>
|
||||
<string name="addIntentValue">Aggiungi coppia dell\'Intent</string>
|
||||
<string name="addParameters">Aggiungi parametri</string>
|
||||
<string name="addPoi">Aggiungi posizione</string>
|
||||
<string name="addProfile">Aggiungi profilo</string>
|
||||
@ -59,38 +59,38 @@
|
||||
<string name="android.permission.ACCESS_NOTIFICATION_POLICY">Ignora la politica di "non disturbare"</string>
|
||||
<string name="android.permission.ACCESS_WIFI_STATE">Leggi lo stato della rete wifi</string>
|
||||
<string name="android.permission.ACTIVITY_RECOGNITION">Identificazione attività</string>
|
||||
<string name="android.permission.BATTERY_STATS">Leggere lo stato della batteria</string>
|
||||
<string name="android.permission.BATTERY_STATS">Leggi lo stato della batteria</string>
|
||||
<string name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">Leggere le notifiche di sistema</string>
|
||||
<string name="android.permission.BLUETOOTH">Cambia le impostazioni Bluetooth</string>
|
||||
<string name="android.permission.BLUETOOTH_ADMIN">Cambia le impostazioni Bluetooth</string>
|
||||
<string name="android.permission.CHANGE_BACKGROUND_DATA_SETTING">Cambia la connessione dati</string>
|
||||
<string name="android.permission.BLUETOOTH">Modifica le impostazioni Bluetooth</string>
|
||||
<string name="android.permission.BLUETOOTH_ADMIN">Modifica le impostazioni Bluetooth</string>
|
||||
<string name="android.permission.CHANGE_BACKGROUND_DATA_SETTING">Modifica la connessione dati</string>
|
||||
<string name="android.permission.GET_TASKS">Rileva i processi attivi</string>
|
||||
<string name="android.permission.INTERNET">Invia dati su una connessione di rete</string>
|
||||
<string name="android.permission.MODIFY_AUDIO_SETTINGS">Cambia le impostazioni audio</string>
|
||||
<string name="android.permission.MODIFY_PHONE_STATE">Cambia le impostazioni del dispositivo</string>
|
||||
<string name="android.permission.MODIFY_AUDIO_SETTINGS">Modifica le impostazioni audio</string>
|
||||
<string name="android.permission.MODIFY_PHONE_STATE">Modifica le impostazioni del dispositivo</string>
|
||||
<string name="android.permission.NFC">Usa il modulo NFC</string>
|
||||
<string name="android.permission.PROCESS_OUTGOING_CALLS">Rileva chiamate in uscita</string>
|
||||
<string name="android.permission.READ_CALENDAR">Leggere gli appuntamenti dal calendario</string>
|
||||
<string name="android.permission.READ_CALL_LOG">Leggere il registro chiamate</string>
|
||||
<string name="android.permission.READ_CONTACTS">Leggere informazioni dai Contatti</string>
|
||||
<string name="android.permission.READ_EXTERNAL_STORAGE">Leggere la memoria esterna</string>
|
||||
<string name="android.permission.READ_CALENDAR">Leggi dal calendario</string>
|
||||
<string name="android.permission.READ_CALL_LOG">Leggi il registro chiamate</string>
|
||||
<string name="android.permission.READ_CONTACTS">Leggi informazioni dai contatti</string>
|
||||
<string name="android.permission.READ_EXTERNAL_STORAGE">Leggi dalla memoria esterna</string>
|
||||
<string name="android.permission.READ_PHONE_STATE">Rileva lo stato del telefono</string>
|
||||
<string name="android.permission.RECEIVE_BOOT_COMPLETED">Rileva riavvio del dispositivo</string>
|
||||
<string name="android.permission.RECORD_AUDIO">Registra audio</string>
|
||||
<string name="android.permission.SEND_SMS">Invia messaggio di testo</string>
|
||||
<string name="android.permission.VIBRATE">Attiva vibrazione</string>
|
||||
<string name="android.permission.WAKE_LOCK">Mantienere attivo il dispositivo</string>
|
||||
<string name="android.permission.WRITE_EXTERNAL_STORAGE">Scrive sulla SD</string>
|
||||
<string name="android.permission.WRITE_SECURE_SETTINGS">Cambia le impostazioni del dispositivo</string>
|
||||
<string name="android.permission.WRITE_SETTINGS">Cambia le impostazioni del dispositivo</string>
|
||||
<string name="android10WifiToggleNotice">Sfortunatamente, Google ha deciso di rimuovere questa funzione in Android 10. Applicazioni normali non hanno più accesso alla accensione o spegnimento della connessione wifi on. Questo significa che questa azione non avrà effetto su questo dispositivo.</string>
|
||||
<string name="android9RecordAudioNotice">Se si sta usando il livello di rumore come evento di attivazione: sfortunatamente, a partire da Android 9 (Pie), Google ha deciso di non permettere l\'accesso al microfono da parte di applicazioni attive in secondo piano. Pertanto questo evento non ha più effetto e non attiverà nessuna azione.</string>
|
||||
<string name="anotherAppIsRunning">Si è avviata/fermata un\'altra app</string>
|
||||
<string name="android.permission.VIBRATE">Fa vibrare il telefono</string>
|
||||
<string name="android.permission.WAKE_LOCK">Mantieni attivo il dispositivo</string>
|
||||
<string name="android.permission.WRITE_EXTERNAL_STORAGE">Scrivi nella memoria esterna</string>
|
||||
<string name="android.permission.WRITE_SECURE_SETTINGS">Modifica le impostazioni del dispositivo</string>
|
||||
<string name="android.permission.WRITE_SETTINGS">Modifica le impostazioni del dispositivo</string>
|
||||
<string name="android10WifiToggleNotice">Purtroppo Google ha deciso di rimuovere questa funzione in Android 10. Le applicazioni normali non hanno più accesso ad attivazione o disattivazione della connessione wifi, perciò questa azione non avrà effetto su questo dispositivo.</string>
|
||||
<string name="android9RecordAudioNotice">Se si sta usando il livello di rumore come evento di attivazione: purtroppo, a partire da Android 9 (Pie), Google ha deciso di non permettere l\'accesso al microfono da parte di applicazioni attive in secondo piano. Pertanto questo evento non ha più effetto e non attiverà nessuna azione.</string>
|
||||
<string name="anotherAppIsRunning">È stata avviata/fermata un\'altra app</string>
|
||||
<string name="anotherPoiByThatName">Nome già usato per un\'altra posizione.</string>
|
||||
<string name="anotherProfileByThatName">Nome già usato per un altro profilo.</string>
|
||||
<string name="anotherRuleByThatName">Nome già usato per un\'altra regola.</string>
|
||||
<string name="any">qualsiaisi</string>
|
||||
<string name="anyApp">Qualsiasi applicazione</string>
|
||||
<string name="any">qualsiasi</string>
|
||||
<string name="anyApp">qualsiasi applicazione</string>
|
||||
<string name="anyDevice">qualsiasi dispositivo</string>
|
||||
<string name="anyLocation">qualsiasi posizione</string>
|
||||
<string name="anyNumber">qualsiasi numero</string>
|
||||
@ -101,21 +101,21 @@
|
||||
<string name="areYouSure">Sei sicuro?</string>
|
||||
<string name="at">al</string>
|
||||
<string name="audibleSelection">Audio abilitato quando si seleziona lo schermo</string>
|
||||
<string name="autoBrightness">Abilitare luminosità automatica</string>
|
||||
<string name="autoBrightnessNotice">Se usi la luminosità automatica, il valore di luminosità scelto a seguito non sarà probabilmente in use per molto.</string>
|
||||
<string name="batteryLevel">livello della batteria</string>
|
||||
<string name="autoBrightness">Attiva luminosità automatica</string>
|
||||
<string name="autoBrightnessNotice">Se usi la luminosità automatica, il valore di luminosità scelto in seguito probabilmente non sarà in uso per molto.</string>
|
||||
<string name="batteryLevel">Livello della batteria</string>
|
||||
<string name="bluetoothConnection">Connessione Bluetooth</string>
|
||||
<string name="bluetoothConnectionTo">Connessione Bluetooth con %1$s</string>
|
||||
<string name="bluetoothDeviceInRange">Dispositivo Bluetooth %1$s rilevato.</string>
|
||||
<string name="bluetoothDeviceOutOfRange">Dispositivo Bluetooth %1$s non raggiungibile.</string>
|
||||
<string name="bluetoothDisconnectFrom">Connessione Bluetooth con %1$s interrotta</string>
|
||||
<string name="bluetoothFailed">Impossibile attivare il Bluetooth. Questo dispositivo è dotato di Bluetooth?</string>
|
||||
<string name="bluetoothFailed">Impossibile attivare il Bluetooth. Questo dispositivo ne è dotato?</string>
|
||||
<string name="brightnessAuto">luminosità automatica</string>
|
||||
<string name="brightnessManual">luminosità manuale</string>
|
||||
<string name="cancel">Annulla</string>
|
||||
<string name="cantFindSoundFile">Impossibile trovate il file audio %1$s e riprodurlo.</string>
|
||||
<string name="cantMoveDown">Non posso spostare giù l\'elemento. E\' già l\'ultimo.</string>
|
||||
<string name="cantMoveUp">Non posso spostare su l\'elemento. E\' già il primo.</string>
|
||||
<string name="cantMoveDown">Impossibile spostare in basso l\'elemento, è già l\'ultimo.</string>
|
||||
<string name="cantMoveUp">Non posso spostare in alto l\'elemento, è già il primo.</string>
|
||||
<string name="cantRunRule">Impossibile eseguire le regole.</string>
|
||||
<string name="cantStopIt">Non posso fermarla.</string>
|
||||
<string name="cellMastIdleTime">Massimo tempo di inattività del ripetitore</string>
|
||||
@ -124,25 +124,25 @@
|
||||
<string name="clickAndHoldForOptions">Clicca e mantieni premuto un elemento per vedere le opzioni.</string>
|
||||
<string name="closeTo">vicino a</string>
|
||||
<string name="closestPoi">Posizione più vicina:</string>
|
||||
<string name="com.wireguard.android.permission.CONTROL_TUNNELS">Controllare i tunnels dell\'applicazione wireguard</string>
|
||||
<string name="com.wireguard.android.permission.CONTROL_TUNNELS">Controlla i tunnel dell\'applicazione wireguard</string>
|
||||
<string name="configurationExportedSuccessfully">Configurazione esportata con successo.</string>
|
||||
<string name="configurationImportedSuccessfully">Configurazione esportata con successo.</string>
|
||||
<string name="configurationImportedSuccessfully">Configurazione importata con successo.</string>
|
||||
<string name="connected">connesso</string>
|
||||
<string name="connectedToWifi">connesso al wifi \"%1$s</string>
|
||||
<string name="connectedToWifi">connesso al wifi \"%1$s\"</string>
|
||||
<string name="connecting">connessione in corso</string>
|
||||
<string name="connectionToDevice">connessione al dispositivo</string>
|
||||
<string name="continueText">continua</string>
|
||||
<string name="currentId">ID corrente:</string>
|
||||
<string name="currentId">ID attuale:</string>
|
||||
<string name="currentVolume">Volume attuale</string>
|
||||
<string name="deactivate">Disattivazione</string>
|
||||
<string name="deactivated">non attivo</string>
|
||||
<string name="deactivate">Disattiva</string>
|
||||
<string name="deactivated">disattivato</string>
|
||||
<string name="deactivating">Disattivazione in corso</string>
|
||||
<string name="defaultSettings">Ripristino impostazioni di default</string>
|
||||
<string name="delete">rimuovi</string>
|
||||
<string name="deleteCapital">Rimuovi</string>
|
||||
<string name="deletePoi">Cancella posizione</string>
|
||||
<string name="detectedActivity">Attività rilevata:</string>
|
||||
<string name="detectedActivityInVehicle">In un veicolo (auto, bus,...)</string>
|
||||
<string name="detectedActivityInVehicle">In un veicolo (auto, bus,…)</string>
|
||||
<string name="detectedActivityInvalidStatus">Attività non valida</string>
|
||||
<string name="detectedActivityOnBicycle">In bicicletta</string>
|
||||
<string name="detectedActivityOnFoot">A piedi</string>
|
||||
@ -151,8 +151,8 @@
|
||||
<string name="detectedActivityTilting">Ribaltando</string>
|
||||
<string name="detectedActivityUnknown">Sconosciuto</string>
|
||||
<string name="detectedActivityWalking">Camminando</string>
|
||||
<string name="deviceDoesNotHaveBluetooth">Questo dispositivo non sembra avere bluetooth. Puoi comunque configurare questa opzione, ma non avrà probabilmente nessun effetto.</string>
|
||||
<string name="deviceDoesNotHaveNfc">Sembra che il dispositivo non abbia la funzione NFC.</string>
|
||||
<string name="deviceDoesNotHaveBluetooth">Questo dispositivo sembra non disporre del Bluetooth. Si può comunque configurare questa opzione, ma probabilmente senza alcun risultato.</string>
|
||||
<string name="deviceDoesNotHaveNfc">Sembra che il dispositivo non disponga del NFC.</string>
|
||||
<string name="deviceInRange">dispositivo visibile</string>
|
||||
<string name="deviceOutOfRange">dispositivo fuori portata</string>
|
||||
<string name="direction">Direzione</string>
|
||||
@ -163,71 +163,71 @@
|
||||
<string name="directionStringStartsWith">comincia con</string>
|
||||
<string name="disabledFeatures">Funzioni disabilitate</string>
|
||||
<string name="disconnected">disconnesso</string>
|
||||
<string name="disconnectedFromWifi">disconnesso dalla rete wifi \"%1$s</string>
|
||||
<string name="disconnectedFromWifi">disconnesso dalla rete wifi \"%1$s\"</string>
|
||||
<string name="disconnecting">disconnessione in corso</string>
|
||||
<string name="disconnectionFromDevice">disconnesso dal dispositivo</string>
|
||||
<string name="displayNewsOnMainScreen">Visualizza le novità dell\'applicazione sullo schermo principale</string>
|
||||
<string name="displayNewsOnMainScreenDescription">Novità relative solo a questa applicazione, stiamo parlando di un paio per anno, non di più.</string>
|
||||
<string name="displayNewsOnMainScreenDescription">Novità relative solo a questa applicazione, saranno un paio ogni anno, non di più.</string>
|
||||
<string name="distanceBetween">La distanza tra la posizione GPS e la posizione di rete è di %1$d metri. Il raggio minimo è +1 metro.</string>
|
||||
<string name="distanceForGpsUpdate">Distanza per l\'aggiornamento del GPS [m]</string>
|
||||
<string name="distanceForNetworkUpdate">Distanza per l\'aggiornamento della rete [m]</string>
|
||||
<string name="droppingBelow">sta andando sotto</string>
|
||||
<string name="dropsBelow">inferiore</string>
|
||||
<string name="droppingBelow">sta scendendo</string>
|
||||
<string name="dropsBelow">scende sotto</string>
|
||||
<string name="edit">Modifica</string>
|
||||
<string name="end">Fine</string>
|
||||
<string name="enterAPositiveValidNonDecimalNumber">Inserisci un numero intero positivo</string>
|
||||
<string name="enterAname">Inserisci un nome.</string>
|
||||
<string name="enterNameForIntentPair">Definisci un nome per la coppia di intenzioni</string>
|
||||
<string name="enterNameForIntentPair">Definisci un nome per la coppia dell\'Intent</string>
|
||||
<string name="enterPackageName">Inserisci un nome di pacchetto che sia valido.</string>
|
||||
<string name="enterPhoneNumber">Inserisci un numero di telefono. Lascia vuoto per accettare qualsiasi numero.</string>
|
||||
<string name="enterValidAction">Inserisci una azione valida</string>
|
||||
<string name="enterValidReferenceValue">Inserisci un valore di riferimento valido.</string>
|
||||
<string name="enterValueForIntentPair">Definisci un valore per la coppia di Intenzioni.</string>
|
||||
<string name="enterWifiName">Inserire un nome per la wifi. Se vuoto sarà valido per qualsiasi wifi.</string>
|
||||
<string name="enterValueForIntentPair">Definisci un valore per la coppia dell\'Intent.</string>
|
||||
<string name="enterWifiName">Inserisci un nome per la rete wifi. Se vuoto sarà valido per qualsiasi wifi.</string>
|
||||
<string name="entering">entrando in</string>
|
||||
<string name="eraseSettings">Azzera le impostazioni</string>
|
||||
<string name="error">Errore</string>
|
||||
<string name="errorActivatingProfile">Errore nell\'attivazione del profilo:</string>
|
||||
<string name="errorReadingPoisAndRulesFromFile">Errore nella lettura di regole e posizioni dal file.</string>
|
||||
<string name="errorRunningRule">C\'è stato un errore cercando di eseguire una regola.</string>
|
||||
<string name="errorStartingOtherActivity">Errore nel\'avvio dell\'altra attività</string>
|
||||
<string name="errorRunningRule">È avvenuto un errore durante il tentativo di eseguire di una regola.</string>
|
||||
<string name="errorStartingOtherActivity">Errore nell\'avvio dell\'altra attività</string>
|
||||
<string name="errorWritingConfig">Errore nello scrivere la configurazione. È la memoria in sola lettura?</string>
|
||||
<string name="errorWritingFile">Errore nella scrittura delle impostazioni.</string>
|
||||
<string name="exceeding">sta sorpassando</string>
|
||||
<string name="exceeds">è superiore</string>
|
||||
<string name="executeRulesAndProfilesWithSingleClickTitle">Esegui regole/profili con un singolo click.</string>
|
||||
<string name="exportConfiguration">Esporta la configurazione</string>
|
||||
<string name="failedToTriggerBluetooth">Non riesco ad attivare il Bluetooth. Questo dispositivo ha il Bluetooth?</string>
|
||||
<string name="featureNotInFdroidVersion">Questa funzione sfrutta software non basato su codice aperto. Pertanto non è disponibile nella versione F-Droid.</string>
|
||||
<string name="exceeding">sta superando</string>
|
||||
<string name="exceeds">supera</string>
|
||||
<string name="executeRulesAndProfilesWithSingleClickTitle">Esegui regole/profili con un click.</string>
|
||||
<string name="exportConfiguration">Esporta configurazione</string>
|
||||
<string name="failedToTriggerBluetooth">Non riesco ad attivare il Bluetooth. Questo dispositivo ne dispone?</string>
|
||||
<string name="featureNotInFdroidVersion">Questa funzione sfrutta software basato su codice non libero, pertanto non è disponibile nella versione F-Droid.</string>
|
||||
<string name="featuresDisabled">L\'applicazione è in esecuzione in modalità limitata a causa di autorizzazioni mancanti.</string>
|
||||
<string name="fileDoesNotExist">Il file non esiste.</string>
|
||||
<string name="filesHaveBeenMovedTo">Automation usa adesso un percorso nuovo per salvare i tuoi files. Tutti i files di Automation sono stati mossi qui: \"%s\". I permessi di accesso alla memoria esterna non sono più necessari e si possono revocare. Questo verrà permanentemente rimosso in una versione futura.</string>
|
||||
<string name="filesStoredAt">I files di configurazione e log sono salvati nella cartella %1$s. Clicca su questo testo per aprire l\'esploratore di files. Sfortunatamente, questo solo funziona su un dispositivo con accesso root.\n\nPER TUTTI GLI ALTRI DISPOSITIVI: basta usare il bottone \'esporta\' per fare un backup.</string>
|
||||
<string name="filesHaveBeenMovedTo">Automation usa adesso un percorso nuovo per salvare i tuoi file. Tutti i file di Automation sono stati mossi qui: \"%s\". I permessi di accesso alla memoria esterna non sono più necessari e si possono revocare. Questo verrà permanentemente rimosso in una versione futura.</string>
|
||||
<string name="filesStoredAt">I file di configurazione e log sono salvati nella cartella %1$s. Clicca su questo testo per aprire l\'esploratore di file. Sfortunatamente, questo solo funziona su un dispositivo con accesso root.\n\nPER TUTTI GLI ALTRI DISPOSITIVI: basta usare il bottone \'esporta\' per fare un backup.</string>
|
||||
<string name="friday">Venerdì</string>
|
||||
<string name="from">da</string>
|
||||
<string name="general">Generale</string>
|
||||
<string name="generalSettings">Impostazioni globali</string>
|
||||
<string name="generalText">Per utilizzare questo programma è necessario impostare delle regole. Le regole contengono eventi, per esempio l\'arrivare in una determinata zona o essere in un intervallo temporale. Dopo che è stato fatto, fare clic sul pulsante ON / OFF nella home-page.</string>
|
||||
<string name="generalSettings">Impostazioni generali</string>
|
||||
<string name="generalText">Per utilizzare questo programma è necessario impostare delle regole. Le regole contengono eventi, per esempio l\'arrivare in una determinata zona o essere in un intervallo temporale. Dopo che è stato fatto, fare clic sul pulsante ON/OFF nella home-page.</string>
|
||||
<string name="getCurrentPosition">Rileva la posizione attuale</string>
|
||||
<string name="gettingListOfInstalledApplications">Sto cercando le applicazioni installate … </string>
|
||||
<string name="gettingPosition">Sto rilevando la posizione. Attendere prego ...</string>
|
||||
<string name="gettingListOfInstalledApplications">Ottenimento della lista delle applicazioni installate in corso…</string>
|
||||
<string name="gettingPosition">Sto rilevando la posizione. Attendere prego…</string>
|
||||
<string name="googleLocationChicanery">Questa applicazione accumula dati di localizzazione per abilitare regole basate sulla posizione insieme al rilevamento della velocità anche quando l\'applicazione è chiusa o non in uso.</string>
|
||||
<string name="googleLocationChicaneryOld">Questa applicazione accumula dati di localizzazione per determinare se sei attualmente ad una delle posizioni che hai creato. Inoltre, questa funzione è usata per determinare la tua velocità attuale se tale evento è stato attivato nelle regole. Questi rilevamenti sono effettuati anche quando l\'applicazione è chiusa o non in uso (ma solo se il servizio è attivato).</string>
|
||||
<string name="googleSarcasm">Grazie alla infinita sapienza di Google e continui sforzi per proteggere la nostra privacy, nelle regole che possano inviare SMS o coinvolgere lo stato del telefono, sono state rimossi eventi ed azioni rilevanti.</string>
|
||||
<string name="gpsAccuracy">Precisone del GPS [m]</string>
|
||||
<string name="gpsComparison">Comparazione GPS</string>
|
||||
<string name="hapticFeedback">Sensazione tattile (vibrazione al tocco)</string>
|
||||
<string name="headphoneAny">Oppure</string>
|
||||
<string name="googleSarcasm">Grazie alla infinita sapienza di Google e i suoi continui sforzi per proteggere la nostra privacy, nelle regole che possano inviare SMS o coinvolgere lo stato del telefono, sono state rimossi eventi ed azioni rilevanti.</string>
|
||||
<string name="gpsAccuracy">Precisione del GPS [m]</string>
|
||||
<string name="gpsComparison">Confronto del GPS</string>
|
||||
<string name="hapticFeedback">Riscontro tattile (vibra al tocco)</string>
|
||||
<string name="headphoneAny">Uno dei due</string>
|
||||
<string name="headphoneMicrophone">Microfono</string>
|
||||
<string name="headphoneSelectType">Seleziona il tipo di auricolare</string>
|
||||
<string name="headphoneSimple">Auricolari</string>
|
||||
<string name="headsetConnected">Connesso auricolare (tipo: %1$s) </string>
|
||||
<string name="headsetDisconnected">Disconnesso auticolari (tipo: %1$s) </string>
|
||||
<string name="headsetConnected">"Connessi auricolari (tipo: %1$s) "</string>
|
||||
<string name="headsetDisconnected">"Disconnessi auricolari (tipo: %1$s) "</string>
|
||||
<string name="helpTextActivityDetection">Questa funzione può identificare se sei attualmente in movimento e se sei a piedi o in che tipo di veicolo (almeno con una certa precisione). Questa funzione non è completamente integrata con Automation, ma viene fornita dai servizi di Google Play. In pratica, non fornisce un risultato si/no, ma provvede una percentuale del livello di sicurezza dello stato di movimento identificato. Puoi scegliere la percentuale raggiunta la quale Automation accetterà un resultato. Nota: 1) è possibile che più di uno stato sia identificato nello stesso momento. Per esempio, potresti star CAMMINANDO dentro a un bus in movimento; 2) Questo sensore ha bisogno di molte risorse di sistema. Se possibile, potresti considerare delle alternative, per esempio, potresti identificare che stai guidando, forzando una connessione con il vivavoce.</string>
|
||||
<string name="helpTextEnergySaving">Molti produttori di dispositive Android cercano di salvare energia limitando le attività di applicazioni eseguite in secondo piano. Sfortunatamente, questo spesso fa che tali applicazioni non funzionino correttamente e Automation è fra queste. Puoi leggere questa <a href="https://dontkillmyapp.com/">pagina web</a> per scoprire come escludere Automation da queste funzioni di risparmio energetico.</string>
|
||||
<string name="helpTextPoi">Una posizione è composta da cooridinate GPS ed un raggio d\'azione. Dato che il posizionamento realizzato tramite i ripetitori del tuo gestore è piuttosto impreciso (ma veloce e consuma poca batteria), è bene non specificare un raggio troppo piccolo. L\'applicazione suggerisce un raggio minimo quando si crea una nuova posizione.</string>
|
||||
<string name="helpTextPoi">Una posizione è composta da coordinate GPS ed un raggio d\'azione. Dato che il posizionamento realizzato tramite i ripetitori del tuo gestore è piuttosto impreciso (ma veloce e consuma poca batteria), è bene non specificare un raggio troppo piccolo. L\'applicazione suggerisce un raggio minimo quando si crea una nuova posizione.</string>
|
||||
<string name="helpTextProcessMonitoring">Se si specifica una regola che controlli l\'esecuzione di un processo, Automation eseguirà la verifica ogni x secondi (con x selezionabile nelle impostazioni). Bisogna considerare che un monitoraggio costante provocherebbe un rapido esaurimento della batteria e non esistono notifiche di questo tipo di attività proviste dal sistema operativo.</string>
|
||||
<string name="helpTextRules">Una regola sarà eseguita quando tutti i suoi eventi risultano veri. Basta che solo un evento non sia eseguito e la regola non si attiverà. Per eseguire una regola in base a diversi eventi individuali, è sufficiente creare regole specifiche per ogni set di eventi.</string>
|
||||
<string name="helpTextRules">Gli eventi di attivazione sono in AND logico. La regola sarà eseguita solo se tutti gli eventi sono soddisfatti. Per l\'OR logico basta creare un\'altra regola.</string>
|
||||
<string name="helpTextSound">Nello schermo principale puoi bloccare temporaneamente i cambi ai suoni per evitare l\'esecuzione di regole che facciano cambi alle attività sonore. Per esempio, potresti essere in una situatione o in un luogo dove normalmente ascoltare il suono di una suoneria è ok, ma in questa occasione bisognerebbe evitarlo. Questa funzione si disattiverà automaticamente non appena sia trascorso il tempo selezionato. Fai Click sul bottone + per raggiungere la quantità di tempo desiderata. Una volta attiva, questa si può disattivare nuovamente usando il pulsante di attivazione (e in questo modo, si riattiveranno le regole basate su cambi sonori).</string>
|
||||
<string name="helpTextTimeFrame">Se si specifica una regola con un intervallo temporale si hanno due scelte. È possibile scegliere se si desidera attivare la regola all\'interno o all\'esterno dell\'intervallo di tempo. In entrambi i casi l\'azione verrà eseguita una sola volta. Quindi, se si crea una regola che imposta il profilo su vibrazione nell\'intervallo temporale xyz, il telefono, passato allo stato vibrazione, rimarrà definitivamente in tale stato anche dopo lo scadere dell\'intervallo di tempo. Se si desidera che ciò avvenga è necessario specificare un\'altra regola con un altro periodo di tempo.</string>
|
||||
<string name="helpTextToggable">Le regole hanno un segno di spunta chiamato "Reversibile". Ciò significa che, se una regola viene eseguita al verificarsi di un evento e poi quest\'ultimo si verifica una seconda volta, il comando della regola verrà eseguito una ulteriore volta in modalità inversa, se possibile. Attualmente questo avverrà solo in combinazione con etichette NFC. Se le si tocca due volte la regola associata invertirà la situazione attuale. Per esempio una regola “Reversibile” può disattivare il WiFi se attivo e viceversa attivarlo se non attivo.</string>
|
||||
@ -242,15 +242,15 @@
|
||||
<string name="httpAttemptsTimeoutTitle">Timeout [sec]</string>
|
||||
<string name="httpAttemptsTitle">Numero di tentativi HTTP</string>
|
||||
<string name="importConfiguration">Importa configurazione</string>
|
||||
<string name="importExportExplanation">Quando si clicca su importa o esporta, stai scegliendo la direzione in cui i files vengono importati o esportati. Quando si procede alla esportazione, files esistenti potrebbero essere sovrascritti.</string>
|
||||
<string name="importExportExplanation">Quando si clicca su importa o esporta, stai scegliendo la direzione in cui i file vengono importati o esportati. Quando si procede alla esportazione, file esistenti potrebbero essere sovrascritti.</string>
|
||||
<string name="importNumberFromContacts">Importa numero dai contatti</string>
|
||||
<string name="incoming">in arrivo</string>
|
||||
<string name="incomingAdjective">in arrivo</string>
|
||||
<string name="incomingCallFrom">Chiamata in arrivo da %1$s.</string>
|
||||
<string name="incomingCallsRingtone">Suoneria per le chiamate in arrivo</string>
|
||||
<string name="insideOrOutsideTimeFrames">Dentro o fuori questi intervalli?</string>
|
||||
<string name="intentDataComment">Se il tuo parametro è di tipo Uri e usi \"IntentData\" come nome (in maiuscole o minuscole non importa), il parametro non verrà aggiunto come parametro normale con putExtra(), ma sarà aggiunto all\'intento con setData().</string>
|
||||
<string name="invalidDevice">Dispositivo non valido.</string>
|
||||
<string name="intentDataComment">Se il tuo parametro è di tipo Uri e usi \"IntentData\" come nome (in maiuscole o minuscole non importa), il parametro non verrà aggiunto come parametro normale con putExtra(), ma sarà aggiunto all\'Intent con setData().</string>
|
||||
<string name="invalidDevice">Dispositivo non valido</string>
|
||||
<string name="invalidPoiName">Nome posizione non valido.</string>
|
||||
<string name="invalidProfileName">Nome profilo non valido.</string>
|
||||
<string name="is">è</string>
|
||||
@ -266,15 +266,15 @@
|
||||
<string name="locationEngineDisabledLong">Purtroppo la tua posizione non può più essere determinata. Un debito di gratitudine è dovuto a Google per la sua infinita saggezza e amabilità.\\n\\nVediamo di approfondire questo problema. A partire da Android 10 è stato introdotto un nuovo permesso che è necessario per determinare la vostra posizione in secondo piano (che naturalmente è necessario per un\'app come questa). Sebbene la consideri una buona idea in generale, i problemi che comporta per gli sviluppatori non lo sono.\\n\\nWQuando si sviluppa un\'app si può cercare di qualificarsi per questo permesso rispettando un catalogo di requisiti. Purtroppo le nuove versioni della mia app sono state rifiutate per un periodo di tre mesi. Ho soddisfatto tutti questi requisiti, mentre il merdoso supporto allo sviluppo di Google ha affermato che non l\'ho fatto. Dopo aver dato loro la prova che l\'ho fatto - ho ottenuto una risposta del tipo \"non posso più aiutarti\". Alla fine mi sono arreso. \\n\\nDi conseguenza, la versione di Google Play non può più usare la tua posizione come trigger. La mia unica opzione alternativa sarebbe stata quella di avere questa applicazione rimossa dal negozio interamente.\\n\\nNe sono molto dispiaciuto, ma ho fatto del mio meglio per discutere con un \"supporto\" che ripetutamente non ha superato il test di Turing.\n\\nInfine, c\'è una buona notizia: puoi ancora avere tutto!\\n\\nAutomation è adesso una applicazione di codice aperto e si può trovare su F-Droid. Questo è un app store che si preoccupa davvero della tua privacy - invece che fingere di farlo. Basta fare il backup del tuo file di configurazione, disinstallare questa app, installarla di nuovo da F-Droid e ripristinare il tuo file di configurazione - fatto.\\n\\nClicca qui per maggiori informazioni:</string>
|
||||
<string name="locationEngineDisabledShort">La localizzazione non può più essere determinata. Clicca qui per scoprirne il perché.</string>
|
||||
<string name="locationEngineNotActive">Ricerca posizione non attiva.</string>
|
||||
<string name="lockSoundChanges">Blocca il cambio dei suoni:</string>
|
||||
<string name="logFileMaxSizeSummary">Massima dimensione del file di log in Megabyte. Tronca quando la dimensione eccede.</string>
|
||||
<string name="lockSoundChanges">Blocca il cambio dei suoni</string>
|
||||
<string name="logFileMaxSizeSummary">Massima dimensione del file di log in Megabyte. Tronca quando la dimensione eccede.</string>
|
||||
<string name="logFileMaxSizeTitle">Massima dimensione del file di log [Mb]</string>
|
||||
<string name="logLevelSummary">Dettaglio del file di Log (1=minimo, 5=massimo)</string>
|
||||
<string name="logLevelSummary">Dettaglio del file di log (1=minimo, 5=massimo)</string>
|
||||
<string name="logLevelTitle">Dettaglio del file di log</string>
|
||||
<string name="logServiceStopping">Arrestando il servizio.</string>
|
||||
<string name="logServiceStopping">Arresto del servizio in corso.</string>
|
||||
<string name="longitude">Longitudine</string>
|
||||
<string name="mainScreenPermissionNote">Automation richiede ulteriori autorizzazioni per funzionare correttamente. Clicca su questo testo per saperne di più e richiederle.</string>
|
||||
<string name="manageLocations">Creare o modificare posizioni</string>
|
||||
<string name="manageLocations">Crea o modifica posizioni</string>
|
||||
<string name="matching">abbinando</string>
|
||||
<string name="messageNotShownAgain">Questo messaggio non sarà mostrato più.</string>
|
||||
<string name="minimumDistanceChangeForGpsLocationUpdates">Minimo intervallo (in metri) per aggiornare le posizioni GPS </string>
|
||||
@ -283,24 +283,24 @@
|
||||
<string name="monday">Lunedì</string>
|
||||
<string name="moreSettings">Altre impostazioni</string>
|
||||
<string name="moveDown">Sposta verso il basso</string>
|
||||
<string name="moveUp">Sposta versol\'alto</string>
|
||||
<string name="muteTextToSpeechDuringCallsSummary">Disabilitazione del TextToSpeach durante le chiamate</string>
|
||||
<string name="muteTextToSpeechDuringCallsTitle">Silenziare durante le chiamate</string>
|
||||
<string name="moveUp">Sposta verso l\'alto</string>
|
||||
<string name="muteTextToSpeechDuringCallsSummary">Silenzia il TextToSpeach durante le chiamate</string>
|
||||
<string name="muteTextToSpeechDuringCallsTitle">Silenzia durante le chiamate</string>
|
||||
<string name="name">Nome</string>
|
||||
<string name="needLocationPermForWifiList">L\'elenco delle wifi a cui il tuo dispositivo è stato connesso potrebbe essere usato per determinare i luoghi in cui sei stato. Questo è il motivo per cui il permesso di localizzazione è richiesto per caricare l\'elenco delle wifi. Se vuoi essere in grado di sceglierne una dalla lista devi concedere questo permesso. Altrimenti puoi ancora inserire il nome della tua wifi manualmente.</string>
|
||||
<string name="needLocationPermForWifiList">L\'elenco delle reti wifi a cui il dispositivo è stato connesso potrebbe essere usato per determinare i luoghi in cui sei stato. Questo è il motivo per cui il permesso di localizzazione è richiesto per caricare l\'elenco delle wifi. Se vuoi essere in grado di sceglierne una dalla lista devi concedere questo permesso. Altrimenti puoi ancora inserire il nome della tua wifi manualmente.</string>
|
||||
<string name="networkAccuracy">Precisione della rete [m]</string>
|
||||
<string name="newId">Nuovo ID:</string>
|
||||
<string name="newNfcId">Scrivi un nuovo ID NFC</string>
|
||||
<string name="newThreadRules">Nuova discussione</string>
|
||||
<string name="newsOptIn">Vuoi ricevere delle notizie su questa app (solo quelle importanti) nella schermata principale? Queste vengono scaricate dal sito web dello sviluppatore. Non ci sarà nessuna notifica intrusiva, solo un testo nella schermata principale quando apri l\'app.</string>
|
||||
<string name="nfcApplyTagToRule">Applicazione della etichetta alla regola</string>
|
||||
<string name="nfcBringTagIntoRange">Portare una etichetta NFC nel campo d\'azione.</string>
|
||||
<string name="nfcBringTagIntoRangeToRead">Avvicina la etichetta da leggere.</string>
|
||||
<string name="nfcApplyTagToRule">Applica etichetta alla regola</string>
|
||||
<string name="nfcBringTagIntoRange">Porta una etichetta NFC nel campo d\'azione.</string>
|
||||
<string name="nfcBringTagIntoRangeToRead">Avvicina l\'etichetta da leggere.</string>
|
||||
<string name="nfcEnterValidIdentifier">Inserire un nome valido per l\'etichetta (come "Porta d\'ingresso di casa").</string>
|
||||
<string name="nfcNoNdefIntentBut">Nessun intento NFC NDEF, ma</string>
|
||||
<string name="nfcNoNdefIntentBut">Nessun Intent NFC NDEF, ma</string>
|
||||
<string name="nfcNoTag">Nessuna etichetta rilevata.</string>
|
||||
<string name="nfcNotSupportedInThisAndroidVersionYet">NFC non ancora supportato in questa versione di Android.</string>
|
||||
<string name="nfcReadTag">Lettura ID dall\'etichetta</string>
|
||||
<string name="nfcReadTag">Leggi ID dall\'etichetta</string>
|
||||
<string name="nfcTag">Etichetta NFC</string>
|
||||
<string name="nfcTagDataNotUsable">Dati dell\'etichetta non leggibili, si prega di riscriverli.</string>
|
||||
<string name="nfcTagDiscovered">Etichetta rilevata</string>
|
||||
@ -310,15 +310,15 @@
|
||||
<string name="nfcTagWrittenSuccessfully">Scrittura dell\'etichetta eseguita con successo.</string>
|
||||
<string name="nfcUnsupportedEncoding">Codifica non supportata:</string>
|
||||
<string name="nfcValueNotSuitable">Valore memorizzato non adatto.</string>
|
||||
<string name="nfcWriteTag">Scrittura etichetta</string>
|
||||
<string name="nfcWriteTag">Scrivi etichetta</string>
|
||||
<string name="no">No</string>
|
||||
<string name="noApplicableFilesFoundInDirectory">Nessun file adatto è stato trovato in quella directory.</string>
|
||||
<string name="noChangeSelectedProfileDoesntMakeSense">Nessun cambiamento selezionato. Questo profilo non ha senso.</string>
|
||||
<string name="noChangeSelectedProfileDoesntMakeSense">Nessun cambiamento selezionato, questo profilo non ha senso.</string>
|
||||
<string name="noDataChangedReadingAnyway">Sembra che non siano state salvate le modifiche. Tuttavia ci possono essere stati cambiamenti in memoria che devono essere rimossi. Devo ricaricare il file.</string>
|
||||
<string name="noDevice">nessun dispositivo</string>
|
||||
<string name="noFileManageInstalled">Nessun esploratore di files installato.</string>
|
||||
<string name="noFileManageInstalled">Nessun esploratore di file installato.</string>
|
||||
<string name="noFilesImported">Non è stato possibile importare nessun file.</string>
|
||||
<string name="noKnownWifis">Non c\'è nessuna wifi conosciuta sul tuo dispositivo.</string>
|
||||
<string name="noKnownWifis">Non c\'è nessuna rete wifi nota sul dispositivo.</string>
|
||||
<string name="noMapsApplicationFound">Non trovo un navigatore installato.</string>
|
||||
<string name="noPoisDefinedShort">Nessuna posizione indicata.</string>
|
||||
<string name="noPoisSpecified">Non hai specificato nessuna posizione. È necessario.</string>
|
||||
@ -329,8 +329,8 @@
|
||||
<string name="none">nessuno</string>
|
||||
<string name="notAllFilesImported">Non è stato possibile importare tutti i file rilevanti.</string>
|
||||
<string name="notification">Notifica</string>
|
||||
<string name="notificationAppears">La notifica appare</string>
|
||||
<string name="notificationDisappears">La notifica non appare</string>
|
||||
<string name="notificationAppears">La notifica compare</string>
|
||||
<string name="notificationDisappears">La notifica scompare</string>
|
||||
<string name="notificationRingtone">Tono di notifica</string>
|
||||
<string name="notificationTriggerExplanation">Questo evento risponderà ad altre applicazioni che aprono notifiche nell\'area apposita (o che vengono chiuse). Puoi specificare un\'altra applicazione da cui la notifica deve provenire. Se non lo fai, saranno incluse le notifiche da qualsiasi altra applicazione. Puoi anche specificare le stringhe che devono o non devono essere presenti nel titolo o nel corpo della notifica. Il confronto fatto non è sensibile alle maiuscole e alle minuscole.</string>
|
||||
<string name="number">numero</string>
|
||||
@ -345,17 +345,17 @@
|
||||
<string name="packageName">Nome del pacchetto</string>
|
||||
<string name="parameterName">Nome parametro</string>
|
||||
<string name="parameterType">Tipo parametro</string>
|
||||
<string name="parameterValue">Valore</string>
|
||||
<string name="parameterValue">Valore del parametro</string>
|
||||
<string name="password">Password</string>
|
||||
<string name="permissionsExplanation">Spiegazione delle autorizzazioni richieste</string>
|
||||
<string name="permissionsExplanationGeneric">L\'applicazione si sta eseguendo in modalità limitata ed ha pertanto disattivato alcune funzioni. Per funzionare appieno richiede ulteriori permessi. Se vuoi utilizzare tutte le funzionalità è necessario concedere i permessi nelle successive finestre o alcune regole non potranno essere eseguite. Di seguito ti viene data una spiegazione dei permessi richiesti. Clicca su \"Continua\" quando sei pronto a procedere.</string>
|
||||
<string name="permissionsExplanationGeneric">Si sta eseguendo l\'applicazione in modalità limitata, pertanto alcune funzioni sono disattivate. Per funzionare appieno richiede ulteriori permessi. Se vuoi utilizzare tutte le funzionalità, è necessario concedere i permessi nelle successive finestre altrimenti alcune regole non potranno essere eseguite. Di seguito ti viene data una spiegazione dei permessi richiesti. Clicca su \"Continua\" quando sei pronto a procedere.</string>
|
||||
<string name="permissionsExplanationSmall">Per attivare la funzione che hai appena tentato di utilizzare, sono necessari ulteriori permessi. Clicca \"Continua\" per richiederli.</string>
|
||||
<string name="permissionsTitle">Permessi necessari</string>
|
||||
<string name="permissionsTitle">Sono necessari dei permessi</string>
|
||||
<string name="phoneCall">Chiamata</string>
|
||||
<string name="phoneDirection">Seleziona se\nentrante o uscente</string>
|
||||
<string name="phoneNrReplacementError">Non ho l\'ultimo numero di telefono e quindi non posso inserirlo nella variabile.</string>
|
||||
<string name="phoneNumber">Numero di telefono</string>
|
||||
<string name="phoneNumberExplanation">È possibile inserire un numero di telefono specifico, ma non è necessario. Se vuoi specificarne uno, puoi sceglierlo dalla tua rubrica o inserirlo manualmente. Inoltre puoi usare espressioni regolari. Per testare un\'espressione regolare mi piace questa pagina:</string>
|
||||
<string name="phoneNumberExplanation">È possibile inserire un numero di telefono specifico, ma non è obbligatorio. Se si vuole farlo, si può scegliere dalla rubrica o lo si può inserire manualmente. Si può anche usare un\'espressione regolare. Per testarle, mi piace questa pagina:</string>
|
||||
<string name="playSound">Esegui suono</string>
|
||||
<string name="pleaseEnterValidLatitude">Inserisci una latitudine valida.</string>
|
||||
<string name="pleaseEnterValidLongitude">Inserisci una longitudine valida.</string>
|
||||
@ -365,15 +365,15 @@
|
||||
<string name="pleaseSpecifiyTrigger">Indica almeno un evento.</string>
|
||||
<string name="poi">Posizione</string>
|
||||
<string name="poiList">Elenco delle posizioni:</string>
|
||||
<string name="poiStillReferenced">Ci sono ancora regole che fanno riferimento a questa posizione (%1$s). Quindi non posso cancellarla ancora.</string>
|
||||
<string name="poiStillReferenced">Ci sono ancora regole che fanno riferimento a questa posizione (%1$s), per cui non posso ancora cancellarla.</string>
|
||||
<string name="pois">Posizioni</string>
|
||||
<string name="positioningEngine">Modulo di posizionamento</string>
|
||||
<string name="positioningSettings">Impostazioni del posizionamento</string>
|
||||
<string name="positioningThresholds">Soglie del posizionamento</string>
|
||||
<string name="positioningWindowNotice">Se sei all\' interno di un edificio è fortemente consigliato avvicinarsi ad una finestra fino a quando è stata trovata una posizione. Diversamente la ricerca potrebbe richiedere molto tempo o non riuscire a trovare nulla.</string>
|
||||
<string name="positioningWindowNotice">Se sei all\'interno di un edificio è fortemente consigliato avvicinarsi ad una finestra fino a quando è stata trovata una posizione. Diversamente la ricerca potrebbe richiedere molto tempo o non riuscire a trovare nulla.</string>
|
||||
<string name="postsNotification">%1$s notifica dei messaggi</string>
|
||||
<string name="prefsImportError">C\'è stato un errore nell\'importazione delle preferenze.</string>
|
||||
<string name="privacy">Informativa sulla Privacy</string>
|
||||
<string name="privacy">Informativa sulla privacy</string>
|
||||
<string name="privacyConfirmationText">Sarai reindirizzato al sito dello sviluppatore per scaricare l\'informativa sulla privacy.</string>
|
||||
<string name="privacyLocationingSummary">Evita i metodi di localizzazione che possono inviare la tua posizione a un provider, ad esempio Google. Userà solo il GPS e pertanto potrebbe essere lento o non funzionare correttamente.</string>
|
||||
<string name="privacyLocationingTitle">Solo posizioni private</string>
|
||||
@ -385,20 +385,20 @@
|
||||
<string name="publishedOn">pubblicato il</string>
|
||||
<string name="radiusHasToBePositive">Il raggio deve essere un numero positivo.</string>
|
||||
<string name="radiusWithUnit">Raggio [m]</string>
|
||||
<string name="readLocation">Legge la posizione</string>
|
||||
<string name="readLocation">Leggi la posizione</string>
|
||||
<string name="referenceValueForNoiseLevelMeasurementsSummary">Valore di riferimento fisico per la misura di rumore</string>
|
||||
<string name="referenceValueForNoiseLevelMeasurementsTitle">Riferimento per la misura di rumore</string>
|
||||
<string name="rememberLastActivePoiSummary">Se sei in una posizione, riavvia il tuo dispositivo o l\'applicazione e lascia la posizione. L\'applicazione eseguirà le regole associate alla uscita dal luogo al suo prossimo avvio.</string>
|
||||
<string name="rememberLastActivePoiSummary">Se sei in una posizione, riavvia il tuo dispositivo o l\'applicazione e lascia la posizione. L\'applicazione eseguirà le regole associate all\'uscita dal luogo al suo prossimo avvio.</string>
|
||||
<string name="rememberLastActivePoiTitle">Ricorda la ultima posizione attiva</string>
|
||||
<string name="removedNotification">la notifica da %1$s rimossa</string>
|
||||
<string name="ringing">squillando</string>
|
||||
<string name="roaming">Roaming</string>
|
||||
<string name="rootExplanation">È necessario avere permessi di root per utilizzare questa funzione. Una volta abilitato l\'accesso root, dovrai \"eseguire la regola manualmente\" per attivare la richiesta di autorizzazione come superuser. Quando la finestra di superuser appare, bisognerà autorizzare l\'applicazione a utilizzare superuser sempre. In caso contrario, la regola non potrà funzionare quando il telefono è inattivo.</string>
|
||||
<string name="rootExplanation">È necessario avere i permessi di root per utilizzare questa funzione. Una volta abilitato l\'accesso root, dovrai \"eseguire la regola manualmente\" per attivare la richiesta di autorizzazione come superuser. Nella finestra di popup di superuser, bisognerà consentire sempre l\'esecuzione dell\'applicazione con questi permessi. In caso contrario, la regola non potrà funzionare quando il telefono è inattivo.</string>
|
||||
<string name="rule">Regola</string>
|
||||
<string name="ruleActivate">Attivando la regola %1$s</string>
|
||||
<string name="ruleActivateToggle">Attivando la regola %1$s in modalità reversibile</string>
|
||||
<string name="ruleActive">Regola attiva</string>
|
||||
<string name="ruleHistory">Cronologia delle regole (dalla più recente):</string>
|
||||
<string name="ruleHistory">Cronologia delle regole (dalla più recente):</string>
|
||||
<string name="ruleLegend">Verde = abilitata, Rosso = disabilitata, Giallo = necessita ulteriori permessi</string>
|
||||
<string name="ruleList">Elenco delle regole:</string>
|
||||
<string name="ruleName">Nome della regola</string>
|
||||
@ -408,12 +408,12 @@
|
||||
<string name="rulesImportError">C\'è stato un errore nell\'importazione di regole e posizioni</string>
|
||||
<string name="rulesImportedSuccessfully">Le regole e le posizioni sono state importate con successo.</string>
|
||||
<string name="runManually">Esecuzione manuale</string>
|
||||
<string name="satisfactoryAccuracyGps">Precisione minima in metri quando la posizione è individuata via GPS</string>
|
||||
<string name="satisfactoryAccuracyNetwork">Precisione minima quando la localizzazione è effettuata in metri attraverso i ripetitori</string>
|
||||
<string name="satisfactoryAccuracyGps">Precisione sufficiente in metri quando la posizione è individuata tramite GPS</string>
|
||||
<string name="satisfactoryAccuracyNetwork">Precisione sufficiente quando la localizzazione è effettuata in metri attraverso i ripetitori</string>
|
||||
<string name="saturday">Sabato</string>
|
||||
<string name="save">Salva</string>
|
||||
<string name="savePoi">Salva posizione</string>
|
||||
<string name="saveRule">Salva Regola</string>
|
||||
<string name="saveRule">Salva regola</string>
|
||||
<string name="screenLockSoundNotice">I suoni di blocco dello schermo non possono più essere modificati automaticamente sui dispositivi con Android versione 6.0 o superiore. Qualunque cosa tu abbia impostato qui, non funzionerà in nessuna direzione.</string>
|
||||
<string name="screenLockUnlockSound">Suono di blocco/sblocco schermo</string>
|
||||
<string name="screenRotationAlreadyDisabled">Rotazione schermo già disattivata.</string>
|
||||
@ -421,22 +421,22 @@
|
||||
<string name="screenRotationDisabled">Rotazione schermo disabilitata.</string>
|
||||
<string name="screenRotationEnabled">Rotazione schermo attivata.</string>
|
||||
<string name="selectActivityToBeStarted">Seleziona l\'attività del pacchetto scelto</string>
|
||||
<string name="selectApplication">Scegli App</string>
|
||||
<string name="selectApplication">Scegli app</string>
|
||||
<string name="selectBattery">Seleziona il livello di batteria</string>
|
||||
<string name="selectConnectionOption">Seleziona una opzione di connessione.</string>
|
||||
<string name="selectDeviceFromList">uno dalla lista</string>
|
||||
<string name="selectDeviceOption">Seleziona una opzione di dispositivo</string>
|
||||
<string name="selectDeviceOption">Seleziona una opzione di dispositivo.</string>
|
||||
<string name="selectNoiseLevel">Seleziona il livello di rumore</string>
|
||||
<string name="selectOneDay">Seleziona almeno un giorno</string>
|
||||
<string name="selectPackageOfApplication">Seleziona il pacchetto dell\'applicazione</string>
|
||||
<string name="selectPoi">Seleziona la posizione</string>
|
||||
<string name="selectSoundFile">Select sound file</string>
|
||||
<string name="selectSoundFile">Scegli file musicale</string>
|
||||
<string name="selectSoundProfile">Seleziona il profilo audio</string>
|
||||
<string name="selectSpeed">Seleziona la velocità</string>
|
||||
<string name="selectToggleDirection">Seleziona acceso o spento?</string>
|
||||
<string name="selectTypeOfAction">Seleziona il tipo di azione</string>
|
||||
<string name="selectTypeOfActivity">Seleziona il tipo di attività</string>
|
||||
<string name="selectTypeOfIntentPair">Seleziona il tipo per la coppia di Intenzioni</string>
|
||||
<string name="selectTypeOfIntentPair">Seleziona il tipo per la coppia dell\'Intent</string>
|
||||
<string name="selectTypeOfTrigger">Seleziona il tipo di evento</string>
|
||||
<string name="sendTextMessage">Invia messaggio di testo</string>
|
||||
<string name="service">Servizio:</string>
|
||||
@ -444,9 +444,9 @@
|
||||
<string name="serviceNotRunning">Servizio non attivo.</string>
|
||||
<string name="serviceStarted">Il servizio di Automation è attivo.</string>
|
||||
<string name="serviceStopped">Il servizio di Automation è stato fermato.</string>
|
||||
<string name="serviceWontStart">Nessuna regola definita. Il servizio non può iniziare.</string>
|
||||
<string name="setScreenBrightness">Impostare la luminosità dello schermo</string>
|
||||
<string name="setScreenBrightnessEnterValue">Digitare la luminosità desiderata (da 0 a 100).</string>
|
||||
<string name="serviceWontStart">Nessuna regola definita. Il servizio non può essere avviato.</string>
|
||||
<string name="setScreenBrightness">Imposta la luminosità dello schermo</string>
|
||||
<string name="setScreenBrightnessEnterValue">Inserisci la luminosità voluta (da 0 a 100).</string>
|
||||
<string name="settings">Impostazioni</string>
|
||||
<string name="settingsCategoryHttp">Richieste HTTP(s)</string>
|
||||
<string name="settingsCategoryNoiseLevelMeasurements">Misura del livello di rumore</string>
|
||||
@ -456,17 +456,17 @@
|
||||
<string name="settingsSetToDefault">Impostazioni predefinite ripristinate.</string>
|
||||
<string name="settingsWillTakeTime">Alcune impostazioni non saranno applicate prima che alcune impostazioni contestuali cambino o che il servizio venga riavviato.</string>
|
||||
<string name="shareConfigAndLogExplanation">Questo creerà una email con la tua configurazione e i file di log allegati come file zip. Non sarà inviata automaticamente, dovrai premere \"invia\". Puoi anche cambiare il destinatario con te stesso, per esempio.</string>
|
||||
<string name="shareConfigAndLogFilesWithDev">Condividere i file di configurazione e di registro con lo sviluppatore (via e-mail).</string>
|
||||
<string name="showHelp">Mostra Aiuto</string>
|
||||
<string name="shareConfigAndLogFilesWithDev">Allega i file di configurazione e di registro</string>
|
||||
<string name="showHelp">Mostra aiuto</string>
|
||||
<string name="showIcon">Mostra icona</string>
|
||||
<string name="showIconWhenServiceIsRunning">Mostra una icona quando il servizio è attivo (nasconderla funziona solo in versioni inferiori ad Android 7)</string>
|
||||
<string name="showIconWhenServiceIsRunning">Mostra una icona quando il servizio è attivo (nasconderla funziona solo in versioni inferiori ad Android 7). Se hai una versione superiore, vai alle impostazioni di sistema, quindi Automation, e poi seleziona Notifiche, dove potrai disabilitare la \"Service notification\".</string>
|
||||
<string name="showOnMap">Mostra sulla mappa</string>
|
||||
<string name="someOptionsNotAvailableYet">Alcune opzioni sono disabilitate in quanto non ancora implementate. Saranno introdotte in una versione successiva.</string>
|
||||
<string name="soundMode">Modalità sonora</string>
|
||||
<string name="soundModeNormal">Normale</string>
|
||||
<string name="soundModeSilent">Silenziosa</string>
|
||||
<string name="soundModeVibrate">Vibrazione</string>
|
||||
<string name="soundSettings">Impostazioni del suono</string>
|
||||
<string name="soundSettings">Impostazioni audio</string>
|
||||
<string name="speedMaximumTime">Tempo in minuti</string>
|
||||
<string name="speedMaximumTimeBetweenLocations">Tempo massimo tra la rilevazione di due posizioni per determinarne la velocità.</string>
|
||||
<string name="start">Inizio</string>
|
||||
@ -477,19 +477,19 @@
|
||||
<string name="startAppChoiceNote">Qui hai 2 opzioni generali:\n\n1. Puoi avviare un programma selezionando un\'attività. Immagina questo come la preselezione di una specifica schermata/finestra di un\'applicazione. Tieni a mente che questo potrebbe non funzionare sempre. Questo perché le finestre di un\'applicazione potrebbero interagire tra loro, ad esempio per passarsi dei parametri. Quando si avvia direttamente una schermata specifica la cui\n\ninterazione non è ancora avvenuta, la finestra potrebbe chiudersi istantaneamente (quindi non verrà mai mostrata). Ma puoi provare comunque! Inserisci un percorso di attività manualmente, ma si raccomanda di usare il pulsante \"Seleziona\". Se decidi di inserirlo manualmente, digita il nome del pacchetto dell\'applicazione nel campo superiore e il percorso completo dell\'attività in quello inferiore.\n\n2. Selezione per azione. Invece che selezionare una specifica finestra puoi anche avviare un programma per mezzo di un\'azione. Questo è come gridare "Vorrei xyz" e se c\'è un\'applicazione installata che è registrata con quella funzione, verrà avviata. Un buon esempio sarebbe avviare un navigatore - potresti anche averne più di uno installato (ma uno è di solito quello di default). Devi inserire questo manualmente, mentre PackageName è opzionale qui. Tieni a mente che nessuna variabile sarà risolta. Se vuoi avviare la fotocamera per esempio usando \"MediaStore.ACTION_IMAGE_CAPTURE\" non funzionerà. Devi dare un\'occhiata alla documentazione di Android e usare invece il valore effettivo di questa variabile che in questo esempio sarebbe \"android.media.action.IMAGE_CAPTURE\".</string>
|
||||
<string name="startAppSelectionType">Metodo per\nselezionare l\'applicazione</string>
|
||||
<string name="startAppStartType">Seleziona tipo di avvio</string>
|
||||
<string name="startAtSystemBoot">Avvio automatico al boot</string>
|
||||
<string name="startAtSystemBoot">Avvia all\'accensione</string>
|
||||
<string name="startAutomationAsService">Avvia Automation come un servizio</string>
|
||||
<string name="startNewThreadForRuleExecution">Iniziata nuova esecuzione per l\'attivazione della regola.</string>
|
||||
<string name="startOtherActivity">Inizia una nuova app</string>
|
||||
<string name="startScreen">Schermo di Avvio</string>
|
||||
<string name="startOtherActivity">Avvia una nuova app</string>
|
||||
<string name="startScreen">Schermata di avvio</string>
|
||||
<string name="startScreenSummary">Seleziona la schermata con cui le applicazioni si aprono all\'inizio.</string>
|
||||
<string name="startServiceAfterAppUpdate">Riavvia automaticamente il servizio se era già in esecuzione, dopo che l\'applicazione venga aggiornata.</string>
|
||||
<string name="startServiceAfterAppUpdate">Riavvia automaticamente il servizio se era già in esecuzione, dopo che l\'applicazione viene aggiornata.</string>
|
||||
<string name="startServiceAfterAppUpdateShort">Riavvio del servizio dopo l\'aggiornamento</string>
|
||||
<string name="started">avviato</string>
|
||||
<string name="starting">avviando</string>
|
||||
<string name="starting">avvio in corso</string>
|
||||
<string name="status">Stato</string>
|
||||
<string name="stillGettingPosition">Ancora in attesa della posizione</string>
|
||||
<string name="stopped">terminatoo</string>
|
||||
<string name="stopped">terminato</string>
|
||||
<string name="stopping">terminando</string>
|
||||
<string name="storeSettings">Leggere e scrivere le impostazioni</string>
|
||||
<string name="stringNotAllowed">La stringa %1$s non è permessa.</string>
|
||||
@ -515,48 +515,48 @@
|
||||
<string name="timeoutForGpsComparisonsTitle">Timeout del GPS [sec]</string>
|
||||
<string name="title">Titolo</string>
|
||||
<string name="to">a</string>
|
||||
<string name="toggableRules">Regole \"Reversibili\"</string>
|
||||
<string name="toggableRules">Regole reversibili</string>
|
||||
<string name="toggle">reversibile</string>
|
||||
<string name="toggleNotAllowed">La reversibilità al momento è disponibile solo per le regole che hanno come evento una etichetta NFC. Consulta l\'aiuto per i dettagli.</string>
|
||||
<string name="toggleRule">Regola Reversibile</string>
|
||||
<string name="toggling">Attivando</string>
|
||||
<string name="triggerCharging">Batteria sotto carica</string>
|
||||
<string name="triggerHeadsetPlugged">Connessione Auricolari</string>
|
||||
<string name="triggerHeadsetPlugged">Connessione auricolari</string>
|
||||
<string name="triggerNoiseLevel">Livello del rumore di fondo</string>
|
||||
<string name="triggerOnlyAvailableIfPlayServicesInstalled">Questa evento è valido solo se Google play service è installato.</string>
|
||||
<string name="triggerPointOfInterest">Posizione</string>
|
||||
<string name="triggerSpeed">Velocità</string>
|
||||
<string name="triggerTimeFrame">Intervallo</string>
|
||||
<string name="triggerUsb_host_connection">connessione al computer (USB)</string>
|
||||
<string name="triggers">Evento(i)</string>
|
||||
<string name="triggersComment">(tutti gli eventi devono essere validi allo stesso tempo)</string>
|
||||
<string name="triggerUsb_host_connection">Connessione al computer (USB)</string>
|
||||
<string name="triggers">Evento/i</string>
|
||||
<string name="triggersComment">(tutti gli eventi devono essere validi contemporaneamente)</string>
|
||||
<string name="tuesday">Martedì</string>
|
||||
<string name="unknownError">Errore indeterminato.</string>
|
||||
<string name="until">finchè</string>
|
||||
<string name="urlLegend">Variabili:\n È possibile utilizzare le seguenti variabili. All\'attivazione saranno sostituite con il valore corrispondente sul dispositivo. Includi le parentesi nel tuo testo.\n\n[uniqueid] - Il numero di serie del tuo dispositivo\n[serialnr] - Il serial number del tuo dispositivio\n[latitude] - La latitudine del tuo dispositivo\n[longitude] - La longitudine del tuo dispositivo\n[phonenr] - Numero dell\'ultima chiamata (entrante o uscente)\n[d] - Il giorno del mese, sempre 2 cifre\n[m] - Mese in formato numerico, sempre 2 cifre\n[Y] - L\’anno, sempre 4 cifre\n[h] - Ore in formato 12 ore, sempre 2 cifre con due punti\n[H] - Ore in formato 24 ore, sempre 2 cifre con due punti\n[i] - Minuti, sempre 2 cifre\n[s] - Secondi, sempre 2 cifre\n[ms] - millisecondi, sempre 3 cifre [notificationTitle] - titolo dell\'ultima notifica [notificationText] - testo dell\'ultima notifica</string>
|
||||
<string name="urlLegend">Variabili:\n È possibile utilizzare le seguenti variabili. Quando attivate, saranno sostituite con il valore corrispondente sul tuo dispositivo. Includi le parentesi nel tuo testo.\n\n[uniqueid] - L\'ID unico del tuo dispositivo\n[serialnr] - Il numero di serie del tuo dispositivio (< Android 9)\n[latitude] - La latitudine del tuo dispositivo\n[longitude] - La longitudine del tuo dispositivo\n[phonenr] - Numero dell\'ultima chiamata (entrante o uscente)\n[d] - Il giorno del mese, sempre 2 cifre con zero iniziale \n[m] - Mese in formato numerico, sempre 2 cifre con zero iniziale \n[Y] - L\’anno, sempre con 4 cifre\n[h] - Ore in formato 12 ore, sempre 2 cifre con due punti\n[H] - Ore in formato 24 ore, sempre 2 cifre con due punti\n[i] - Minuti, sempre 2 cifre\n[s] - Secondi, sempre 2 cifre\n[ms] - millisecondi, sempre 3 cifre\n[notificationTitle] - titolo dell\'ultima notifica\n[notificationText] - testo dell\'ultima notifica</string>
|
||||
<string name="urlToTrigger">URL da caricare:</string>
|
||||
<string name="urlTooShort">L\'url deve avere almeno 10 caratteri.</string>
|
||||
<string name="usbTetheringFailForAboveGingerbread">Questo molto probabilmente non funzionerà dato che sei su una versione superiore ad Android 2.3. Tuttavia è possibile utilizzare la connessione wifi tethering per attivare la regola.</string>
|
||||
<string name="useAuthentication">Usa l\'autenticazione</string>
|
||||
<string name="useExistingTag">Utilizzo di una etichetta NFC esistente</string>
|
||||
<string name="useTextToSpeechOnNormalSummary">Usa TextToSpeech nel modo normale</string>
|
||||
<string name="useTextToSpeechOnNormalTitle">TTS in modo normale</string>
|
||||
<string name="useTextToSpeechOnSilentSummary">Usa TextToSpeech nel modo silenzioso</string>
|
||||
<string name="useTextToSpeechOnSilentTitle">TTS in modo silenzioso</string>
|
||||
<string name="useTextToSpeechOnVibrateSummary">Usa TextToSpeech nel modo vibrazione</string>
|
||||
<string name="useTextToSpeechOnVibrateTitle">TTS in modo vibrazione</string>
|
||||
<string name="useExistingTag">Usa una etichetta NFC esistente</string>
|
||||
<string name="useTextToSpeechOnNormalSummary">Usa TextToSpeech nella modalità normale</string>
|
||||
<string name="useTextToSpeechOnNormalTitle">TTS in modalità normale</string>
|
||||
<string name="useTextToSpeechOnSilentSummary">Usa TextToSpeech nella modalità silenziosa</string>
|
||||
<string name="useTextToSpeechOnSilentTitle">TTS in modalità silenzioso</string>
|
||||
<string name="useTextToSpeechOnVibrateSummary">Usa TextToSpeech nella modalità vibrazione</string>
|
||||
<string name="useTextToSpeechOnVibrateTitle">TTS in modalità vibrazione</string>
|
||||
<string name="username">Nome utente</string>
|
||||
<string name="usingNewThreadForRuleExecution">Iniziata nuova esecuzione per l\'attivazione della regola.</string>
|
||||
<string name="version">Versione %1$s.</string>
|
||||
<string name="vibrateWhenRinging">Vibrazione alla chiamata</string>
|
||||
<string name="vibrateWhenRinging">Vibra alla chiamata</string>
|
||||
<string name="volumeAlarms">Allarmi sonori</string>
|
||||
<string name="volumeMusicVideoGameMedia">Multimedia (musica, video …)</string>
|
||||
<string name="volumeRingtoneNotifications">Toni e notifiche</string>
|
||||
<string name="volumeTest">Calibratura audio</string>
|
||||
<string name="volumeTest">Calibrazione audio</string>
|
||||
<string name="volumeCalibrationExplanation">Per calcolare il valore del rumore di fondo in dB è necessario specificare un valore di riferimento fisico (si prega di leggere Wikipedia per ulteriori informazioni). Questo valore è probabilmente diverso per ogni telefono. Trascinare il cursore per modificare il valore di riferimento fisico definito. Più alto è il valore di riferimento e più basso sarà il valore misurato in dB. Misurazioni costanti saranno effettuate ogni %1$s secondi ed i risultati visualizzati sotto. Premere indietro quando hai trovato un valore adeguato.</string>
|
||||
<string name="volumes">Volumi</string>
|
||||
<string name="waitBeforeNextAction">Attesa prima della azione successiva</string>
|
||||
<string name="waitBeforeNextActionEnterValue">Inserisci il valore della pausa tra tra un\'azione e la successiva (millisecondi).</string>
|
||||
<string name="waitBeforeNextAction">Attendi prima della azione successiva</string>
|
||||
<string name="waitBeforeNextActionEnterValue">Inserisci il valore della pausa tra un\'azione e la successiva (millisecondi).</string>
|
||||
<string name="wakeupDevice">Sveglia il dispositivo</string>
|
||||
<string name="wakeupDeviceValue">Inserisci per quanto tempo il dispositivo deve rimanere attivo (millisecondi). Usa 0 per i valori standard.</string>
|
||||
<string name="warning">Attenzione</string>
|
||||
@ -571,13 +571,13 @@
|
||||
<string name="wifi">wifi</string>
|
||||
<string name="wifiConnection">Connessione wifi</string>
|
||||
<string name="wifiName">Nome wifi</string>
|
||||
<string name="wifiState">Stato Wifi</string>
|
||||
<string name="wifiState">Stato wifi</string>
|
||||
<string name="with">con</string>
|
||||
<string name="withLabel">con etichetta</string>
|
||||
<string name="writeLogFile">Memorizza un file di log</string>
|
||||
<string name="yes">Si</string>
|
||||
<string name="clone">Clonare</string>
|
||||
<string name="state">Status</string>
|
||||
<string name="yes">Sì</string>
|
||||
<string name="clone">Clona</string>
|
||||
<string name="state">Stato</string>
|
||||
<string name="urlToTriggerExplanation">Questa funzione NON apre un navigatore, ma attiva un indirizzo URL in secondo piano. Puoi usarla per esempio per mandare dei comandi al tuo sistema di domotica.</string>
|
||||
<string name="automaticUpdateCheck">Controlla aggiornamenti</string>
|
||||
<string name="automaticUpdateCheckSummary">Applicabile solo alla versione APK.</string>
|
||||
@ -586,68 +586,68 @@
|
||||
<string name="locationFoundInaccurate">È stato possibile solo trovare una ubicazione con una precisione limitata. Potrebbe non funzionare in maniera affidabile. Il raggio minimo per le ubicazioni è di %1$d m.</string>
|
||||
<string name="noLocationCouldBeFound">Nessuna posizione è stata trovata dopo un tempo di attesa di %1$s seconds.</string>
|
||||
<string name="pleaseGiveBgLocation">Nella schermata successiva vai su permessi, poi posizione. Lì seleziona \"Consenti sempre\" per permettere ad Automation di determinare la tua posizione in secondo piano.</string>
|
||||
<string name="tones">Suonerias</string>
|
||||
<string name="tones">Suonerie</string>
|
||||
<string name="dnd">Non disturbare</string>
|
||||
<string name="deviceOrientation">Orientamento</string>
|
||||
<string name="tolerance">Tolleranza</string>
|
||||
<string name="deviceOrientation">Orientamento del dispositivo</string>
|
||||
<string name="tolerance">Tolleranza (0–180)</string>
|
||||
<string name="orientationAzimuth">Azimut:</string>
|
||||
<string name="actionSetBluetoothTethering">Bluetooth Tethering</string>
|
||||
<string name="actionTurnBluetoothTetheringOn">accendere Bluetooth Tethering</string>
|
||||
<string name="actionTurnBluetoothTetheringOff">spegnere Bluetooth Tethering</string>
|
||||
<string name="vibrate">Vibrare</string>
|
||||
<string name="test">Provare</string>
|
||||
<string name="actionSetBluetoothTethering">Tethering Bluetooth</string>
|
||||
<string name="actionTurnBluetoothTetheringOn">attiva Tethering Bluetooth</string>
|
||||
<string name="actionTurnBluetoothTetheringOff">disattiva Tethering Bluetooth</string>
|
||||
<string name="vibrate">Vibra</string>
|
||||
<string name="test">Prova</string>
|
||||
<string name="VibrateExplanation">Inserisci una durata per la vibrazione, seguita da una virgola e poi la durata di una pausa. Si possono concatenare tutte le vibrazioni che si vogliono. Per esempio, lo schema 100,500,500,1000,100 farà vibrare il dispositivo per 100ms, aspetterà 500ms, vibrerà 500ms, aspetterà 1000ms e vibrerà 100ms. Se pensi che una vibrazione non venga eseguita, prova ad aumentare la pausa precedente.</string>
|
||||
<string name="pleaseEnterValidVibrationPattern">Si prega di inserire uno schema di vibrazione valido.</string>
|
||||
<string name="top">Superiore</string>
|
||||
<string name="bottom">Inferiore</string>
|
||||
<string name="top">In alto</string>
|
||||
<string name="bottom">In basso</string>
|
||||
<string name="tabsPlacement">Posizione della barra delle schede</string>
|
||||
<string name="tabsPlacementSummary">Scegli dove posizionare la barra delle schede.</string>
|
||||
<string name="wifiApi30">Dato che Google ha rovinato un\'altra parte ancora di Android, a partire con le API 30, solo le reti wifi attualmente visibili possono essere visualizzate, non tutte quelle a cui il tuo dispositivo si è collegato.</string>
|
||||
<string name="smsDialogNotice">Se non hai mai usato una azione \"invia-sms\" prima, Android potrebbe visualizzare una finestra di conferma addizionale, chiedendo di permettere l\'invio di messaggi. Dovrai mettere il segno di spunta su \"permetti sempre"\ e confermare se vuoi che questa attività funzioni in secondo piano. Si raccomanda l\'esecuzione manuale la prima volta solo per far apparire questa finestra.</string>
|
||||
<string name="silentTriggersDnd">ATTENZIONE: La modalità silenziosa spesso attiva quella \"non disturbare\" sui dispositivi più nuovi. Se questo avviene sul tuo, ti raccomando di usare la modalità normale invece di abbassare tutti i volumi a zero.</string>
|
||||
<string name="silentTriggersDnd">ATTENZIONE: La modalità silenziosa spesso attiva quella \"non disturbare\" sui dispositivi più nuovi. Se questo è vero, è raccomandabile usare la modalità normale abbassando tutti i volumi a zero.</string>
|
||||
<string name="miscellaneous">Altro</string>
|
||||
<string name="dndOff">Spegni \"Non disturbare\"</string>
|
||||
<string name="dndOff">Disattiva \"Non disturbare\"</string>
|
||||
<string name="dndPriority">Permetti notifiche prioritarie</string>
|
||||
<string name="dndAlarms">Permetti allarmi</string>
|
||||
<string name="dndNothing">Non permettere nulla</string>
|
||||
<string name="dndRemarks">La configurazione dettagliata (come il permesso di fare chiamate, scegliere numeri specifici, etc.) può solo essere effettuata dalle impostazioni di sistema.</string>
|
||||
<string name="permissionsRequiredNotAvailable">Le tue regole hanno bisogno di permessi che non possono essere richiesti da questa versione di Automation.</string>
|
||||
<string name="automationNotificationsIgnored">Se non scegli una applicazione specifica, ma scegli \"Qualsiasi applicazione\", le notifiche provenienti da Automation saranno ignorate per evitare che vada in ripetizione.</string>
|
||||
<string name="automationNotificationsIgnored">Se non scegli una applicazione specifica, ma scegli \"Qualsiasi applicazione\", le notifiche provenienti da Automation saranno ignorate per evitare cicli infiniti.</string>
|
||||
<string name="repeatEveryXseconds">Ripeti ogni x secondi</string>
|
||||
<string name="repeatEveryXsecondsWithVariable">ripeti ogni %1$s secondi</string>
|
||||
<string name="enterRepetitionTime">Devi inserire un valore positivo e non decimale per il tempo di ripetizione.</string>
|
||||
<string name="elementSkipped">Un elemento del file di configurazione non può essere letto. Il file potrebbe essere stato create da una versione più recente del programma.</string>
|
||||
<string name="donate">Donazioni</string>
|
||||
<string name="btTetheringNotice">È stato confermato che questa caratteristica funziona fino ad Android 8.0. Da qualche versione superiore ha cessato di funzionare, ma dato che non ho sufficienti dispositivi fisici, non posso identificare quale sia. Su Android 11 sicuramente non funziona più. Se hai una versione intermedia, per favore fammi sapere se funziona per il tuo dispositivo, o no. </string>
|
||||
<string name="btTetheringNotice">È stato confermato che questa caratteristica funziona fino ad Android 8.0. Da qualche versione superiore ha cessato di funzionare, ma dato che non ho sufficienti dispositivi fisici, non posso identificare quale. Su Android 11 sicuramente non funziona più. Se hai una versione intermedia, per favore fammi sapere se funziona o no sul tuo dispositivo.</string>
|
||||
<string name="notice">Avviso</string>
|
||||
<string name="orientationPitch">Inclinazione:</string>
|
||||
<string name="orientationRoll">Rotazione:</string>
|
||||
<string name="orientationPitch">Beccheggio:</string>
|
||||
<string name="orientationRoll">Rollio:</string>
|
||||
<string name="enterValidNumbersIntoAllFields">Inserire un numero valido in tutti i campi.</string>
|
||||
<string name="deviceOrientationExplanation">When you move your device the below numbers will update. What you can see there, is the current orientation of your device measured in degrees. If it is in the desired orientation, click the apply button to copy the current values to the desired fields.\nBecause reaching this exact orientation ever again is highly unlikely you must also enter a tolerance. The is amount of degrees to which the orientation can deviate in either direction. 15° will result in a total angle of 30°, 15° in every direction.\nIf you only care about one specific axis, specify a tolerance of 180° for the two other ones.</string>
|
||||
<string name="wouldCurrentlyApply">Si applica attualmente?</string>
|
||||
<string name="deviceIsInCertainOrientation">il dispositivo si trova in una certa orientazione</string>
|
||||
<string name="toleranceOf180OnlyAllowedIn2Fields">Una tolleranza di 180 è permessa solo per 2 campi di tolleranza, non tutti e tre. Altrimenti l\'attività si applicherebbe SEMPRE.</string>
|
||||
<string name="deviceOrientationExplanation">Muovendo il dispositivo i numeri qua sotto cambieranno, dove si può vedere l\'orientamento attuale del dispositivo, misurata in gradi. Se è nell\'orientamento voluto, si può cliccare il tasto applica per copiare i valori attuali nei campi desiderati. Siccome è impossibile ritrovare questo orientamento preciso, è necessario indicare una tolleranza. Questa indica il numero di gradi di deviazione dell\'orientamento accettati in entrambe le direzioni. 15° comporta un angolo complessivo di 30°, 15° in ogni direzione. Se solo un asse è di interesse, allora specifica una tolleranza di 180° per gli altri due.</string>
|
||||
<string name="wouldCurrentlyApply">Sarebbe applicabile?</string>
|
||||
<string name="deviceIsInCertainOrientation">il dispositivo si trova in un certo orientamento</string>
|
||||
<string name="toleranceOf180OnlyAllowedIn2Fields">Una tolleranza di 180 è permessa solo per 2 campi, non tutti e tre, altrimenti l\'evento sarebbe SEMPRE verificato.</string>
|
||||
<string name="unknown">sconosciuto</string>
|
||||
<string name="orientation">Orientazione</string>
|
||||
<string name="orientation">Orientamento</string>
|
||||
<string name="triggerWrong">C\'è qualcosa di errato con questo evento. Non può essere caricato correttamente.</string>
|
||||
<string name="turnScreenOnOrOff">Accendi/Spegni lo schermo</string>
|
||||
<string name="turnScreenOnOrOff">Accendi o spegni lo schermo</string>
|
||||
<string name="turnScreenOn">accendi lo schermo</string>
|
||||
<string name="turnScreenOff">spegni lo schermo</string>
|
||||
<string name="mustApply">Si deve applicare</string>
|
||||
<string name="explanationDeviceOrientationDirection">Se la casella di controllo è spuntata, significa che il dispositivo deve essere nell\'orientamento specificato. Se non è spuntata, qualsiasi orientamento che NON corrisponde ai tuoi criteri andrà bene. </string>
|
||||
<string name="mustApply">Deve verificarsi</string>
|
||||
<string name="explanationDeviceOrientationDirection">Se la casella di controllo è spuntata, allora il dispositivo deve essere nell\'orientamento specificato. Se non è spuntata, qualsiasi orientamento che NON rientra nelle specifiche andrà bene. </string>
|
||||
<string name="deviceOrientationTimeAcceptIntervalTitle">Frequenza del segnale</string>
|
||||
<string name="deviceOrientationTimeAcceptIntervalSummary">Accetta nuovi segnali di movimento ogni x millisecondi </string>
|
||||
<string name="deviceOrientationSettings">Impostazioni di orientamento del 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="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="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS">Escludi 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="ruleXIsUsingProfileY">Impossibile eliminare questo profilo. La regola %1$s fa riferimento al profilo %2$s.</string>
|
||||
<string name="profileCouldNotBeDeleted">Impossibile eliminare il profilo.</string>
|
||||
<string name="noRepetition">nessuna ripetizione</string>
|
||||
<string name="usingAuthentication">utilizzo dell\'autenticazione</string>
|
||||
@ -659,4 +659,99 @@
|
||||
<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>
|
||||
<string name="createNotification">Crea notifica</string>
|
||||
<string name="enterTitle">Inserisci un titolo.</string>
|
||||
<string name="enterText">Aggiungi un testo.</string>
|
||||
<string name="info">Informazioni</string>
|
||||
<string name="profileWasNotFound">Il profilo utilizzato in questa regola non sembra più esistere. Il primo in ordine alfabetico è stato selezionato.</string>
|
||||
<string name="comparisonCaseInsensitive">I confronti non distinguono fra maiuscole e minuscole</string>
|
||||
<string name="closeNotifications">Chiudi notifica/e</string>
|
||||
<string name="notificationCloseActionExplanation">Se è non specificato alcun criterio, questa azione chiuderà TUTTE le notifiche. Quindi si consiglia di specificare almeno i criteri per almeno una applicazione, titolo o testo.</string>
|
||||
<string name="profileWarning">Le impostazioni che si possono modificare in questa sezione possono impedirti di notare certe cose del tuo telefono. Si può perfino silenziare la sveglia, quindi, qualunque cosa tu faccia, ti consigliamo di provarlo.</string>
|
||||
<string name="ifString">se</string>
|
||||
<string name="actionMediaControlNotice">Tieni presente che questa azione potrebbe non funzionare con TUTTI i lettori esistenti. E anche fosse, non è detto che tutti i pulsanti funzionerebbero.</string>
|
||||
<string name="pleaseSelectActionValue">Si prega di selezionare un\'azione!</string>
|
||||
<string name="stop">stop</string>
|
||||
<string name="android.permission.MEDIA_CONTENT_CONTROL">Controlla riproduzione multimediale</string>
|
||||
<string name="next">successivo</string>
|
||||
<string name="previous">precedente</string>
|
||||
<string name="pause">pausa</string>
|
||||
<string name="play">riproduci</string>
|
||||
<string name="playPause">commuta riproduzione/pausa</string>
|
||||
<string name="selectCommand">Seleziona comando</string>
|
||||
<string name="actionMediaControl">Controlla la riproduzione multimediale</string>
|
||||
<string name="featureCeasedToWorkLastWorkingAndroidVersion">A causa della sconfinata saggezza di Google, l\'ultima versione di Android su cui questa funzione si sa che funziona è la %1$s. Puoi configurarla, ma probabilmente non avrà alcun effetto.</string>
|
||||
<string name="screenState">Stato dello schermo</string>
|
||||
<string name="selectDesiredState">Seleziona lo stato desiderato</string>
|
||||
<string name="unlocked">sbloccato</string>
|
||||
<string name="off">spento</string>
|
||||
<string name="on">attivo</string>
|
||||
<string name="screenIs">lo schermo è %1$s</string>
|
||||
<string name="sendEmailToDev">Invia email allo sviluppatore</string>
|
||||
<string name="controlCenter">Centro di controllo</string>
|
||||
<string name="emailContactNotice">L\'e-mail è il mio metodo di contatto preferito per segnalare bug, porre domande o fare proposte. Vai al centro di controllo per saperne di più.\nMolte domande non possono essere risolte immediatamente, ma richiedono alcune ricerche tecniche. Quindi, per favore, abbiate un po\' di pazienza.</string>
|
||||
<string name="musicPlaying">La musica è in riproduzione</string>
|
||||
<string name="musicIsPlaying">la musica è in riproduzione</string>
|
||||
<string name="musicIsNotPlaying">la musica non viene riprodotta</string>
|
||||
<string name="selectParameters">Seleziona i parametri</string>
|
||||
<string name="musicCheckFrequencyTitle">Frequenza dei controlli [ms]</string>
|
||||
<string name="musicCheckFrequencySummary">Millisecondi tra i controlli</string>
|
||||
<string name="musicPlayingDetection">Rilevamento della riproduzione musicale</string>
|
||||
<string name="profileXrequiresThis">Questo è richiesto dal profilo \"%1$s\".</string>
|
||||
<string name="locationNotWorkingOn12">Ottenere la posizione non sembra funzionare su dispositivi Android 12 al momento. Se a te non funziona, mi dispiace. Cercherò di risolvere questo problema non appena capirò la causa. Se il cerchio di caricamento non smette di girare, sai perché.</string>
|
||||
<string name="lastProfile">Ultimo profilo:</string>
|
||||
<string name="queryAllPackages">Ottieni un elenco delle applicazioni installate</string>
|
||||
<string name="timeFrameDaysHint">Se si utilizza un intervallo di tempo che si estende oltre la mezzanotte, è necessario selezionare anche il giorno successivo se si desidera che il trigger venga applicato dopo la mezzanotte.</string>
|
||||
<string name="featureNotInGooglePlayVersion">Questa funzione non è più disponibile nella versione di Google Play.\\n\\nOltre di tanto in tanto Google bullizza gli sviluppatori. Se si desidera continuare a utilizzare determinate funzionalità, è necessario archiviare i documenti. Sfortunatamente c\'è una probabilità del 99% che i documenti vengano rifiutati. È più o meno come nel fumetto / film di Asterix.\\n\\nHo passato settimane a discutere con loro su casi del genere in passato, ma ho continuato a ricevere rifiuti - sia da bot che da persone che sono intelligenti come i bot. Nella sezione Posso decidere se l\'app viene rimossa completamente dal Play Store o rimuovere la funzione.\\nConsigliare l\'utilizzo della versione APK dal mio sito Web o quella di F-Droid se sono necessarie tali funzionalità.</string>
|
||||
<string name="startActivityInsertManually">Questa limitazione riguarda solo la selezione di un\'app, non l\'avvio effettivo. Quindi puoi comunque inserire manualmente il nome di un\'applicazione se lo conosci.</string>
|
||||
<string name="deviceStarts">Device starts</string>
|
||||
<string name="serviceStarts">Avvio del servizio</string>
|
||||
<string name="deviceIsStarting">Il dispositivo si sta avviando</string>
|
||||
<string name="serviceIsStarting">il servizio è in fase di avvio</string>
|
||||
<string name="broadcastReceived">broadcast ricevuto</string>
|
||||
<string name="broadcastNotReceived">broadcast non ricevuto</string>
|
||||
<string name="broadcastReceivedTitle">Broadcast ricevuto</string>
|
||||
<string name="broadcastsShowSuggestions">Mostra suggerimenti</string>
|
||||
<string name="selectBroadcast">Seleziona trasmissione</string>
|
||||
<string name="lockedWithoutSecurity">bloccato (solo scorrimento rapido, nessun PIN)</string>
|
||||
<string name="lockedWithSecurity">bloccato (con PIN, ecc.)</string>
|
||||
<string name="lockedCommentScreenMustBeOff">Qualsiasi stato di blocco verrà rilevato solo se lo schermo è spento.</string>
|
||||
<string name="emailPretext">Se hai un problema, suggerimenti o domande, scrivi qualcosa nell\'e-mail. Non inviarmi semplicemente i file con il testo predefinito. Ignorerò tutto ciò che li riguarda a meno che non siamo già in una conversazione.</string>
|
||||
<string name="broadcastExplanation">Questa azione consente di inviare un broadcast all\'interno del sistema di messaggi di Android. Questo non è visibile all\'utente, ma le applicazioni che si sono registrate a determinati broadcast possono rispondere.</string>
|
||||
<string name="sendBroadcast">Invia broadcast</string>
|
||||
<string name="enterBroadcast">Immettere un\'azione per il broadcast.</string>
|
||||
<string name="explanationBroadcastTrigger">La maggior parte degli eventi sul telefono verrà \"pubblicata\" trasmettendoli in tutto il sistema operativo.\nAd esempio, l\'attivazione/disattivazione della modalità aereo attiverà tale trasmissione. Queste trasmissioni non sono automaticamente visibili / udibili, ma se un\'applicazione (come l\'automazione) è interessata può collegarsi a loro. Quando si verificano, riceverà una notifica e può reagire.\n\nÈ possibile definire qui un evento di trasmissione per il quale l\'applicazione attenderà. Puoi inserirlo manualmente, copiarlo e incollarlo da qualche parte o sceglierne uno dall\'elenco dei suggerimenti. Poiché questo trigger è pensato per essere e rimanere molto flessibile, non posso fornirti spiegazioni per gli articoli.\n\nL\'elenco dei suggerimenti non pretende di essere completo. Si prega di visitare l\'URL sottostante per dare un\'occhiata alla documentazione Android.\nInoltre qualsiasi app può inviare eventi personalizzati che ovviamente non saranno presenti nella documentazione Android.\n\nMolti broadcast richiedono autorizzazioni specifiche per funzionare. Provo a richiedere le autorizzazioni dove so che servono. Se ritieni che sia necessaria un\'autorizzazione per l\'azione che hai inserito, fammi sapere.\n\nNon ricevuto significa che non è capitato un broadcast di questo tipo da quando il servizio è stato avviato. La risposta a certi parametri è in fase di sviluppo.</string>
|
||||
<string name="logsExplanation">Per evitare di sprecare lo spazio di archiviazione, i registri non vengono salvati per impostazione predefinita. Quindi, se hai un problema, attiva prima le impostazioni di accesso e imposta il livello di registro su 5, poi riproduci il problema. Solo allora i registri possono essere allegati.</string>
|
||||
<string name="directionStringDoesNotContain">non contiene</string>
|
||||
<string name="path">Percorso</string>
|
||||
<string name="runExecutable">Esegui script o eseguibile</string>
|
||||
<string name="parameters">Parametri</string>
|
||||
<string name="chooseExecutable">Scegli eseguibile</string>
|
||||
<string name="runAsRoot">Esegui con root</string>
|
||||
<string name="selectValidExecutable">Scegli un file eseguibile valido.</string>
|
||||
<string name="fileNotExecutable">Questo file non è eseguibile.</string>
|
||||
<string name="usingRoot">usando il root</string>
|
||||
<string name="tetheringActive">il tethering è attivo</string>
|
||||
<string name="tetheringNotActive">il tethering non è attivo</string>
|
||||
<string name="tetheringState">Stato del tethering</string>
|
||||
<string name="wifiExplanation2">Quando la modalità aereo è attiva, lo stato del wifi può essere commutato soltanto da applicazioni che usano i permessi di root.</string>
|
||||
<string name="wifiExplanation1">Le app che hanno come target Android Q o superiore non possono più attivare o disattivare il wifi. Lamentatevi con Google per questa limitazione, non con me.\n\nSi può aggirare questa limitazione usando il root e spuntando la casella qua sotto. In alternativa si può scaricare questa applicazione da F-Droid o dal mio sito, dove non sono obbligato a usare come target le ultime API.</string>
|
||||
<string name="runExecutableExplanation">"Si può scegliere uno script o un eseguibile che sarà eseguito come azione.\n\nCi sono però dei prerequisiti che devi sistemare per conto tuo. Google ha reso molto difficile eseguire tutto tranne le normali applicazioni Android.\n\n1.\nIl file deve essere eseguibile nel file system. In un sistema Android normale (senza root) questa è la parte più difficile.\n\n2.\nAnche Automation deve poter eseguire il file, non soltanto il proprietario o il gruppo.\n\n3.\nSe si tratta di uno script, deve essere specificata una shell valida nell'intestazione. "</string>
|
||||
<string name="enter_a_number">Inserisci un numero.</string>
|
||||
<string name="regularExpressionsIfEquals">Se è selezionato \"uguale\", è possibile immettere un\'espressione regolare.</string>
|
||||
<string name="duration">Durata [ms]</string>
|
||||
<string name="keepDeviceAwake">Mantieni il dispositivo attivo</string>
|
||||
<string name="wakeLockTimeout">Specificare il timeout</string>
|
||||
<string name="wakeLockExplanation">Attiva manterrà lo schermo acceso mentre disattivato lo lascerà spegnere. Per tenerlo acceso puoi inserire una durata dopo la quale potrebbe spegnersi di nuovo o puoi tenerlo acceso a tempo indeterminato. In quest\'ultimo caso è necessario creare un\'altra azione keep-awake (in questa o in un\'altra regola) in cui selezionare disattiva.</string>
|
||||
<string name="mayUseRegularExpressions">Puoi anche inserire un\'espressione regolare qui.</string>
|
||||
<string name="locationRequiredToDetermineWifiName">Per ottenere l\'SSID wifi, l\'app richiede autorizzazioni di posizione. Poiché la versione di Google non è in grado di ottenerlo, è possibile utilizzare questo trigger solo se non si specifica un SSID. Quindi può essere utilizzato solo per rilevare se il wifi è connesso o meno.</string>
|
||||
<string name="simplyDismissNotification">Semplicemente licenziare</string>
|
||||
<string name="clickNotificationButton">Fai clic su un pulsante</string>
|
||||
<string name="withButton">con pulsante %1$s</string>
|
||||
<string name="subSystemState">Stato del sottosistema</string>
|
||||
<string name="bluetooth">Bluetooth</string>
|
||||
<string name="usb">USB</string>
|
||||
<string name="cable">Cavo</string>
|
||||
<string name="tetheringBluetoothNotPossible">Il tethering Bluetooth al momento non può essere rilevato. Solo gli altri mezzi di connessione attiveranno questo trigger.</string>
|
||||
<string name="type">Digitare</string>
|
||||
</resources>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user