Ejemplo n.º 1
0
  public void dispatch(List list) {
    Dispatchable dispatchable;
    for (Iterator iterator = a.keySet().iterator();
        iterator.hasNext();
        dispatchable.start(e, (String) a.get(dispatchable))) {
      dispatchable = (Dispatchable) iterator.next();
    }

    d.clear();
    int i = EventUtils.getDatabaseIndexFromTime(System.currentTimeMillis());
    int j = 0;
    label0:
    do {
      label1:
      {
        if (j < 7) {
          if (--i < 0) {
            i += 7;
          }
          if (SysUtils.isWifiConnected(e) && EventUtils.enableWrite(e)) {
            break label1;
          }
        }
        d.end();
        for (Iterator iterator1 = a.keySet().iterator();
            iterator1.hasNext();
            ((Dispatchable) iterator1.next()).stop()) {}
        break label0;
      }
      String s = EventUtils.getDatabaseName(i);
      if (databaseExist(e, s)) {
        a(s, list);
      }
      j++;
    } while (true);
  }
Ejemplo n.º 2
0
 private void a(String s, List list) {
   c.open(e, s);
   Iterator iterator = c.readEvents(null, list).iterator();
   do {
     Event event;
     Policy policy;
     label0:
     {
       if (iterator.hasNext()) {
         event = (Event) iterator.next();
         policy = d.getPolicy(event.getPolicy());
         if (policy == null) {
           continue;
         }
         if (SysUtils.isWifiConnected(e) && EventUtils.enableWrite(e)) {
           break label0;
         }
       }
       c.close();
       return;
     }
     policy.execute(event);
   } while (true);
 }