date time trigger set to wakeup
This commit is contained in:
parent
a21f90acb5
commit
5e3d268815
@ -29,7 +29,7 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
{
|
{
|
||||||
private static AutomationService automationServiceRef;
|
private static AutomationService automationServiceRef;
|
||||||
private static AlarmManager centralAlarmManagerInstance;
|
private static AlarmManager centralAlarmManagerInstance;
|
||||||
private static boolean alarmListenerActive=false;
|
private static boolean alarmListenerActive = false;
|
||||||
private static ArrayList<ScheduleElement> alarmCandidates = new ArrayList<>();
|
private static ArrayList<ScheduleElement> alarmCandidates = new ArrayList<>();
|
||||||
private static ArrayList<Integer> requestCodeList = new ArrayList<Integer>();
|
private static ArrayList<Integer> requestCodeList = new ArrayList<Integer>();
|
||||||
static PendingIntent alarmPendingIntent = null;
|
static PendingIntent alarmPendingIntent = null;
|
||||||
@ -250,6 +250,9 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
|
|||||||
else
|
else
|
||||||
alarmPendingIntent = PendingIntent.getBroadcast(automationServiceRef, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
alarmPendingIntent = PendingIntent.getBroadcast(automationServiceRef, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||||
|
centralAlarmManagerInstance.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, scheduleCandidate.time.getTimeInMillis(), alarmPendingIntent);
|
||||||
|
else
|
||||||
centralAlarmManagerInstance.set(AlarmManager.RTC_WAKEUP, scheduleCandidate.time.getTimeInMillis(), alarmPendingIntent);
|
centralAlarmManagerInstance.set(AlarmManager.RTC_WAKEUP, scheduleCandidate.time.getTimeInMillis(), alarmPendingIntent);
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("E dd.MM.yyyy HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("E dd.MM.yyyy HH:mm:ss");
|
||||||
|
Loading…
Reference in New Issue
Block a user