public synchronized void startAlert(Context ctx, boolean trendingToAlertEnd, AlertType newAlert, String bgValue , boolean start_snoozed) { 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); long nextAlertTime = newAlert.getNextAlertTime(ctx); ActiveBgAlert.Create(newAlert.uuid, start_snoozed, nextAlertTime); if (!start_snoozed) Vibrate(ctx, newAlert, bgValue, newAlert.override_silent_mode, 0); }
public synchronized void startAlert(Context ctx, boolean trendingToAlertEnd, AlertType newAlert, String bgValue , boolean start_snoozed) { 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); long nextAlertTime = newAlert.getNextAlertTime(ctx); ActiveBgAlert.Create(newAlert.uuid, start_snoozed, nextAlertTime); if (!start_snoozed) VibrateNotifyMakeNoise(ctx, newAlert, bgValue, newAlert.override_silent_mode, 0); AlertTracker.evaluate(); }
public synchronized void startAlert(Context ctx, boolean trendingToAlertEnd, AlertType newAlert, String bgValue , boolean start_snoozed) { 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); long nextAlertTime = newAlert.getNextAlertTime(ctx); ActiveBgAlert.Create(newAlert.uuid, start_snoozed, nextAlertTime); if (!start_snoozed) VibrateNotifyMakeNoise(ctx, newAlert, bgValue, newAlert.override_silent_mode, 0); AlertTracker.evaluate(); }
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, false); // also don't cancel notification int timeFromStartPlaying = activeBgAlert.getUpdatePlayTime(); AlertType alert = AlertType.get_alert(activeBgAlert.alert_uuid); if (alert == null) { Log.d(TAG, "ClockTick: The alert was already deleted... will not play"); ActiveBgAlert.ClearData(); return; } Log.d(TAG,"ClockTick: Playing the alert again"); long nextAlertTime = alert.getNextAlertTime(ctx); activeBgAlert.updateNextAlertAt(nextAlertTime); Vibrate(ctx, alert, bgValue, alert.override_silent_mode, timeFromStartPlaying); } }
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, false); // also don't cancel notification final int minutesFromStartPlaying = activeBgAlert.getAndUpdateAlertingMinutes(); final AlertType alert = AlertType.get_alert(activeBgAlert.alert_uuid); if (alert == null) { Log.d(TAG, "ClockTick: The alert was already deleted... will not play"); ActiveBgAlert.ClearData(); return; } Log.d(TAG,"ClockTick: Playing the alert again"); long nextAlertTime = alert.getNextAlertTime(ctx); activeBgAlert.updateNextAlertAt(nextAlertTime); VibrateNotifyMakeNoise(ctx, alert, bgValue, alert.override_silent_mode, minutesFromStartPlaying); AlertTracker.evaluate(); } }
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, false); // also don't cancel notification final int minutesFromStartPlaying = activeBgAlert.getAndUpdateAlertingMinutes(); final AlertType alert = AlertType.get_alert(activeBgAlert.alert_uuid); if (alert == null) { Log.d(TAG, "ClockTick: The alert was already deleted... will not play"); ActiveBgAlert.ClearData(); return; } Log.d(TAG,"ClockTick: Playing the alert again"); long nextAlertTime = alert.getNextAlertTime(ctx); activeBgAlert.updateNextAlertAt(nextAlertTime); VibrateNotifyMakeNoise(ctx, alert, bgValue, alert.override_silent_mode, minutesFromStartPlaying); AlertTracker.evaluate(); } }