private static AlertType filter_alert_on_stale(AlertType alert, SharedPreferences prefs) { // this should already be happening in notifications.java but it doesn't seem to work so adding here as well if (prefs.getBoolean("disable_alerts_stale_data", false)) { final int stale_minutes = Math.max(6, Integer.parseInt(prefs.getString("disable_alerts_stale_data_minutes", "15")) + 2); if (!BgReading.last_within_minutes(stale_minutes)) { Log.w(TAG, "Blocking alarm raise as data older than: " + stale_minutes); return null; // block } } return alert; // allow }
private static AlertType filter_alert_on_stale(AlertType alert, SharedPreferences prefs) { // this should already be happening in notifications.java but it doesn't seem to work so adding here as well if (prefs.getBoolean("disable_alerts_stale_data", false)) { final int stale_minutes = Math.max(6, Integer.parseInt(prefs.getString("disable_alerts_stale_data_minutes", "15")) + 2); if (!BgReading.last_within_minutes(stale_minutes)) { Log.w(TAG, "Blocking alarm raise as data older than: " + stale_minutes); return null; // block } } return alert; // allow }
private static AlertType filter_alert_on_stale(AlertType alert, SharedPreferences prefs) { // this should already be happening in notifications.java but it doesn't seem to work so adding here as well if (prefs.getBoolean("disable_alerts_stale_data", false)) { final int stale_minutes = Math.max(6, Integer.parseInt(prefs.getString("disable_alerts_stale_data_minutes", "15")) + 2); if (!BgReading.last_within_minutes(stale_minutes)) { Log.w(TAG, "Blocking alarm raise as data older than: " + stale_minutes); return null; // block } } return alert; // allow }