public static boolean alertSnoozeOver() { ActiveBgAlert activeBgAlert = getOnly(); if (activeBgAlert == null) { // no alert exists, so snoozing is over... (this should not happen) Log.wtf(TAG, "ActiveBgAlert getOnly returning null (we have just checked it)"); return true; } return activeBgAlert.ready_to_alarm(); }
public static boolean alertSnoozeOver() { ActiveBgAlert activeBgAlert = getOnly(); if (activeBgAlert == null) { // no alert exists, so snoozing is over... (this should not happen) Log.wtf(TAG, "ActiveBgAlert getOnly returning null (we have just checked it)"); return true; } return activeBgAlert.ready_to_alarm(); }
public static boolean alertSnoozeOver() { ActiveBgAlert activeBgAlert = getOnly(); if (activeBgAlert == null) { // no alert exists, so snoozing is over... (this should not happen) Log.wtf(TAG, "ActiveBgAlert getOnly returning null (we have just checked it)"); return true; } return activeBgAlert.ready_to_alarm(); }
} else { sendRemoteSnooze.setVisibility(View.GONE); if(!aba.ready_to_alarm()) { status = "Active alert exists named \"" + activeBgAlert.name + (aba.is_snoozed?"\" Alert snoozed until ":"\" Alert will rerise at ")
} else { sendRemoteSnooze.setVisibility(View.GONE); if(!aba.ready_to_alarm()) { status = MessageFormat.format("Active alert exists named \"{0}\" {1,choice,0#Alert will rerise at|1#Alert snoozed until} {2,time} ({3} minutes left)", activeBgAlert.name, aba.is_snoozed ? 1 : 0 , new Date(aba.next_alert_at),(aba.next_alert_at - now) / 60000);
} else { sendRemoteSnooze.setVisibility(View.GONE); if(!aba.ready_to_alarm()) { status = MessageFormat.format("Active alert exists named \"{0}\" {1,choice,0#Alert will rerise at|1#Alert snoozed until} {2,time} ({3} minutes left)", activeBgAlert.name, aba.is_snoozed ? 1 : 0 , new Date(aba.next_alert_at),(aba.next_alert_at - now) / 60000);
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(); } }