forked from jens/Automation
Fixed crash when exiting settings while service is running
This commit is contained in:
parent
8788a89e48
commit
eb893a7f21
@ -321,7 +321,9 @@ public class AutomationService extends Service implements OnInitListener
|
|||||||
ReceiverCoordinator.applySettingsAndRules();
|
ReceiverCoordinator.applySettingsAndRules();
|
||||||
|
|
||||||
DateTimeListener.setOrResetAlarms();
|
DateTimeListener.setOrResetAlarms();
|
||||||
CalendarReceiver.armOrRearmTimer();
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.jens.automation2;
|
package com.jens.automation2;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@ -212,7 +213,7 @@ public class ReceiverCoordinator
|
|||||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.screenState))
|
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.screenState))
|
||||||
ScreenStateReceiver.startScreenStateReceiver(AutomationService.getInstance());
|
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());
|
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())
|
if(!CalendarReceiver.getInstance().isListenerRunning())
|
||||||
CalendarReceiver.getInstance().startListener(AutomationService.getInstance());
|
CalendarReceiver.getInstance().startListener(AutomationService.getInstance());
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
* Fixed: Calendar trigger hidden from Play version
|
* Fixed: Calendar trigger hidden from Play version
|
||||||
* Fixed: Parameters not correctly supplied when starting other apps
|
* 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