/** Schedules the notification updater task if it hasn't been scheduled yet. */
 private void setupNotificationUpdater() {
   if (BuildConfig.DEBUG) Log.d(TAG, "Setting up notification updater");
   if (notificationUpdater == null) {
     notificationUpdater = new NotificationUpdater();
     notificationUpdaterFuture =
         schedExecutor.scheduleAtFixedRate(notificationUpdater, 5L, 5L, TimeUnit.SECONDS);
   }
 }
示例#2
0
 public void repeat(Runnable event, long initialDelay, long period) {
   scheduler.scheduleAtFixedRate(event, initialDelay, period, TimeUnit.MILLISECONDS);
 }