Merge remote-tracking branch 'origin/development' into development

# Conflicts:
#	app/src/main/java/com/jens/automation2/ActivityManageRule.java
This commit is contained in:
jens 2022-06-01 22:39:46 +02:00
commit 88a3ab8241
4 changed files with 26 additions and 22 deletions

View File

@ -353,6 +353,7 @@ public class ActivityControlCenter extends Activity
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("Target SDK: " + Miscellaneous.getAnyContext().getApplicationInfo().targetSdkVersion + 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);

View File

@ -127,7 +127,7 @@ public class ActivityManageRule extends Activity
final static int requestCodeActionRunExecutableEdit = 814; final static int requestCodeActionRunExecutableEdit = 814;
final static int requestCodeActionSetWifiAdd = 815; final static int requestCodeActionSetWifiAdd = 815;
final static int requestCodeActionSetWifiEdit = 816; final static int requestCodeActionSetWifiEdit = 816;
public static ActivityManageRule getInstance() public static ActivityManageRule getInstance()
{ {
if(instance == null) if(instance == null)
@ -1392,8 +1392,18 @@ public class ActivityManageRule extends Activity
{ {
if(resultCode == RESULT_OK) if(resultCode == RESULT_OK)
{ {
newTrigger = ActivityManageTriggerNotification.resultingTrigger; Trigger editedTrigger = new Trigger();
newTrigger.setParentRule(ruleToEdit); 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(); this.refreshTriggerList();
} }
} }

View File

@ -322,23 +322,14 @@ public class ActivityManageTriggerNotification extends Activity
String textDir = Trigger.getMatchCode(spinnerTextDirection.getSelectedItem().toString()); String textDir = Trigger.getMatchCode(spinnerTextDirection.getSelectedItem().toString());
String text = etNotificationText.getText().toString(); String text = etNotificationText.getText().toString();
if(edit) Intent data = new Intent();
{ data.putExtra(intentNameNotificationDirection, chkNotificationDirection.isChecked());
editedNotificationTrigger.setTriggerParameter(chkNotificationDirection.isChecked()); data.putExtra(intentNameNotificationApp, app);
editedNotificationTrigger.setTriggerParameter2(app + triggerParameter2Split + titleDir + triggerParameter2Split + title + triggerParameter2Split + textDir + triggerParameter2Split + text); data.putExtra(intentNameNotificationTitleDir, titleDir);
ActivityManageTriggerNotification.this.setResult(RESULT_OK); data.putExtra(intentNameNotificationTitle, title);
} data.putExtra(intentNameNotificationTextDir, textDir);
else 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(); finish();
} }

View File

@ -1,5 +1,7 @@
* New trigger: device has just started * New trigger: device has just started
* New trigger: service has just started * New trigger: service has just started
* New parameter for trigger Screen state: New state "locked"
* New trigger: Respond to customizable broadcasts * New trigger: Respond to customizable broadcasts
* New action: Send broadcasts * New parameter for trigger Screen state: New state "locked"
* New action: Send broadcasts
* Fixed: Crash when editing notification trigger
* Fixed: TimeFrame trigger - time may have changed when crossing timezones