Skip to content

Commit

Permalink
Use public shortTxId
Browse files Browse the repository at this point in the history
  • Loading branch information
Navid200 committed Dec 23, 2023
1 parent 1212e75 commit 5812f61
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/com/eveningoutpost/dexdrip/Home.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5812f61

Please sign in to comment.