Fixed crash when exiting settings while service is running
This commit is contained in:
parent
8788a89e48
commit
eb893a7f21
@ -321,6 +321,8 @@ public class AutomationService extends Service implements OnInitListener
|
||||
ReceiverCoordinator.applySettingsAndRules();
|
||||
|
||||
DateTimeListener.setOrResetAlarms();
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent) && ActivityPermissions.isPermissionDeclaratedInManifest(AutomationService.getInstance(), Manifest.permission.READ_CALENDAR) && ActivityPermissions.havePermission(Manifest.permission.READ_CALENDAR, AutomationService.getInstance()))
|
||||
CalendarReceiver.armOrRearmTimer();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.jens.automation2;
|
||||
|
||||
import android.Manifest;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
@ -212,7 +213,7 @@ public class ReceiverCoordinator
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.screenState))
|
||||
ScreenStateReceiver.startScreenStateReceiver(AutomationService.getInstance());
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent))
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent) && ActivityPermissions.isPermissionDeclaratedInManifest(AutomationService.getInstance(), Manifest.permission.READ_CALENDAR) && ActivityPermissions.havePermission(Manifest.permission.READ_CALENDAR, AutomationService.getInstance()))
|
||||
CalendarReceiver.startCalendarReceiver(AutomationService.getInstance());
|
||||
}
|
||||
|
||||
@ -469,7 +470,7 @@ public class ReceiverCoordinator
|
||||
}
|
||||
}
|
||||
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent))
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.calendarEvent) && ActivityPermissions.isPermissionDeclaratedInManifest(AutomationService.getInstance(), Manifest.permission.READ_CALENDAR) && ActivityPermissions.havePermission(Manifest.permission.READ_CALENDAR, AutomationService.getInstance()))
|
||||
{
|
||||
if(!CalendarReceiver.getInstance().isListenerRunning())
|
||||
CalendarReceiver.getInstance().startListener(AutomationService.getInstance());
|
||||
|
@ -1,2 +1,3 @@
|
||||
* Fixed: Calendar trigger hidden from Play version
|
||||
* Fixed: Parameters not correctly supplied when starting other apps
|
||||
* Fixed: Crash when exiting settings while service is running
|
Loading…
Reference in New Issue
Block a user