urbanairship-core/src/main/java/com/urbanairship/automation/AutomationEngine.java
@WorkerThread
    private void subscribeStateObservables(final ScheduleEntry entry, final long lastStateChangeTime) {
        Observable.from(COMPOUND_TRIGGER_TYPES)
                  .filter(new Predicate<Integer>() {
                      @Override
                      public boolean apply(Integer triggerType) {
                          if (stateChangeTimeStamps.get(triggerType, startTime) <= lastStateChangeTime) {
                              return false;
                          }

                          for (TriggerEntry triggerEntry : entry.triggerEntries) {
                              if (triggerEntry.type == triggerType) {
                                  return true;
                              }
                          }
                          return false;
                      }
                  })
                  .flatMap(new Function<Integer, Observable<TriggerUpdate>>() {
                      @Override
                      public Observable<TriggerUpdate> apply(final Integer type) {
                          return createStateObservable(type)
                                  .observeOn(backgroundScheduler)
                                  .map(new Function<JsonSerializable, TriggerUpdate>() {
                                      @Override
                                      public TriggerUpdate apply(JsonSerializable json) {
                                          return new TriggerUpdate(dataManager.getActiveTriggerEntries(type, entry.scheduleId), json, 1.0);
                                      }
                                  });
                      }
                  })
                  .subscribe(new Subscriber<TriggerUpdate>() {
                      @Override
                      public void onNext(TriggerUpdate value) {
                          stateObservableUpdates.onNext(value);
                      }
                  });
    }
/**
     * Subscribes a schedule entry for state updates to any compound triggers
     *
     * @param entry The schedule entry.
     * @param lastStateChangeTime A timestamp to filter out state triggers. Only state changes that happened
     * after the lastStateChangeTime will update the entry's triggers.
     */
Subscribes a schedule entry for state updates to any compound triggers
@param entry The schedule entry.
@param lastStateChangeTime A timestamp to filter out state triggers. Only state changes that happened
after the lastStateChangeTime will update the entry's triggers.
Subscribes a schedule entry for state updates to any compound triggers @param entry The schedule entry . @param lastStateChangeTime A timestamp to filter out state triggers . Only state changes that happened after the lastStateChangeTime will update the entry ' s triggers .
@WorkerThread
    private void subscribeStateObservables(final ScheduleEntry entry, final long lastStateChangeTime) {
        Observable.from(COMPOUND_TRIGGER_TYPES)
                  .filter(new Predicate<Integer>() {
                      @Override
                      public boolean apply(Integer triggerType) {
                          if (stateChangeTimeStamps.get(triggerType, startTime) <= lastStateChangeTime) {
                              return false;
                          }
                          for (TriggerEntry triggerEntry : entry.triggerEntries) {
                              if (triggerEntry.type == triggerType) {
                                  return true;
                              }
                          }
                          return false;
                      }
                  })
                  .flatMap(new Function<Integer, Observable<TriggerUpdate>>() {
                      @Override
                      public Observable<TriggerUpdate> apply(final Integer type) {
                          return createStateObservable(type)
                                  .observeOn(backgroundScheduler)
                                  .map(new Function<JsonSerializable, TriggerUpdate>() {
                                      @Override
                                      public TriggerUpdate apply(JsonSerializable json) {
                                          return new TriggerUpdate(dataManager.getActiveTriggerEntries(type, entry.scheduleId), json, 1.0);
                                      }
                                  });
                      }
                  })
                  .subscribe(new Subscriber<TriggerUpdate>() {
                      @Override
                      public void onNext(TriggerUpdate value) {
                          stateObservableUpdates.onNext(value);
                      }
                  });
    }
@ WorkerThread private void subscribeStateObservables ( final ScheduleEntry entry , final long lastStateChangeTime ) { Observable . from ( COMPOUND_TRIGGER_TYPES ) . filter ( new Predicate < Integer > ( ) { @ Override public boolean apply ( Integer triggerType ) { if ( stateChangeTimeStamps . get ( triggerType , startTime ) <= lastStateChangeTime ) { return false ; } for ( TriggerEntry triggerEntry : entry . triggerEntries ) { if ( triggerEntry . type == triggerType ) { return true ; } } return false ; } } ) . flatMap ( new Function < Integer , Observable < TriggerUpdate > > ( ) { @ Override public Observable < TriggerUpdate > apply ( final Integer type ) { return createStateObservable ( type ) . observeOn ( backgroundScheduler ) . map ( new Function < JsonSerializable , TriggerUpdate > ( ) { @ Override public TriggerUpdate apply ( JsonSerializable json ) { return new TriggerUpdate ( dataManager . getActiveTriggerEntries ( type , entry . scheduleId ) , json , 1.0 ) ; } } ) ; } } ) . subscribe ( new Subscriber < TriggerUpdate > ( ) { @ Override public void onNext ( TriggerUpdate value ) { stateObservableUpdates . onNext ( value ) ; } } ) ; }
Subscribes a schedule entry for state updates to any compound triggers
 @param entry The schedule entry.
Subscribes a schedule entry for state updates to any compound triggers @param entry The schedule entry .