- changed build file

- some changes to RileyLinkBLE to handle displaying Error
- loadSessionState from util used
- remove driver specific identifier functionality from RileyLinkService
This commit is contained in:
Andy Rozman 2020-05-09 12:03:17 +01:00
parent e2e4c6a17f
commit d177e08355
5 changed files with 14 additions and 46 deletions

View file

@ -139,8 +139,8 @@ android {
// OMNIPOD: Keep track of what commit from the main repository we're on, these fields aren't actually used anywhere
buildConfigField "String", "DEV_VERSION", '"2.6.5-dev"'
buildConfigField "String", "DEV_VERSION_COMMIT", '"b87155ead499167b3d42a73e3daf808494f10a2d"'
buildConfigField "String", "DEV_VERSION_COMMIT_DATE", '"24.4.2020"' // 24th April
buildConfigField "String", "DEV_VERSION_COMMIT", '"cf291b3adc2a8df06fd99220b59b500298c8e56f"'
buildConfigField "String", "DEV_VERSION_COMMIT_DATE", '"6.5.2020"' // 6th May
ndk {
moduleName "BleCommandUtil"

View file

@ -152,8 +152,8 @@ public class RileyLinkBLE {
} else if ((newState == BluetoothProfile.STATE_CONNECTING) || //
(newState == BluetoothProfile.STATE_DISCONNECTING)) {
// aapsLogger.debug(LTag.PUMPBTCOMM,"We are in {} state.", status == BluetoothProfile.STATE_CONNECTING ? "Connecting" :
// "Disconnecting");
aapsLogger.debug(LTag.PUMPBTCOMM,"We are in {} state.", status == BluetoothProfile.STATE_CONNECTING ? "Connecting" :
"Disconnecting");
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnected, context);
if (manualDisconnect)
@ -243,8 +243,6 @@ public class RileyLinkBLE {
if (rileyLinkFound) {
mIsConnected = true;
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkReady, context);
// RileyLinkUtil.sendNotification(new
// ServiceNotification(RileyLinkConst.Intents.RileyLinkReady), null);
} else {
mIsConnected = false;
rileyLinkServiceData.setServiceState(RileyLinkServiceState.RileyLinkError,
@ -273,7 +271,6 @@ public class RileyLinkBLE {
if (isAnyRileyLinkServiceFound(serviceI)) {
return true;
}
}
}
@ -433,6 +430,7 @@ public class RileyLinkBLE {
// Catch if the service is not supported by the BLE device
rval.resultCode = BLECommOperationResult.RESULT_NONE;
aapsLogger.error(LTag.PUMPBTCOMM, "BT Device not supported");
rileyLinkServiceData.setServiceState(RileyLinkServiceState.BluetoothError, RileyLinkError.NoBluetoothAdapter);
// TODO: 11/07/2016 UI update for user
} else {
BluetoothGattCharacteristic chara = bluetoothConnectionGatt.getService(serviceUUID)

View file

@ -114,21 +114,6 @@ public abstract class RileyLinkService extends DaggerService {
}
/**
* Prefix for Device specific broadcast identifier prefix (for example MSG_PUMP_ for pump or
* MSG_POD_ for Omnipod)
*
* @return
*/
public abstract String getDeviceSpecificBroadcastsIdentifierPrefix();
public abstract boolean handleDeviceSpecificBroadcasts(Intent intent);
public abstract void registerDeviceSpecificBroadcasts(IntentFilter intentFilter);
public abstract RileyLinkCommunicationManager getDeviceCommunicationManager();
// Here is where the wake-lock begins:

View file

@ -34,7 +34,7 @@ public class RileyLinkServiceData {
public RileyLinkError rileyLinkError;
public RileyLinkServiceState rileyLinkServiceState = RileyLinkServiceState.NotStarted;
public RileyLinkFirmwareVersion firmwareVersion;
public RileyLinkTargetFrequency rileyLinkTargetFrequency;
public RileyLinkTargetFrequency rileyLinkTargetFrequency; // TODO this might not be correct place
public String rileylinkAddress;
long lastTuneUpTime = 0L;
@ -45,7 +45,7 @@ public class RileyLinkServiceData {
// radio version
public RileyLinkFirmwareVersion versionCC110;
public RileyLinkTargetDevice targetDevice;
public RileyLinkTargetDevice targetDevice; // TODO this might not be correct place
// Medtronic Pump
public String pumpID;

View file

@ -115,12 +115,13 @@ public class RileyLinkOmnipodService extends RileyLinkService {
PodSessionState podState = null;
if (sp.contains(OmnipodConst.Prefs.PodState) && omnipodUtil.getPodSessionState() == null) {
try {
Gson gson = omnipodUtil.getGsonInstance();
String storedPodState = sp.getString(OmnipodConst.Prefs.PodState, "");
aapsLogger.info(LTag.PUMPCOMM, "PodSessionState-SP: loaded from SharedPreferences: " + storedPodState);
podState = gson.fromJson(storedPodState, PodSessionState.class);
podState.injectDaggerClass(injector);
omnipodUtil.setPodSessionState(podState);
omnipodUtil.loadSessionState();
// Gson gson = omnipodUtil.getGsonInstance();
// String storedPodState = sp.getString(OmnipodConst.Prefs.PodState, "");
// aapsLogger.info(LTag.PUMPCOMM, "PodSessionState-SP: loaded from SharedPreferences: " + storedPodState);
// podState = gson.fromJson(storedPodState, PodSessionState.class);
// podState.injectDaggerClass(injector);
// omnipodUtil.setPodSessionState(podState);
} catch (Exception ex) {
aapsLogger.error(LTag.PUMPCOMM, "Could not deserialize Pod state", ex);
}
@ -178,22 +179,6 @@ public class RileyLinkOmnipodService extends RileyLinkService {
}
@Override
public String getDeviceSpecificBroadcastsIdentifierPrefix() {
return null;
}
public boolean handleDeviceSpecificBroadcasts(Intent intent) {
return false;
}
@Override
public void registerDeviceSpecificBroadcasts(IntentFilter intentFilter) {
}
public boolean verifyConfiguration() {
try {
omnipodPumpStatus.errorDescription = "-";