From fa4cf31cf49fc8bca622889e19bd4d913f9bd824 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 7 Dec 2016 01:22:47 +0100 Subject: [PATCH 1/2] Correct db query --- .../java/info/nightscout/androidaps/db/DatabaseHelper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java index 4717f6e237..faafbb39fc 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -196,8 +196,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { QueryBuilder queryBuilder = daoBgreadings.queryBuilder(); queryBuilder.orderBy("timeIndex", true); Where where = queryBuilder.where(); - where.ge("timeIndex", mills); - queryBuilder.where().gt("value", 38); + where.ge("timeIndex", mills).and().gt("value", 38); PreparedQuery preparedQuery = queryBuilder.prepare(); bgReadings = daoBgreadings.query(preparedQuery); return bgReadings; From fdd594358ce7e1095cc4e6ba85638f3f81c436a3 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 8 Dec 2016 14:28:21 +0100 Subject: [PATCH 2/2] fix removeExpired in notifications --- .../androidaps/plugins/Overview/NotificationStore.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/NotificationStore.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/NotificationStore.java index 10c86ad2a2..09a5f6e0b4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/NotificationStore.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/NotificationStore.java @@ -54,6 +54,7 @@ public class NotificationStore { Notification n = get(i); if (n.validTo.getTime() != 0 && n.validTo.getTime() < new Date().getTime()) { store.remove(i); + i--; } } }