Log improvements

This commit is contained in:
Jens 2023-01-15 23:18:42 +01:00
parent 49e4c20ab6
commit ca81e6a7bd

View File

@ -421,14 +421,18 @@ public class PointOfInterest implements Comparable<PointOfInterest>
public boolean create(Context context)
{
for(PointOfInterest poi : PointOfInterest.pointOfInterestCollection)
{
if (poi.getName().equals(this.getName()))
{
Toast.makeText(context, context.getResources().getString(R.string.anotherPoiByThatName), Toast.LENGTH_LONG).show();
return false;
}
}
if(plausibilityCheck())
{
Miscellaneous.logEvent("i", "Creating POI", this.toStringLong(), 3);
PointOfInterest.pointOfInterestCollection.add(this);
PointOfInterest.writePoisToFile();
@ -492,6 +496,8 @@ public class PointOfInterest implements Comparable<PointOfInterest>
if (plausibilityCheck())
{
Miscellaneous.logEvent("i", "Changing POI", "Old name: " + this.oldName + ", new data: " + this.toStringLong(), 3);
if(PointOfInterest.writePoisToFile())
{
AutomationService service = AutomationService.getInstance();