Skip to content

Commit e659dbc

Browse files
committed
OB1: improve persistence
1 parent dcca107 commit e659dbc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ private static void handleAuthenticationThrowable(final Throwable throwable, fin
381381
}
382382
if ((throwable instanceof BleDisconnectedException) || (throwable instanceof TimeoutException)) {
383383
if ((parent.getState() == Ob1G5CollectionService.STATE.BOND) || (parent.getState() == Ob1G5CollectionService.STATE.CHECK_AUTH)) {
384-
384+
parent.savePersist();
385385
if (parent.getState() == Ob1G5CollectionService.STATE.BOND) {
386386
UserError.Log.d(TAG, "SLEEPING BEFORE RECONNECT");
387387
threadSleep(15000);

app/src/main/java/com/eveningoutpost/dexdrip/services/Ob1G5CollectionService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,12 +995,15 @@ public synchronized void savePersist() {
995995
}
996996

997997
public static void clearPersistStore() {
998-
PersistentStore.removeItem(KEKS_ONE + transmitterMAC);
998+
PersistentStore.cleanupOld(KEKS_ONE);
999+
PersistentStore.cleanupOld(OB1G5_MACSTORE);
9991000
}
10001001

10011002
public static void clearPersist() {
10021003
clearPersistStore();
10031004
expireFailures(true);
1005+
transmitterID = null;
1006+
transmitterMAC = null;
10041007
}
10051008

10061009
private void scheduleWakeUp(long future, final String info) {

0 commit comments

Comments
 (0)