Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/NightscoutFoundation/xDrip
Browse files Browse the repository at this point in the history
…into workingt:1107
  • Loading branch information
jamorham committed Nov 7, 2016
2 parents 97f98ae + a384fec commit a3f32d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ protected void onCreate(Bundle savedInstanceState) {
endHour = AlertType.time2Hours(endMinutes);
endMinute = AlertType.time2Minutes(endMinutes);
bgMissedMinutes.setText(prefs.getString("bg_missed_minutes", "30"));
int defaultSnooze = MissedReadingService.readPerfsInt(prefs, "other_alerts_snooze", 20);
bgMissedSnoozeMin.setText(prefs.getString("bg_missed_alerts_snooze", "" + defaultSnooze));
bgMissedSnoozeMin.setText("" + MissedReadingService.getOtherAlertSnoozeMinutes(prefs, "bg_missed_alerts"));
bgMissedReraiseSec.setText(prefs.getString("bg_missed_alerts_reraise_sec", "60"));

addListenerOnButtons();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,14 @@ static public long getOtherAlertReraiseSec(Context context, String alertName) {
if(enableAlertsReraise) {
return readPerfsInt(prefs, alertName + "_reraise_sec", 60);
} else {
int defaultSnooze = readPerfsInt(prefs, "other_alerts_snooze", 20);
return 60 * readPerfsInt(prefs, alertName + "_snooze", defaultSnooze);
return 60 * getOtherAlertSnoozeMinutes(prefs, alertName);
}

}

static public long getOtherAlertSnoozeMinutes(SharedPreferences prefs, String alertName) {
int defaultSnooze = readPerfsInt(prefs, "other_alerts_snooze", 20);
return readPerfsInt(prefs, alertName + "_snooze", defaultSnooze);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ private void snoozeBgAlert() {

private void snoozeOtherAlert(String alertType) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
int snoozeMinutes = MissedReadingService.readPerfsInt(prefs, "other_alerts_snooze", 20);
long snoozeMinutes = MissedReadingService.getOtherAlertSnoozeMinutes(prefs, alertType);
Log.i(TAG, "snoozeOtherAlert calling snooze alert alert = " + alertType + " snoozeMinutes = " + snoozeMinutes);
UserNotification.snoozeAlert(alertType, snoozeMinutes);
}
}

0 comments on commit a3f32d9

Please sign in to comment.