diff --git a/app/build.gradle b/app/build.gradle index 2af53193..29123ec9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,7 +24,7 @@ android { minSdkVersion 18 targetSdkVersion 18 versionCode 22 - versionName "0.2.0-alpha9" + versionName "0.2.0-alpha10" buildConfigField "String", "GIT_SHA", "\"${gitSha}\"" buildConfigField "String", "BUILD_TIME", "\"${buildTime}\"" buildConfigField "String", "VERSION_CODENAME", "\"${codeName}\"" diff --git a/app/src/main/java/com/nightscout/android/CollectorService.java b/app/src/main/java/com/nightscout/android/CollectorService.java index 36615a82..96ddce83 100755 --- a/app/src/main/java/com/nightscout/android/CollectorService.java +++ b/app/src/main/java/com/nightscout/android/CollectorService.java @@ -210,7 +210,19 @@ protected G4Download doInBackground(Integer... params) { } long nextUploadTime = Minutes.minutes(2).toStandardDuration().getMillis(); - if (!device.isConnected()) { + + SupportedDevices deviceType = preferences.getDeviceType(); + + if (deviceType == SupportedDevices.DEXCOM_G4) { + try { + driver.open(); + Log.i(TAG, "DEXCOM_G4 was opened for download"); + } catch (IOException e) { + Log.e(TAG, "Unable to open DEXCOM_G4, will keep trying", e); + setNextPoll(nextUploadTime); + return null; + } + } else if (!device.isConnected()) { Log.e(TAG, "Device is not connected"); try { driver.open();