diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/alert/SensorExpiry.java b/app/src/main/java/com/eveningoutpost/dexdrip/alert/SensorExpiry.java index dcd1f455d..f7271a52c 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/alert/SensorExpiry.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/alert/SensorExpiry.java @@ -41,7 +41,7 @@ public SensorExpiry() { @Override public boolean activate() { - val expiry = niceTimeScalarNatural(SensorDays.get().getRemainingSensorPeriodInMs()); + val expiry = niceTimeScalarNatural(SensorDays.get().getRemainingSensorPeriodInMs(), 1); val notificationId = SENSORY_EXPIRY_NOTIFICATION_ID; cancelNotification(notificationId); val expireMsg = String.format("Sensor will expire in %s", expiry); // TODO i18n and format string diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/models/JoH.java b/app/src/main/java/com/eveningoutpost/dexdrip/models/JoH.java index 584cea0e3..84114994d 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/models/JoH.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/models/JoH.java @@ -809,14 +809,18 @@ public static String niceTimeScalar(double t, int digits) { } - public static String niceTimeScalarNatural(long t) { + public static String niceTimeScalarNatural(long t) { // Shows the integer part only when less than 1 day. + return niceTimeScalarNatural(t, 0); + } + + public static String niceTimeScalarNatural(long t, int h_digits) { // Rounds down to the defined number of decimal points when less than 1 day. if (t > 3000000) t = t + 10000; // round up by 10 seconds if nearly an hour if ((t > Constants.DAY_IN_MS) && (t < Constants.WEEK_IN_MS * 2)) { final SimpleDateFormat df = new SimpleDateFormat("EEEE", Locale.getDefault()); final String day = df.format(new Date(JoH.tsl() + t)); return ((t > Constants.WEEK_IN_MS) ? "next " : "") + day; } else { - return niceTimeScalar(t); + return niceTimeScalar(t, h_digits); } } diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/services/Ob1G5CollectionService.java b/app/src/main/java/com/eveningoutpost/dexdrip/services/Ob1G5CollectionService.java index 2c843592e..ccfa545f5 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/services/Ob1G5CollectionService.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/services/Ob1G5CollectionService.java @@ -1785,7 +1785,7 @@ public void instantCreateBondIfAllowed() { private boolean getInitiateBondingFlag() { - return Pref.getBoolean("ob1_initiate_bonding_flag", true); + return true; // There is no reason not to initiate bonding } diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/IdempotentMigrations.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/IdempotentMigrations.java index a9803735e..65c0c5776 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/IdempotentMigrations.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/IdempotentMigrations.java @@ -151,6 +151,7 @@ private static void legacySettingsFix() { Pref.setBoolean("always_get_new_keys", true); Pref.setBoolean("run_ble_scan_constantly", false); Pref.setBoolean("run_G5_ble_tasks_on_uithread", false); + Pref.setBoolean("ob1_initiate_bonding_flag", true); } private static void legacySettingsMoveLanguageFromNoToNb() { // Check if the user's language preference is set to "no" diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/Notifications.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/Notifications.java index 12500de83..ce7d28e1e 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/Notifications.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/Notifications.java @@ -651,6 +651,8 @@ public synchronized Notification createOngoingNotification(BgGraphBuilder bgGrap if (lastReading != null) { b.setWhen(lastReading.timestamp); + b.setShowWhen(true); + final SpannableString deltaString = new SpannableString("Delta: " + ((dg != null) ? (dg.spannableString(dg.unitized_delta + (dg.from_plugin ? " "+context.getString(R.string.p_in_circle) : ""))) : bgGraphBuilder.unitizedDeltaString(true, true))); diff --git a/app/src/main/res/xml/pref_data_source.xml b/app/src/main/res/xml/pref_data_source.xml index 07ef37e6e..b5495d3fe 100644 --- a/app/src/main/res/xml/pref_data_source.xml +++ b/app/src/main/res/xml/pref_data_source.xml @@ -400,12 +400,6 @@ android:key="ob1_special_pairing_workaround" android:summary="Some Samsung devices can have an error where they lose the pairing information. This attempts to work around the issue." android:title="@string/special_pairing_workaround" /> -