urbanairship-core/src/main/java/com/urbanairship/automation/AutomationEngine.java
@WorkerThread
    private void scheduleIntervalAlarm(ScheduleEntry scheduleEntry, long interval) {
        final ScheduleOperation operation = new ScheduleOperation(scheduleEntry.scheduleId, scheduleEntry.group) {
            @Override
            protected void onRun() {
                ScheduleEntry scheduleEntry = dataManager.getScheduleEntry(scheduleId);
                if (scheduleEntry == null || scheduleEntry.getExecutionState() != ScheduleEntry.STATE_PAUSED) {
                    return;
                }

                // Expired
                if (scheduleEntry.isExpired()) {
                    handleExpiredEntry(scheduleEntry);
                    return;
                }

                long pauseStartTime = scheduleEntry.getExecutionStateChangeDate();

                // Paused => Idle
                scheduleEntry.setExecutionState(ScheduleEntry.STATE_IDLE);
                dataManager.saveSchedule(scheduleEntry);

                subscribeStateObservables(scheduleEntry, pauseStartTime);
            }
        };

        operation.addOnRun(new Runnable() {
            @Override
            public void run() {
                pendingAlarmOperations.remove(operation);
            }
        });

        pendingAlarmOperations.add(operation);
        scheduler.schedule(interval, operation);
    }
/**
     * Schedules an interval alarm for a schedule.
     *
     * @param scheduleEntry The schedule entry.
     * @param interval The interval in milliseconds.
     */
Schedules an interval alarm for a schedule.
@param scheduleEntry The schedule entry.
@param interval The interval in milliseconds.
Schedules an interval alarm for a schedule . @param scheduleEntry The schedule entry . @param interval The interval in milliseconds .
@WorkerThread
    private void scheduleIntervalAlarm(ScheduleEntry scheduleEntry, long interval) {
        final ScheduleOperation operation = new ScheduleOperation(scheduleEntry.scheduleId, scheduleEntry.group) {
            @Override
            protected void onRun() {
                ScheduleEntry scheduleEntry = dataManager.getScheduleEntry(scheduleId);
                if (scheduleEntry == null || scheduleEntry.getExecutionState() != ScheduleEntry.STATE_PAUSED) {
                    return;
                }
                if (scheduleEntry.isExpired()) {
                    handleExpiredEntry(scheduleEntry);
                    return;
                }
                long pauseStartTime = scheduleEntry.getExecutionStateChangeDate();
                scheduleEntry.setExecutionState(ScheduleEntry.STATE_IDLE);
                dataManager.saveSchedule(scheduleEntry);
                subscribeStateObservables(scheduleEntry, pauseStartTime);
            }
        };
        operation.addOnRun(new Runnable() {
            @Override
            public void run() {
                pendingAlarmOperations.remove(operation);
            }
        });
        pendingAlarmOperations.add(operation);
        scheduler.schedule(interval, operation);
    }
@ WorkerThread private void scheduleIntervalAlarm ( ScheduleEntry scheduleEntry , long interval ) { final ScheduleOperation operation = new ScheduleOperation ( scheduleEntry . scheduleId , scheduleEntry . group ) { @ Override protected void onRun ( ) { ScheduleEntry scheduleEntry = dataManager . getScheduleEntry ( scheduleId ) ; if ( scheduleEntry == null || scheduleEntry . getExecutionState ( ) != ScheduleEntry . STATE_PAUSED ) { return ; } if ( scheduleEntry . isExpired ( ) ) { handleExpiredEntry ( scheduleEntry ) ; return ; } long pauseStartTime = scheduleEntry . getExecutionStateChangeDate ( ) ; scheduleEntry . setExecutionState ( ScheduleEntry . STATE_IDLE ) ; dataManager . saveSchedule ( scheduleEntry ) ; subscribeStateObservables ( scheduleEntry , pauseStartTime ) ; } } ; operation . addOnRun ( new Runnable ( ) { @ Override public void run ( ) { pendingAlarmOperations . remove ( operation ) ; } } ) ; pendingAlarmOperations . add ( operation ) ; scheduler . schedule ( interval , operation ) ; }
Schedules an interval alarm for a schedule.
Schedules an interval alarm for a schedule .
// Expired // Paused => Idle