Exemple #1
0
 public synchronized void Snooze(Context ctx, int repeatTime) {
   Log.i(TAG, "Snooze called repeatTime = " + repeatTime);
   stopAlert(ctx, false, false);
   ActiveBgAlert activeBgAlert = ActiveBgAlert.getOnly();
   if (activeBgAlert == null) {
     Log.w(
         TAG,
         "Error, snooze was called but no alert is active. alert was probably removed in ui ");
     return;
   }
   activeBgAlert.snooze(repeatTime);
 }
Exemple #2
0
  // Check the state and alrarm if needed
  public void ClockTick(Context ctx, boolean trendingToAlertEnd, String bgValue) {
    if (trendingToAlertEnd) {
      Log.d(TAG, "ClockTick: This alert is trending to it's end will not do anything");
      return;
    }
    ActiveBgAlert activeBgAlert = ActiveBgAlert.getOnly();
    if (activeBgAlert == null) {
      // Nothing to do ...
      return;
    }
    if (activeBgAlert.ready_to_alarm()) {
      stopAlert(ctx, false, false);

      int timeFromStartPlaying = activeBgAlert.getUpdatePlayTime();
      AlertType alert = AlertType.get_alert(activeBgAlert.alert_uuid);
      if (alert == null) {
        Log.w(TAG, "ClockTick: The alert was already deleted... will not play");
        ActiveBgAlert.ClearData();
        return;
      }
      Log.d(TAG, "ClockTick: Playing the alert again");
      Vibrate(ctx, alert, bgValue, alert.override_silent_mode, timeFromStartPlaying);
    }
  }