Merge remote-tracking branch 'origin/development-stable' into development
# Conflicts: # app/src/main/res/values-de/strings.xml # app/src/main/res/values-es/strings.xml # app/src/main/res/values-it/strings.xml # app/src/main/res/values-nl/strings.xml # app/src/main/res/values/strings.xml # build.gradle # fastlane/metadata/android/en-US/changelogs/119.txt
This commit is contained in:
commit
41efa7c11b
@ -11,8 +11,8 @@ android {
|
|||||||
compileSdkVersion 31
|
compileSdkVersion 31
|
||||||
buildToolsVersion '29.0.2'
|
buildToolsVersion '29.0.2'
|
||||||
useLibrary 'org.apache.http.legacy'
|
useLibrary 'org.apache.http.legacy'
|
||||||
versionCode 118
|
versionCode 119
|
||||||
versionName "1.7.4"
|
versionName "1.7.5"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 116,
|
"versionCode": 119,
|
||||||
"versionName": "1.7.2-googlePlay",
|
"versionName": "1.7.5-googlePlay",
|
||||||
"outputFile": "app-googlePlayFlavor-release.apk"
|
"outputFile": "app-googlePlayFlavor-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -21,23 +21,23 @@ import java.util.List;
|
|||||||
|
|
||||||
public class Rule implements Comparable<Rule>
|
public class Rule implements Comparable<Rule>
|
||||||
{
|
{
|
||||||
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
protected static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||||
|
|
||||||
private static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
protected static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||||
|
|
||||||
public static List<Rule> getRuleRunHistory()
|
public static List<Rule> getRuleRunHistory()
|
||||||
{
|
{
|
||||||
return ruleRunHistory;
|
return ruleRunHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList<Trigger> triggerSet;
|
protected ArrayList<Trigger> triggerSet;
|
||||||
private ArrayList<Action> actionSet;
|
protected ArrayList<Action> actionSet;
|
||||||
private String name;
|
protected String name;
|
||||||
private boolean ruleActive = true; // rules can be deactivated, so they won't fire if you don't want them temporarily
|
protected 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
|
protected boolean ruleToggle = false; // rule will run again and do the opposite of its actions if applicable
|
||||||
private Calendar lastExecution;
|
protected Calendar lastExecution;
|
||||||
|
|
||||||
private static Date lastActivatedRuleActivationTime;
|
protected static Date lastActivatedRuleActivationTime;
|
||||||
|
|
||||||
public Calendar getLastExecution()
|
public Calendar getLastExecution()
|
||||||
{
|
{
|
||||||
@ -185,6 +185,7 @@ public class Rule implements Comparable<Rule>
|
|||||||
if(this.checkBeforeSaving(context, true))
|
if(this.checkBeforeSaving(context, true))
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "Rule", "Changing rule: " + this.toString(), 3);
|
Miscellaneous.logEvent("i", "Rule", "Changing rule: " + this.toString(), 3);
|
||||||
|
|
||||||
boolean returnValue = XmlFileInterface.writeFile();
|
boolean returnValue = XmlFileInterface.writeFile();
|
||||||
|
|
||||||
if(returnValue)
|
if(returnValue)
|
||||||
@ -233,12 +234,16 @@ public class Rule implements Comparable<Rule>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!changeExistingRule)
|
if(!changeExistingRule)
|
||||||
|
{
|
||||||
for (Rule rule : Rule.ruleCollection)
|
for (Rule rule : Rule.ruleCollection)
|
||||||
|
{
|
||||||
if (rule.getName().equals(this.getName()))
|
if (rule.getName().equals(this.getName()))
|
||||||
{
|
{
|
||||||
Toast.makeText(context, context.getResources().getString(R.string.anotherRuleByThatName), Toast.LENGTH_LONG).show();
|
Toast.makeText(context, context.getResources().getString(R.string.anotherRuleByThatName), Toast.LENGTH_LONG).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(this.getTriggerSet().size() == 0)
|
if(this.getTriggerSet().size() == 0)
|
||||||
{
|
{
|
||||||
@ -334,6 +339,15 @@ public class Rule implements Comparable<Rule>
|
|||||||
{
|
{
|
||||||
if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
|
if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Workaround for repetition in TimeFrame triggers
|
||||||
|
*/
|
||||||
|
if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame))
|
||||||
|
{
|
||||||
|
if(oneTrigger.getTimeFrame().repetition > 0)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -18,23 +18,23 @@ import java.util.List;
|
|||||||
|
|
||||||
public class Rule implements Comparable<Rule>
|
public class Rule implements Comparable<Rule>
|
||||||
{
|
{
|
||||||
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
protected static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||||
|
|
||||||
private static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
protected static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||||
|
|
||||||
public static List<Rule> getRuleRunHistory()
|
public static List<Rule> getRuleRunHistory()
|
||||||
{
|
{
|
||||||
return ruleRunHistory;
|
return ruleRunHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList<Trigger> triggerSet;
|
protected ArrayList<Trigger> triggerSet;
|
||||||
private ArrayList<Action> actionSet;
|
protected ArrayList<Action> actionSet;
|
||||||
private String name;
|
protected String name;
|
||||||
private boolean ruleActive = true; // rules can be deactivated, so they won't fire if you don't want them temporarily
|
protected 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
|
protected boolean ruleToggle = false; // rule will run again and do the opposite of its actions if applicable
|
||||||
private Calendar lastExecution;
|
protected Calendar lastExecution;
|
||||||
|
|
||||||
private static Date lastActivatedRuleActivationTime;
|
protected static Date lastActivatedRuleActivationTime;
|
||||||
|
|
||||||
public Calendar getLastExecution()
|
public Calendar getLastExecution()
|
||||||
{
|
{
|
||||||
@ -182,6 +182,7 @@ public class Rule implements Comparable<Rule>
|
|||||||
if(this.checkBeforeSaving(context, true))
|
if(this.checkBeforeSaving(context, true))
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "Rule", "Changing rule: " + this.toString(), 3);
|
Miscellaneous.logEvent("i", "Rule", "Changing rule: " + this.toString(), 3);
|
||||||
|
|
||||||
boolean returnValue = XmlFileInterface.writeFile();
|
boolean returnValue = XmlFileInterface.writeFile();
|
||||||
|
|
||||||
if(returnValue)
|
if(returnValue)
|
||||||
@ -230,12 +231,16 @@ public class Rule implements Comparable<Rule>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!changeExistingRule)
|
if(!changeExistingRule)
|
||||||
|
{
|
||||||
for (Rule rule : Rule.ruleCollection)
|
for (Rule rule : Rule.ruleCollection)
|
||||||
|
{
|
||||||
if (rule.getName().equals(this.getName()))
|
if (rule.getName().equals(this.getName()))
|
||||||
{
|
{
|
||||||
Toast.makeText(context, context.getResources().getString(R.string.anotherRuleByThatName), Toast.LENGTH_LONG).show();
|
Toast.makeText(context, context.getResources().getString(R.string.anotherRuleByThatName), Toast.LENGTH_LONG).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(this.getTriggerSet().size() == 0)
|
if(this.getTriggerSet().size() == 0)
|
||||||
{
|
{
|
||||||
@ -331,6 +336,15 @@ public class Rule implements Comparable<Rule>
|
|||||||
{
|
{
|
||||||
if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
|
if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Workaround for repetition in TimeFrame triggers
|
||||||
|
*/
|
||||||
|
if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame))
|
||||||
|
{
|
||||||
|
if(oneTrigger.getTimeFrame().repetition > 0)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -21,23 +21,23 @@ import java.util.List;
|
|||||||
|
|
||||||
public class Rule implements Comparable<Rule>
|
public class Rule implements Comparable<Rule>
|
||||||
{
|
{
|
||||||
private static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
protected static ArrayList<Rule> ruleCollection = new ArrayList<Rule>();
|
||||||
|
|
||||||
private static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
protected static List<Rule> ruleRunHistory = new ArrayList<Rule>();
|
||||||
|
|
||||||
public static List<Rule> getRuleRunHistory()
|
public static List<Rule> getRuleRunHistory()
|
||||||
{
|
{
|
||||||
return ruleRunHistory;
|
return ruleRunHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList<Trigger> triggerSet;
|
protected ArrayList<Trigger> triggerSet;
|
||||||
private ArrayList<Action> actionSet;
|
protected ArrayList<Action> actionSet;
|
||||||
private String name;
|
protected String name;
|
||||||
private boolean ruleActive = true; // rules can be deactivated, so they won't fire if you don't want them temporarily
|
protected 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
|
protected boolean ruleToggle = false; // rule will run again and do the opposite of its actions if applicable
|
||||||
private Calendar lastExecution;
|
protected Calendar lastExecution;
|
||||||
|
|
||||||
private static Date lastActivatedRuleActivationTime;
|
protected static Date lastActivatedRuleActivationTime;
|
||||||
|
|
||||||
public Calendar getLastExecution()
|
public Calendar getLastExecution()
|
||||||
{
|
{
|
||||||
@ -185,6 +185,7 @@ public class Rule implements Comparable<Rule>
|
|||||||
if(this.checkBeforeSaving(context, true))
|
if(this.checkBeforeSaving(context, true))
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "Rule", "Changing rule: " + this.toString(), 3);
|
Miscellaneous.logEvent("i", "Rule", "Changing rule: " + this.toString(), 3);
|
||||||
|
|
||||||
boolean returnValue = XmlFileInterface.writeFile();
|
boolean returnValue = XmlFileInterface.writeFile();
|
||||||
|
|
||||||
if(returnValue)
|
if(returnValue)
|
||||||
@ -233,12 +234,16 @@ public class Rule implements Comparable<Rule>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!changeExistingRule)
|
if(!changeExistingRule)
|
||||||
|
{
|
||||||
for (Rule rule : Rule.ruleCollection)
|
for (Rule rule : Rule.ruleCollection)
|
||||||
|
{
|
||||||
if (rule.getName().equals(this.getName()))
|
if (rule.getName().equals(this.getName()))
|
||||||
{
|
{
|
||||||
Toast.makeText(context, context.getResources().getString(R.string.anotherRuleByThatName), Toast.LENGTH_LONG).show();
|
Toast.makeText(context, context.getResources().getString(R.string.anotherRuleByThatName), Toast.LENGTH_LONG).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(this.getTriggerSet().size() == 0)
|
if(this.getTriggerSet().size() == 0)
|
||||||
{
|
{
|
||||||
@ -334,6 +339,15 @@ public class Rule implements Comparable<Rule>
|
|||||||
{
|
{
|
||||||
if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
|
if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Workaround for repetition in TimeFrame triggers
|
||||||
|
*/
|
||||||
|
if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame))
|
||||||
|
{
|
||||||
|
if(oneTrigger.getTimeFrame().repetition > 0)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -222,6 +222,10 @@ public class ActivityControlCenter extends Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
Settings.readFromPersistentStorage(ActivityControlCenter.this);
|
Settings.readFromPersistentStorage(ActivityControlCenter.this);
|
||||||
|
|
||||||
|
AutomationService service = AutomationService.getInstance();
|
||||||
|
if(service != null && service.isRunning)
|
||||||
|
service.applySettingsAndRules();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.noFilesImported), Toast.LENGTH_LONG).show();
|
Toast.makeText(ActivityControlCenter.this, getResources().getString(R.string.noFilesImported), Toast.LENGTH_LONG).show();
|
||||||
@ -342,13 +346,16 @@ public class ActivityControlCenter extends Activity
|
|||||||
public static String getSystemInfo()
|
public static String getSystemInfo()
|
||||||
{
|
{
|
||||||
StringBuilder systemInfoText = new StringBuilder();
|
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("Device details" + Miscellaneous.lineSeparator);
|
||||||
systemInfoText.append("OS version: " + System.getProperty("os.version") + 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("API Level: " + android.os.Build.VERSION.SDK + Miscellaneous.lineSeparator);
|
||||||
systemInfoText.append("Device: " + android.os.Build.DEVICE + Miscellaneous.lineSeparator);
|
systemInfoText.append("Device: " + android.os.Build.DEVICE + Miscellaneous.lineSeparator);
|
||||||
systemInfoText.append("Model: " + android.os.Build.MODEL + Miscellaneous.lineSeparator);
|
systemInfoText.append("Model: " + android.os.Build.MODEL + Miscellaneous.lineSeparator);
|
||||||
systemInfoText.append("Product: " + android.os.Build.PRODUCT + Miscellaneous.lineSeparator);
|
systemInfoText.append("Product: " + android.os.Build.PRODUCT + Miscellaneous.lineSeparator);
|
||||||
systemInfoText.append("Flavor: " + BuildConfig.FLAVOR + Miscellaneous.lineSeparator);
|
|
||||||
systemInfoText.append("Country: " + Miscellaneous.getUserCountry(Miscellaneous.getAnyContext()) + Miscellaneous.lineSeparator);
|
systemInfoText.append("Country: " + Miscellaneous.getUserCountry(Miscellaneous.getAnyContext()) + Miscellaneous.lineSeparator);
|
||||||
systemInfoText.append("OS language: " + Locale.getDefault().getDisplayName());
|
systemInfoText.append("OS language: " + Locale.getDefault().getDisplayName());
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
public class ActivityMainRules extends ActivityGeneric
|
public class ActivityMainRules extends ActivityGeneric
|
||||||
{
|
{
|
||||||
|
public static final String intentNameRuleName = "ruleName";
|
||||||
private ListView ruleListView;
|
private ListView ruleListView;
|
||||||
ArrayList<Rule> ruleList = new ArrayList<>();
|
ArrayList<Rule> ruleList = new ArrayList<>();
|
||||||
private ArrayAdapter<Rule> ruleListViewAdapter;
|
private ArrayAdapter<Rule> ruleListViewAdapter;
|
||||||
@ -207,8 +208,8 @@ public class ActivityMainRules extends ActivityGeneric
|
|||||||
Toast.makeText(ActivityMainRules.this, getResources().getString(R.string.serviceHasToRunForThat), Toast.LENGTH_LONG).show();
|
Toast.makeText(ActivityMainRules.this, getResources().getString(R.string.serviceHasToRunForThat), Toast.LENGTH_LONG).show();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
ruleToEdit = ruleThisIsAbout;
|
|
||||||
Intent manageSpecificRuleIntent = new Intent (ActivityMainRules.this, ActivityManageRule.class);
|
Intent manageSpecificRuleIntent = new Intent (ActivityMainRules.this, ActivityManageRule.class);
|
||||||
|
manageSpecificRuleIntent.putExtra(intentNameRuleName, ruleThisIsAbout.getName());
|
||||||
startActivityForResult(manageSpecificRuleIntent, requestCodeChangeRule);
|
startActivityForResult(manageSpecificRuleIntent, requestCodeChangeRule);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@ -251,15 +252,5 @@ public class ActivityMainRules extends ActivityGeneric
|
|||||||
}
|
}
|
||||||
catch(NullPointerException e)
|
catch(NullPointerException e)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(AutomationService.isMyServiceRunning(this))
|
|
||||||
DateTimeListener.reloadAlarms();
|
|
||||||
}
|
|
||||||
catch(NullPointerException e)
|
|
||||||
{
|
|
||||||
// AlarmManager instance not prepared, yet.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -378,7 +378,7 @@ public class ActivityManageActionStartActivity extends Activity
|
|||||||
public void onClick(View v)
|
public void onClick(View v)
|
||||||
{
|
{
|
||||||
int targetSdkVersion = getApplicationContext().getApplicationInfo().targetSdkVersion;
|
int targetSdkVersion = getApplicationContext().getApplicationInfo().targetSdkVersion;
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && targetSdkVersion >= 30)
|
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))
|
||||||
{
|
{
|
||||||
requestPermissions(new String[] {Manifest.permission.QUERY_ALL_PACKAGES}, requestCodeForRequestQueryAllPackagesPermission);
|
requestPermissions(new String[] {Manifest.permission.QUERY_ALL_PACKAGES}, requestCodeForRequestQueryAllPackagesPermission);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ public class ActivityManagePoi extends Activity
|
|||||||
public LocationManager myLocationManager;
|
public LocationManager myLocationManager;
|
||||||
MyLocationListenerGps myLocationListenerGps = new MyLocationListenerGps();
|
MyLocationListenerGps myLocationListenerGps = new MyLocationListenerGps();
|
||||||
Location locationGps = null, locationNetwork = null;
|
Location locationGps = null, locationNetwork = null;
|
||||||
// Location locationWifi = null;
|
|
||||||
MyLocationListenerNetwork myLocationListenerNetwork = new MyLocationListenerNetwork();
|
MyLocationListenerNetwork myLocationListenerNetwork = new MyLocationListenerNetwork();
|
||||||
Button bGetPosition, bSavePoi;
|
Button bGetPosition, bSavePoi;
|
||||||
ImageButton ibShowOnMap;
|
ImageButton ibShowOnMap;
|
||||||
|
@ -71,12 +71,13 @@ public class ActivityManageRule extends Activity
|
|||||||
static double triggerSpeed;
|
static double triggerSpeed;
|
||||||
static double triggerNoise;
|
static double triggerNoise;
|
||||||
|
|
||||||
static Rule ruleToEdit;
|
|
||||||
static boolean newRule;
|
static boolean newRule;
|
||||||
|
|
||||||
static Trigger newTrigger;
|
static Trigger newTrigger;
|
||||||
static Action newAction;
|
static Action newAction;
|
||||||
|
|
||||||
|
Rule ruleToEdit = null;
|
||||||
|
|
||||||
ArrayAdapter<Trigger> triggerListViewAdapter;
|
ArrayAdapter<Trigger> triggerListViewAdapter;
|
||||||
ArrayAdapter<Action> actionListViewAdapter;
|
ArrayAdapter<Action> actionListViewAdapter;
|
||||||
|
|
||||||
@ -130,10 +131,10 @@ public class ActivityManageRule extends Activity
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
context = this;
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_manage_specific_rule);
|
setContentView(R.layout.activity_manage_specific_rule);
|
||||||
|
|
||||||
|
context = this;
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
cmdTriggerAdd = (Button)findViewById(R.id.cmdTriggerAdd);
|
cmdTriggerAdd = (Button)findViewById(R.id.cmdTriggerAdd);
|
||||||
@ -147,7 +148,17 @@ public class ActivityManageRule extends Activity
|
|||||||
imageHelpButton = (ImageView)findViewById(R.id.imageHelpButton);
|
imageHelpButton = (ImageView)findViewById(R.id.imageHelpButton);
|
||||||
|
|
||||||
//decide if it will be created anew or loaded to edit an existing one
|
//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
|
// new rule
|
||||||
Miscellaneous.logEvent("i", "Rule", "Cache empty, assuming create request.", 3);
|
Miscellaneous.logEvent("i", "Rule", "Cache empty, assuming create request.", 3);
|
||||||
@ -158,16 +169,6 @@ public class ActivityManageRule extends Activity
|
|||||||
triggerListViewAdapter = new ArrayAdapter<Trigger>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ruleToEdit.getTriggerSet());
|
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());
|
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()
|
cmdTriggerAdd.setOnClickListener(new OnClickListener()
|
||||||
{
|
{
|
||||||
@ -256,8 +257,9 @@ public class ActivityManageRule extends Activity
|
|||||||
switch(selectedTrigger.getTriggerType())
|
switch(selectedTrigger.getTriggerType())
|
||||||
{
|
{
|
||||||
case timeFrame:
|
case timeFrame:
|
||||||
ActivityManageTriggerTimeFrame.editedTimeFrameTrigger = selectedTrigger;
|
|
||||||
Intent timeFrameEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerTimeFrame.class);
|
Intent timeFrameEditor = new Intent(ActivityManageRule.this, ActivityManageTriggerTimeFrame.class);
|
||||||
|
timeFrameEditor.putExtra(intentNameTriggerParameter1, selectedTrigger.getTriggerParameter());
|
||||||
|
timeFrameEditor.putExtra(intentNameTriggerParameter2, selectedTrigger.getTriggerParameter2());
|
||||||
startActivityForResult(timeFrameEditor, requestCodeTriggerTimeframeEdit);
|
startActivityForResult(timeFrameEditor, requestCodeTriggerTimeframeEdit);
|
||||||
break;
|
break;
|
||||||
case bluetoothConnection:
|
case bluetoothConnection:
|
||||||
@ -1250,9 +1252,15 @@ public class ActivityManageRule extends Activity
|
|||||||
else if(requestCode == requestCodeTriggerTimeframeEdit)
|
else if(requestCode == requestCodeTriggerTimeframeEdit)
|
||||||
{
|
{
|
||||||
//edit TimeFrame
|
//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();
|
this.refreshTriggerList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.jens.automation2;
|
package com.jens.automation2;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
@ -27,7 +28,7 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
|||||||
RadioButton radioTimeFrameEntering, radioTimeFrameLeaving;
|
RadioButton radioTimeFrameEntering, radioTimeFrameLeaving;
|
||||||
EditText etRepeatEvery;
|
EditText etRepeatEvery;
|
||||||
|
|
||||||
public static Trigger editedTimeFrameTrigger = null;
|
static Trigger editedTimeFrameTrigger = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
@ -152,8 +153,13 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
editedTimeFrameTrigger.setTriggerParameter(radioTimeFrameEntering.isChecked());
|
editedTimeFrameTrigger.setTriggerParameter(radioTimeFrameEntering.isChecked());
|
||||||
|
editedTimeFrameTrigger.setTriggerParameter2(editedTimeFrameTrigger.getTimeFrame().toTriggerParameter2String());
|
||||||
|
|
||||||
setResult(RESULT_OK);
|
Intent response = new Intent();
|
||||||
|
response.putExtra(ActivityManageRule.intentNameTriggerParameter1, editedTimeFrameTrigger.getTriggerParameter());
|
||||||
|
response.putExtra(ActivityManageRule.intentNameTriggerParameter2, editedTimeFrameTrigger.getTriggerParameter2());
|
||||||
|
|
||||||
|
setResult(RESULT_OK, response);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -167,9 +173,15 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
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();
|
loadVariableIntoGui();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void loadVariableIntoGui()
|
private void loadVariableIntoGui()
|
||||||
{
|
{
|
||||||
@ -219,5 +231,4 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
|||||||
etRepeatEvery.setText(String.valueOf(editedTimeFrameTrigger.getTimeFrame().getRepetition()));
|
etRepeatEvery.setText(String.valueOf(editedTimeFrameTrigger.getTimeFrame().getRepetition()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -904,6 +904,9 @@ public class ActivityPermissions extends Activity
|
|||||||
case Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS:
|
case Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS:
|
||||||
usingElements.add(getResources().getString(R.string.recommendedForBetterReliability));
|
usingElements.add(getResources().getString(R.string.recommendedForBetterReliability));
|
||||||
break;
|
break;
|
||||||
|
case Manifest.permission.QUERY_ALL_PACKAGES:
|
||||||
|
usingElements.add(getResources().getString(R.string.queryAllPackages));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return usingElements;
|
return usingElements;
|
||||||
|
@ -28,6 +28,7 @@ import androidx.core.app.NotificationManagerCompat;
|
|||||||
|
|
||||||
import com.jens.automation2.Trigger.Trigger_Enum;
|
import com.jens.automation2.Trigger.Trigger_Enum;
|
||||||
import com.jens.automation2.location.LocationProvider;
|
import com.jens.automation2.location.LocationProvider;
|
||||||
|
import com.jens.automation2.receivers.DateTimeListener;
|
||||||
import com.jens.automation2.receivers.PackageReplacedReceiver;
|
import com.jens.automation2.receivers.PackageReplacedReceiver;
|
||||||
import com.jens.automation2.receivers.PhoneStatusListener;
|
import com.jens.automation2.receivers.PhoneStatusListener;
|
||||||
|
|
||||||
@ -58,6 +59,8 @@ public class AutomationService extends Service implements OnInitListener
|
|||||||
protected Calendar lockSoundChangesEnd = null;
|
protected Calendar lockSoundChangesEnd = null;
|
||||||
protected boolean isRunning;
|
protected boolean isRunning;
|
||||||
|
|
||||||
|
protected static AutomationService centralInstance = null;
|
||||||
|
|
||||||
public void nullLockSoundChangesEnd()
|
public void nullLockSoundChangesEnd()
|
||||||
{
|
{
|
||||||
lockSoundChangesEnd = null;
|
lockSoundChangesEnd = null;
|
||||||
@ -95,8 +98,6 @@ public class AutomationService extends Service implements OnInitListener
|
|||||||
return myLocationProvider;
|
return myLocationProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static AutomationService centralInstance = null;
|
|
||||||
|
|
||||||
public static AutomationService getInstance()
|
public static AutomationService getInstance()
|
||||||
{
|
{
|
||||||
return centralInstance;
|
return centralInstance;
|
||||||
@ -288,6 +289,8 @@ public class AutomationService extends Service implements OnInitListener
|
|||||||
myLocationProvider.applySettingsAndRules();
|
myLocationProvider.applySettingsAndRules();
|
||||||
|
|
||||||
ReceiverCoordinator.applySettingsAndRules();
|
ReceiverCoordinator.applySettingsAndRules();
|
||||||
|
|
||||||
|
DateTimeListener.reloadAlarms();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -466,6 +469,8 @@ public class AutomationService extends Service implements OnInitListener
|
|||||||
ttsEngine.shutdown();
|
ttsEngine.shutdown();
|
||||||
|
|
||||||
PackageReplacedReceiver.setHasServiceBeenRunning(false, this);
|
PackageReplacedReceiver.setHasServiceBeenRunning(false, this);
|
||||||
|
|
||||||
|
centralInstance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static Builder createDefaultNotificationBuilderOld()
|
protected static Builder createDefaultNotificationBuilderOld()
|
||||||
|
@ -1840,7 +1840,8 @@ public class Miscellaneous extends Service
|
|||||||
* @param context Context reference to get the TelephonyManager instance from
|
* @param context Context reference to get the TelephonyManager instance from
|
||||||
* @return country code or null
|
* @return country code or null
|
||||||
*/
|
*/
|
||||||
public static String getUserCountry(Context context) {
|
public static String getUserCountry(Context context)
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
|
@ -80,6 +80,29 @@ public class TimeFrame
|
|||||||
this.setRepetition(Long.parseLong(dateArray[3]));
|
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
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -935,7 +935,7 @@ public class Trigger
|
|||||||
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) < 0
|
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) < 0
|
||||||
&&
|
&&
|
||||||
(Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
(Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
||||||
|
|
||
|
||||||
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0)
|
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -254,8 +254,6 @@ public class XmlFileInterface
|
|||||||
else
|
else
|
||||||
serializer.text("null");
|
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)
|
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()));
|
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)
|
else if(Rule.getRuleCollection().get(i).getTriggerSet().get(j).getTriggerType() == Trigger_Enum.noiseLevel)
|
||||||
@ -838,7 +836,6 @@ public class XmlFileInterface
|
|||||||
|
|
||||||
private static Trigger readTrigger(XmlPullParser parser) throws IOException, XmlPullParserException
|
private static Trigger readTrigger(XmlPullParser parser) throws IOException, XmlPullParserException
|
||||||
{
|
{
|
||||||
|
|
||||||
/* FILE EXAMPE:
|
/* FILE EXAMPE:
|
||||||
* *****************
|
* *****************
|
||||||
* <Automation>
|
* <Automation>
|
||||||
|
@ -41,6 +41,7 @@ public class WifiBroadcastReceiver extends BroadcastReceiver
|
|||||||
if(newWifiSsid.startsWith("\"") && newWifiSsid.endsWith("\""))
|
if(newWifiSsid.startsWith("\"") && newWifiSsid.endsWith("\""))
|
||||||
newWifiSsid = newWifiSsid.substring(1, newWifiSsid.length()-1);
|
newWifiSsid = newWifiSsid.substring(1, newWifiSsid.length()-1);
|
||||||
|
|
||||||
|
if(newWifiSsid.length() > 0)
|
||||||
WifiBroadcastReceiver.lastWifiSsid = newWifiSsid;
|
WifiBroadcastReceiver.lastWifiSsid = newWifiSsid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,12 +27,10 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
{
|
{
|
||||||
private static AutomationService automationServiceRef;
|
private static AutomationService automationServiceRef;
|
||||||
private static AlarmManager centralAlarmManagerInstance;
|
private static AlarmManager centralAlarmManagerInstance;
|
||||||
// private static Intent alarmIntent;
|
|
||||||
// private static PendingIntent alarmPendingIntent;
|
|
||||||
private static boolean alarmListenerActive=false;
|
private static boolean alarmListenerActive=false;
|
||||||
private static ArrayList<ScheduleElement> alarmCandidates = new ArrayList<>();
|
private static ArrayList<ScheduleElement> alarmCandidates = new ArrayList<>();
|
||||||
|
|
||||||
private static ArrayList<Integer> requestCodeList = new ArrayList<Integer>();
|
private static ArrayList<Integer> requestCodeList = new ArrayList<Integer>();
|
||||||
|
static PendingIntent alarmPendingIntent = null;
|
||||||
|
|
||||||
public static void startAlarmListener(final AutomationService automationServiceRef)
|
public static void startAlarmListener(final AutomationService automationServiceRef)
|
||||||
{
|
{
|
||||||
@ -52,12 +50,8 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
public void onReceive(Context context, Intent intent)
|
public void onReceive(Context context, Intent intent)
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "AlarmListener", "Alarm received", 2);
|
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.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))
|
if(allRulesWithNowInTimeFrame.get(i).getsGreenLight(context))
|
||||||
@ -79,22 +73,6 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
|
|
||||||
int i=0;
|
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);
|
|
||||||
|
|
||||||
ArrayList<Rule> allRulesWithTimeFrames = new ArrayList<Rule>();
|
ArrayList<Rule> allRulesWithTimeFrames = new ArrayList<Rule>();
|
||||||
allRulesWithTimeFrames = Rule.findRuleCandidates(Trigger_Enum.timeFrame);
|
allRulesWithTimeFrames = Rule.findRuleCandidates(Trigger_Enum.timeFrame);
|
||||||
// allRulesWithTimeFrames = Rule.findRuleCandidatesByTimeFrame();
|
// allRulesWithTimeFrames = Rule.findRuleCandidatesByTimeFrame();
|
||||||
@ -264,11 +242,10 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
Intent alarmIntent = new Intent(automationServiceRef, DateTimeListener.class);
|
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);
|
centralAlarmManagerInstance.set(AlarmManager.RTC_WAKEUP, scheduleCandidate.time.getTimeInMillis(), alarmPendingIntent);
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("E dd.MM.yyyy HH:mm:ss");
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("E dd.MM.yyyy HH:mm");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(scheduleCandidate.time.getTimeInMillis());
|
calendar.setTimeInMillis(scheduleCandidate.time.getTimeInMillis());
|
||||||
Miscellaneous.logEvent("i", "AlarmManager", "Chose " + sdf.format(calendar.getTime()) + " as next scheduled alarm.", 4);
|
Miscellaneous.logEvent("i", "AlarmManager", "Chose " + sdf.format(calendar.getTime()) + " as next scheduled alarm.", 4);
|
||||||
@ -280,7 +257,8 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
for(int requestCode : requestCodeList)
|
for(int requestCode : requestCodeList)
|
||||||
{
|
{
|
||||||
Intent alarmIntent = new Intent(automationServiceRef, DateTimeListener.class);
|
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));
|
// Miscellaneous.logEvent("i", "AlarmManager", "Clearing alarm with request code: " + String.valueOf(requestCode));
|
||||||
centralAlarmManagerInstance.cancel(alarmPendingIntent);
|
centralAlarmManagerInstance.cancel(alarmPendingIntent);
|
||||||
}
|
}
|
||||||
@ -316,7 +294,7 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "AlarmListener", "Stopping alarm listener.", 4);
|
Miscellaneous.logEvent("i", "AlarmListener", "Stopping alarm listener.", 4);
|
||||||
clearAlarms();
|
clearAlarms();
|
||||||
// centralAlarmManagerInstance.cancel(alarmPendingIntent);
|
centralAlarmManagerInstance.cancel(alarmPendingIntent);
|
||||||
alarmListenerActive = false;
|
alarmListenerActive = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -403,8 +381,6 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
calSet.set(Calendar.SECOND, 0);
|
calSet.set(Calendar.SECOND, 0);
|
||||||
calSet.set(Calendar.MILLISECOND, 0);
|
calSet.set(Calendar.MILLISECOND, 0);
|
||||||
|
|
||||||
// if(this.applies(null))
|
|
||||||
// {
|
|
||||||
// If the starting time is a day ahead remove 1 day.
|
// If the starting time is a day ahead remove 1 day.
|
||||||
if(calSet.getTimeInMillis() > now.getTimeInMillis())
|
if(calSet.getTimeInMillis() > now.getTimeInMillis())
|
||||||
calSet.add(Calendar.DAY_OF_MONTH, -1);
|
calSet.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
@ -419,11 +395,8 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
* Das war mal aktiviert. Allerdings: Die ganze Funktion liefert zurück, wenn die Regel NOCH nicht
|
* 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.
|
* zutrifft, aber wir z.B. gleich den zeitlichen Bereich betreten.
|
||||||
*/
|
*/
|
||||||
// if(trigger.checkDateTime(calSchedule.getTime(), false))
|
|
||||||
// {
|
|
||||||
return calSchedule;
|
return calSchedule;
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Miscellaneous.logEvent("i", "DateTimeListener", "Trigger " + trigger.toString() + " is not executed repeatedly.", 5);
|
Miscellaneous.logEvent("i", "DateTimeListener", "Trigger " + trigger.toString() + " is not executed repeatedly.", 5);
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType="numberSigned" />
|
android:inputType="text" />
|
||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
@ -78,7 +78,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType="numberSigned" />
|
android:inputType="text" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
|
@ -700,6 +700,7 @@
|
|||||||
<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="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="profileXrequiresThis">Profil \"%1$s\" benötigt dies.</string>
|
||||||
<string name="lastProfile">Letztes Profil:</string>
|
<string name="lastProfile">Letztes Profil:</string>
|
||||||
|
<string name="queryAllPackages">Liste von installierten Anwendungen auslesen</string>
|
||||||
<string name="serviceStarts">Dienst startet</string>
|
<string name="serviceStarts">Dienst startet</string>
|
||||||
<string name="deviceStarts">Gerät startet</string>
|
<string name="deviceStarts">Gerät startet</string>
|
||||||
<string name="deviceHasJustStarted">Gerät ist gerade gestartet</string>
|
<string name="deviceHasJustStarted">Gerät ist gerade gestartet</string>
|
||||||
|
@ -699,6 +699,7 @@
|
|||||||
<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="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="profileXrequiresThis">El perfil \"%1$s\" requiere esto.</string>
|
||||||
<string name="lastProfile">Último perfil:</string>
|
<string name="lastProfile">Último perfil:</string>
|
||||||
|
<string name="queryAllPackages">Obtener una lista de las aplicaciones instaladas</string>
|
||||||
<string name="deviceStarts">Dispositivo esta enciendo</string>
|
<string name="deviceStarts">Dispositivo esta enciendo</string>
|
||||||
<string name="serviceStarts">Servicio esta enciendo</string>
|
<string name="serviceStarts">Servicio esta enciendo</string>
|
||||||
<string name="deviceHasJustStarted">el dispositivo justamente ha encendido</string>
|
<string name="deviceHasJustStarted">el dispositivo justamente ha encendido</string>
|
||||||
|
@ -700,6 +700,7 @@
|
|||||||
<string name="profileXrequiresThis">Questo è richiesto dal profilo \"%1$s\".</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 non funziona per te, mi dispiace. Cercherò di risolvere questo problema non appena conoscerò la causa. Quindi, se cerchio rotante non smette di girare, sai perché.</string>
|
<string name="locationNotWorkingOn12">Ottenere la posizione non sembra funzionare su dispositivi Android 12 al momento. Se non funziona per te, mi dispiace. Cercherò di risolvere questo problema non appena conoscerò la causa. Quindi, se cerchio rotante non smette di girare, sai perché.</string>
|
||||||
<string name="lastProfile">Ultimo profilo:</string>
|
<string name="lastProfile">Ultimo profilo:</string>
|
||||||
|
<string name="queryAllPackages">Ottenere un elenco delle applicazioni installate</string>
|
||||||
<string name="deviceStarts">Device starts</string>
|
<string name="deviceStarts">Device starts</string>
|
||||||
<string name="serviceStarts">Avvio del servizio</string>
|
<string name="serviceStarts">Avvio del servizio</string>
|
||||||
<string name="deviceHasJustStarted">Il dispositivo è appena stato avviato</string>
|
<string name="deviceHasJustStarted">Il dispositivo è appena stato avviato</string>
|
||||||
|
@ -698,6 +698,7 @@
|
|||||||
<string name="locationNotWorkingOn12">Het verkrijgen van de locatie lijkt momenteel niet te werken op Android 12-apparaten. Als het niet voor je werkt, spijt het me. Ik zal proberen dit op te lossen zodra ik de oorzaak ken. Dus als de donut niet stopt met draaien, weet je waarom.</string>
|
<string name="locationNotWorkingOn12">Het verkrijgen van de locatie lijkt momenteel niet te werken op Android 12-apparaten. Als het niet voor je werkt, spijt het me. Ik zal proberen dit op te lossen zodra ik de oorzaak ken. Dus als de donut niet stopt met draaien, weet je waarom.</string>
|
||||||
<string name="profileXrequiresThis">Profiel \"%1$s\" vereist dit.</string>
|
<string name="profileXrequiresThis">Profiel \"%1$s\" vereist dit.</string>
|
||||||
<string name="lastProfile">Laatste profiel:</string>
|
<string name="lastProfile">Laatste profiel:</string>
|
||||||
|
<string name="queryAllPackages">Een lijst met geïnstalleerde toepassingen ophalen</string>
|
||||||
<string name="deviceHasJustStarted">apparaat is net gestart</string>
|
<string name="deviceHasJustStarted">apparaat is net gestart</string>
|
||||||
<string name="serviceHasJustStarted">service is net begonnen</string>
|
<string name="serviceHasJustStarted">service is net begonnen</string>
|
||||||
<string name="serviceStarts">Service start</string>
|
<string name="serviceStarts">Service start</string>
|
||||||
|
@ -796,6 +796,7 @@
|
|||||||
<string name="musicCheckFrequencySummary">Milliseconds between checks</string>
|
<string name="musicCheckFrequencySummary">Milliseconds between checks</string>
|
||||||
<string name="locationNotWorkingOn12">Getting the location does not seem to be working on Android 12 devices currently. If it isn\'t working for you, I\'m sorry. I\'ll try to fix this as soon as I know the cause. So if the donut doesn\'t stop spinning, you know why.</string>
|
<string name="locationNotWorkingOn12">Getting the location does not seem to be working on Android 12 devices currently. If it isn\'t working for you, I\'m sorry. I\'ll try to fix this as soon as I know the cause. So if the donut doesn\'t stop spinning, you know why.</string>
|
||||||
<string name="lastProfile">Last profile:</string>
|
<string name="lastProfile">Last profile:</string>
|
||||||
|
<string name="queryAllPackages">Get a list of installed applications</string>
|
||||||
<string name="deviceStarts">Device starts</string>
|
<string name="deviceStarts">Device starts</string>
|
||||||
<string name="serviceStarts">Service starts</string>
|
<string name="serviceStarts">Service starts</string>
|
||||||
<string name="deviceHasJustStarted">device has just started</string>
|
<string name="deviceHasJustStarted">device has just started</string>
|
||||||
|
@ -5,7 +5,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
classpath 'com.android.tools.build:gradle:7.1.3'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
14
fastlane/metadata/android/de-DE/changelogs/118.txt
Normal file
14
fastlane/metadata/android/de-DE/changelogs/118.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Neuer Auslöser:
|
||||||
|
* Bildschirmstatus (ein/aus)
|
||||||
|
Neue Aktionen:
|
||||||
|
* Benachrichtigung erstellen
|
||||||
|
* Benachrichtigung(en) schließen
|
||||||
|
* Medienwiedergabe steuern
|
||||||
|
Fehler behoben:
|
||||||
|
* Übersetzungsfehler im niederländischen Variablentext
|
||||||
|
* Variablen wurden beim Senden von Textnachrichten nicht ersetzt
|
||||||
|
* Der Dienst startete nicht immer, nachdem das Gerät eingeschaltet wurde
|
||||||
|
* Setzen von Klingeltönen auf Android 11 und höher
|
||||||
|
* Für das Ändern von Klingeltönen ist die Speicher-lesen-Berechtigung nötig
|
||||||
|
* Profil, das nicht verwendet wurde, konnte nicht gelöscht werden
|
||||||
|
* Orientierungssensor an Geräten ohne Magnet-Sensor
|
5
fastlane/metadata/android/de-DE/changelogs/119.txt
Normal file
5
fastlane/metadata/android/de-DE/changelogs/119.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
* Fehlerbehebung: Verwaltung von Zeitraum-Auslösern wurde manchmal falsch geladen, während der Dienst lief.
|
||||||
|
* Fehlerbehebung: Zeitraum-Auslöser: Wiederholte Ausführungen haben manchmal nicht funktioniert
|
||||||
|
* Fehlerbehebung: Zeitraum-Auslöser: Wiederholte Ausführungen liefen weiter, nachdem der Dienst bereits gestoppt wurde.
|
||||||
|
* Fehlerbehebung: Die Anwendung hatte sich nicht das zuletzt verbundene WLAN gemerkt.
|
||||||
|
* Fehlerbehebung: Programm starten: Liste zum Auswählen einer Anwendung konnte nicht erzeugt werden.
|
@ -8,3 +8,4 @@
|
|||||||
* Fixed: Set ringtones on Android 11 and above
|
* Fixed: Set ringtones on Android 11 and above
|
||||||
* Fixed: Permission read storage required for changing ringtones
|
* Fixed: Permission read storage required for changing ringtones
|
||||||
* Fixed: Profile that were not in use, could not be deleted.
|
* Fixed: Profile that were not in use, could not be deleted.
|
||||||
|
* Fixed: Orientation sensor on devices that have no magnetic sensor.
|
@ -1,2 +1,5 @@
|
|||||||
* New trigger: device has just started
|
* Fixed: Management of DateTimeTrigger was sometimes reloaded incorrectly while service was running
|
||||||
* New trigger: service has just started
|
* Fixed: DateTimeTrigger: Repeated executions sometimes not working
|
||||||
|
* Fixed: DateTimeTrigger: Repeated executions continued to run after service was stopped
|
||||||
|
* Fixed: App did not memorize the most recent wifi name connected to
|
||||||
|
* Fixed: No app list displayed when trying to pick which app to start
|
14
fastlane/metadata/android/es-ES/changelogs/118.txt
Normal file
14
fastlane/metadata/android/es-ES/changelogs/118.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Nuevo disparador:
|
||||||
|
* estado de la pantalla (encendido / apagado)
|
||||||
|
Nuevas acciones:
|
||||||
|
* Crear notificación
|
||||||
|
* Cerrar notificación(es)
|
||||||
|
* Controlar la reproducción de medios
|
||||||
|
Corregido:
|
||||||
|
* Error de traducción en texto de variables holandesas
|
||||||
|
* Las variables no fueron reemplazadas al enviar mensajes de texto
|
||||||
|
* El servicio no siempre se iniciaría después de que el dispositivo se haya encendido
|
||||||
|
* Establecer tonos de llamada en Android 11 y superior
|
||||||
|
* Se requiere almacenamiento de lectura de permisos para cambiar los tonos de llamada
|
||||||
|
* Perfil que no estaba en uso, no se pudo eliminar
|
||||||
|
* Sensor de orientación en dispositivos que no tienen sensor magnético
|
5
fastlane/metadata/android/es-ES/changelogs/119.txt
Normal file
5
fastlane/metadata/android/es-ES/changelogs/119.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
* Corregido: La administración de DateTimeTrigger a veces se recargaba incorrectamente mientras se ejecutaba el servicio
|
||||||
|
* Corregido: DateTimeTrigger: Ejecuciones repetidas a veces no funcionaban
|
||||||
|
* Corregido: DateTimeTrigger: Las ejecuciones repetidas continuaron ejecutándose después de que se detuvo el servicio
|
||||||
|
* Corregido: la aplicación no memorizó el nombre wifi más reciente conectado a
|
||||||
|
* Corregido: No se muestra ninguna lista de aplicaciones al intentar elegir qué aplicación iniciar
|
14
fastlane/metadata/android/it-IT/changelogs/118.txt
Normal file
14
fastlane/metadata/android/it-IT/changelogs/118.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Nuovo trigger:
|
||||||
|
* stato dello schermo (on / off)
|
||||||
|
Nuove azioni:
|
||||||
|
* Crea notifica
|
||||||
|
* Chiudi notifica (s)
|
||||||
|
* Controlla la riproduzione multimediale
|
||||||
|
Fissato:
|
||||||
|
* Bug di traduzione nel testo delle variabili olandesi
|
||||||
|
* Le variabili non sono state sostituite durante l'invio di messaggi di testo
|
||||||
|
* Il servizio non si avvia sempre dopo l'accensione del dispositivo
|
||||||
|
* Imposta suonerie su Android 11 e versioni successive
|
||||||
|
* Autorizzazione di lettura necessaria per cambiare le suonerie
|
||||||
|
* Profilo che non era in uso, non poteva essere eliminato
|
||||||
|
* Sensore di orientamento su dispositivi che non hanno sensore mag.
|
5
fastlane/metadata/android/it-IT/changelogs/119.txt
Normal file
5
fastlane/metadata/android/it-IT/changelogs/119.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
* Risolto: la gestione di DateTimeTrigger a volte veniva ricaricata in modo errato durante l'esecuzione del servizio
|
||||||
|
* Risolto: DateTimeTrigger: esecuzioni ripetute a volte non funzionano
|
||||||
|
* Risolto: DateTimeTrigger: esecuzioni ripetute hanno continuato a funzionare dopo l'arresto del servizio
|
||||||
|
* Risolto: l'app non memorizzava il nome wifi più recente collegato a
|
||||||
|
* Risolto: nessun elenco di app visualizzato quando si tenta di scegliere quale app avviare
|
11
fastlane/metadata/android/nl-NL/changelogs/118.txt
Normal file
11
fastlane/metadata/android/nl-NL/changelogs/118.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
* Nieuwe trigger: schermstatus (aan / uit)
|
||||||
|
* Nieuwe actie: Melding maken
|
||||||
|
* Nieuwe actie: Sluit melding (en)
|
||||||
|
* Nieuwe actie: Bedien het afspelen van media
|
||||||
|
* Fixed: Vertaling bug in Nederlandse variabelen tekst
|
||||||
|
* Opgelost: Variabelen zijn niet vervangen bij het verzenden van sms-berichten
|
||||||
|
* Opgelost: service start niet altijd nadat het apparaat is ingeschakeld
|
||||||
|
* Opgelost: stel beltonen in op Android 11 en hoger
|
||||||
|
* Opgelost: Toestemming leesopslag vereist voor het wijzigen van beltonen
|
||||||
|
* Opgelost: Profiel dat niet in gebruik was, kon niet worden verwijderd.
|
||||||
|
* Vast: Oriëntatiesensor op apparaten die geen magnetische sensor hebben.
|
5
fastlane/metadata/android/nl-NL/changelogs/119.txt
Normal file
5
fastlane/metadata/android/nl-NL/changelogs/119.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
* Opgelost: beheer van DateTimeTrigger werd soms onjuist opnieuw geladen terwijl de service werd uitgevoerd
|
||||||
|
* Opgelost: DateTimeTrigger: Herhaalde uitvoeringen soms niet werken
|
||||||
|
* Opgelost: DateTimeTrigger: Herhaalde uitvoeringen bleven lopen nadat de service was gestopt
|
||||||
|
* Opgelost: app heeft de meest recente wifi-naam die is verbonden met
|
||||||
|
* Opgelost: er wordt geen app-lijst weergegeven wanneer u probeert te kiezen welke app u wilt starten
|
Loading…
Reference in New Issue
Block a user