From 5812f610c4c4a39a26c9ba65f43b85d9609de23c Mon Sep 17 00:00:00 2001 From: Navid Date: Sat, 23 Dec 2023 10:26:58 -0500 Subject: [PATCH] Use public shortTxId --- app/src/main/java/com/eveningoutpost/dexdrip/Home.java | 3 ++- .../java/com/eveningoutpost/dexdrip/models/BgReading.java | 4 ++-- .../dexdrip/utilitymodels/NightscoutBatteryDevice.java | 4 ++-- .../com/eveningoutpost/dexdrip/utils/DexCollectionType.java | 5 +++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/Home.java b/app/src/main/java/com/eveningoutpost/dexdrip/Home.java index f29b9c115d..e0a8c51dec 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/Home.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/Home.java @@ -1,6 +1,7 @@ package com.eveningoutpost.dexdrip; import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE; +import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId; import static com.eveningoutpost.dexdrip.models.JoH.msSince; import static com.eveningoutpost.dexdrip.models.JoH.quietratelimit; import static com.eveningoutpost.dexdrip.models.JoH.tsl; @@ -2692,7 +2693,7 @@ private void updateCurrentBgInfoCommon(DexCollectionType collector, TextView not // TODO this logic needed a rework even a year ago, now its a lot more confused with the additional complexity of native mode if (Ob1G5CollectionService.isG5ActiveButUnknownState() && Calibration.latestValid(2).size() < 2) { // TODO use format string - notificationText.setText(String.format(gs(R.string.state_not_currently_known), (Ob1G5StateMachine.usingG6() ? (getTransmitterID().length() < 6 ? "G7" : "G6") : "G5"))); + notificationText.setText(String.format(gs(R.string.state_not_currently_known), (Ob1G5StateMachine.usingG6() ? (shortTxId() ? "G7" : "G6") : "G5"))); showUncalibratedSlope(); } else { diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/models/BgReading.java b/app/src/main/java/com/eveningoutpost/dexdrip/models/BgReading.java index c0e3b9f73a..c2a1afd48f 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/models/BgReading.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/models/BgReading.java @@ -1,10 +1,10 @@ package com.eveningoutpost.dexdrip.models; +import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId; import static com.eveningoutpost.dexdrip.importedlibraries.dexcom.Dex_Constants.TREND_ARROW_VALUES.NOT_COMPUTABLE; import static com.eveningoutpost.dexdrip.importedlibraries.dexcom.Dex_Constants.TREND_ARROW_VALUES.getTrend; import static com.eveningoutpost.dexdrip.calibrations.PluggableCalibration.getCalibrationPluginFromPreferences; import static com.eveningoutpost.dexdrip.calibrations.PluggableCalibration.newCloseSensorData; -import static com.eveningoutpost.dexdrip.services.Ob1G5CollectionService.getTransmitterID; import android.content.Context; import android.content.SharedPreferences; @@ -1123,7 +1123,7 @@ public static synchronized BgReading bgReadingInsertFromG5(double calculated_val bgr.calculated_value = calculated_value; bgr.raw_data = SPECIAL_G5_PLACEHOLDER; // placeholder if (Ob1G5CollectionService.usingG6()) { - if (getTransmitterID().length() < 6) { + if (shortTxId()) { // If using G7 bgr.appendSourceInfo("G7"); } else { bgr.appendSourceInfo("G6 Native"); diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutBatteryDevice.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutBatteryDevice.java index 1f8d598921..164b44180d 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutBatteryDevice.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutBatteryDevice.java @@ -1,7 +1,7 @@ package com.eveningoutpost.dexdrip.utilitymodels; -import static com.eveningoutpost.dexdrip.services.Ob1G5CollectionService.getTransmitterID; +import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId; import android.content.Context; import android.content.Intent; @@ -145,7 +145,7 @@ boolean alwaysSendBattery() { @Override String getDeviceName() { if (Ob1G5StateMachine.usingG6()) { - if (getTransmitterID().length() < 6) { + if (shortTxId()) { // If using G7 return "G7 Device"; } return "G6 Transmitter"; diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utils/DexCollectionType.java b/app/src/main/java/com/eveningoutpost/dexdrip/utils/DexCollectionType.java index dad8ca4b81..5fc20f886c 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utils/DexCollectionType.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utils/DexCollectionType.java @@ -13,7 +13,8 @@ import com.eveningoutpost.dexdrip.cgm.sharefollow.ShareFollowService; import com.eveningoutpost.dexdrip.cgm.webfollow.WebFollowService; import com.eveningoutpost.dexdrip.cgm.carelinkfollow.CareLinkFollowService; -import static com.eveningoutpost.dexdrip.services.Ob1G5CollectionService.getTransmitterID; + +import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId; import java.lang.reflect.Method; import java.util.Collections; @@ -277,7 +278,7 @@ public static String getBestCollectorHardwareName() { return "Network G4 and Classic xDrip"; case DexcomG5: if (Ob1G5CollectionService.usingNativeMode()) { - return Ob1G5CollectionService.usingG6() ? (getTransmitterID().length() < 6 ? "G7" : "G6 Native") : "G5 Native"; + return Ob1G5CollectionService.usingG6() ? (shortTxId() ? "G7" : "G6 Native") : "G5 Native"; } return dct.name(); case LibreWifi: