From c61c5ba14c60f36ffa2e06054c43b3dbdf099cdb Mon Sep 17 00:00:00 2001 From: jens Date: Sun, 31 Dec 2023 16:53:59 +0100 Subject: [PATCH] if brackets --- .../com/jens/automation2/receivers/CalendarReceiver.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/jens/automation2/receivers/CalendarReceiver.java b/app/src/main/java/com/jens/automation2/receivers/CalendarReceiver.java index 654de39..4af9b4e 100644 --- a/app/src/main/java/com/jens/automation2/receivers/CalendarReceiver.java +++ b/app/src/main/java/com/jens/automation2/receivers/CalendarReceiver.java @@ -291,7 +291,10 @@ public class CalendarReceiver extends BroadcastReceiver implements AutomationLis if (alarmManager == null) { alarmManager = (AlarmManager) Miscellaneous.getAnyContext().getSystemService(Context.ALARM_SERVICE); + } + if(pi == null) + { Intent intent = new Intent(Miscellaneous.getAnyContext(), CalendarReceiver.class); intent.setAction(calendarAlarmAction); pi = PendingIntent.getBroadcast(AutomationService.getInstance(), 0, intent, 0); @@ -364,7 +367,7 @@ public class CalendarReceiver extends BroadcastReceiver implements AutomationLis if (nextWakeup == null || event.end.getTimeInMillis() < nextWakeup.getTimeInMillis()) { nextWakeup = event.end; - Miscellaneous.logEvent("i", "calculateNextWakeupForCalendar()", "Choosing end of event " + event.title + " as next wakeup.", 5); + Miscellaneous.logEvent("i", "calculateNextWakeupForCalendar()", "Chose end of event " + event.title + " as next wakeup.", 5); if(!alarmHasChanged) alarmHasChanged = true; } @@ -374,7 +377,7 @@ public class CalendarReceiver extends BroadcastReceiver implements AutomationLis if (nextWakeup == null || event.start.getTimeInMillis() < nextWakeup.getTimeInMillis()) { nextWakeup = event.start; - Miscellaneous.logEvent("i", "calculateNextWakeupForCalendar()", "Choosing start of event " + event.title + " as next wakeup.", 5); + Miscellaneous.logEvent("i", "calculateNextWakeupForCalendar()", "Chose start of event " + event.title + " as next wakeup.", 5); if(!alarmHasChanged) alarmHasChanged = true; }