コード例 #1
0
ファイル: AlertPlayer.java プロジェクト: bklinker/NightWatch
 public synchronized void PreSnooze(Context ctx, String uuid, int repeatTime) {
   Log.i(TAG, "PreSnooze called repeatTime = " + repeatTime);
   stopAlert(ctx, true, false);
   ActiveBgAlert.Create(uuid, true, new Date().getTime() + repeatTime * 60000);
   ActiveBgAlert activeBgAlert = ActiveBgAlert.getOnly();
   if (activeBgAlert == null) {
     Log.wtf(TAG, "Just created the alert, where did it go...");
     return;
   }
   activeBgAlert.snooze(repeatTime);
 }
コード例 #2
0
ファイル: AlertPlayer.java プロジェクト: bklinker/NightWatch
  public synchronized void startAlert(
      Context ctx, boolean trendingToAlertEnd, AlertType newAlert, String bgValue) {
    Log.d(TAG, "startAlert called, Threadid " + Thread.currentThread().getId());
    if (trendingToAlertEnd) {
      Log.d(TAG, "startAlert: This alert is trending to it's end will not do anything");
      return;
    }

    stopAlert(ctx, true, false);
    int alertIn = newAlert.minutes_between;
    if (alertIn < 1) {
      alertIn = 1;
    }
    ActiveBgAlert.Create(newAlert.uuid, false, new Date().getTime() + alertIn * 60000);
    Vibrate(ctx, newAlert, bgValue, newAlert.override_silent_mode, 0);
  }