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 e9f3b4f61..b23f9fe0a 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/services/Ob1G5CollectionService.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/services/Ob1G5CollectionService.java @@ -1970,7 +1970,13 @@ public static boolean usingNativeMode() { } public static boolean onlyUsingNativeMode() { - return usingNativeMode() && !fallbackToXdripAlgorithm(); + return (usingNativeMode() && !fallbackToXdripAlgorithm()) + || usingMockPreCalibrated(); + } + + public static boolean usingMockPreCalibrated() { + return Pref.getBooleanDefaultFalse("fake_data_pre_calibrated") + && DexCollectionType.getDexCollectionType() == DexCollectionType.Mock; } public static boolean isProvidingNativeGlucoseData() { diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/services/WixelReader.java b/app/src/main/java/com/eveningoutpost/dexdrip/services/WixelReader.java index dd2c8625e..9af389689 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/services/WixelReader.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/services/WixelReader.java @@ -137,6 +137,9 @@ private static List readFake() { trd.CaptureDateTime = System.currentTimeMillis() - trd.RelativeTime; final List l = new ArrayList<>(); l.add(trd); + if (Ob1G5CollectionService.usingMockPreCalibrated()) { + BgReading.bgReadingInsertFromG5(trd.RawValue / 1000.0, trd.getCaptureDateTime(), "Mock"); + } return l; } diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/VoiceCommands.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/VoiceCommands.java index 1abefc67f..a6bf4caba 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/VoiceCommands.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/VoiceCommands.java @@ -46,6 +46,13 @@ public static void processVoiceCommand(final String allWords, final Activity mAc Pref.setString(DexCollectionType.DEX_COLLECTION_METHOD, DexCollectionType.Mock.toString()); JoH.static_toast_long("YOU ARE NOW USING FAKE DATA!!!"); MockDataSource.defaults(); + CollectionServiceStarter.restartCollectionServiceBackground(); + } else if (get_engineering_mode() && allWords.equals("fake data source automatic calibration")) { + Pref.setBoolean("fake_data_pre_calibrated", true); + JoH.static_toast_long("Fake data pre-calibration ON"); + } else if (get_engineering_mode() && allWords.equals("fake data source manual calibration")) { + Pref.setBoolean("fake_data_pre_calibrated", false); + JoH.static_toast_long("Fake data pre-calibration OFF"); } else if (get_engineering_mode() && allWords.equals("break fake data source")) { JoH.static_toast_long("Breaking fake data source"); MockDataSource.breakRaw();