From 189c78c837f08f2649f988c9e7e0b75786141bce Mon Sep 17 00:00:00 2001 From: jacques Date: Sat, 9 Jan 2021 11:19:18 +0100 Subject: [PATCH] Add debug code --- .../java/net/foucry/pilldroid/PillDroidJobService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/PillDroidJobService.java b/app/src/main/java/net/foucry/pilldroid/PillDroidJobService.java index 98a430a..dcd450f 100644 --- a/app/src/main/java/net/foucry/pilldroid/PillDroidJobService.java +++ b/app/src/main/java/net/foucry/pilldroid/PillDroidJobService.java @@ -61,12 +61,18 @@ public class PillDroidJobService extends JobService { if (firstMedicament != null) { if (firstMedicament.getPrise() != 0) { - scheduleNotification(); + if(firstMedicament.getStock() < firstMedicament.getAlertThreshold()) { + scheduleNotification(); + } else + { + double dummy = (firstMedicament.getStock() - firstMedicament.getAlertThreshold()); + Log.d(TAG, "no notification scheduled " + dummy); + } } } Log.d(TAG, "Job finished"); - jobFinished(params, false); + jobFinished(params, true); }