diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OHUploadWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OHUploadWorker.kt index edabdce0f5..71b6b41850 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OHUploadWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OHUploadWorker.kt @@ -42,7 +42,7 @@ class OHUploadWorker(context: Context, workerParameters: WorkerParameters) val isConnectedToWifi = wifiManager?.isWifiEnabled ?: false && wifiManager?.connectionInfo?.networkId != -1 if (!wifiOnly || (wifiOnly && isConnectedToWifi)) { setForegroundAsync(createForegroundInfo()) - openHumansUploader.uploadData().delay(12, TimeUnit.MINUTES) //TODO OH: No Delay + openHumansUploader.uploadData().delay(12, TimeUnit.MINUTES) .andThen(Single.just(Result.success())) .onErrorResumeNext { Single.just(Result.retry()) } } else { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt index a24c0f9538..a6463ef518 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt @@ -382,7 +382,7 @@ class OpenHumansUploader @Inject constructor( .map { enqueueTempTarget(it); increaseCounter() } .ignoreElements() .doOnSubscribe { - wakeLock.acquire(TimeUnit.MINUTES.toMillis(20)) + wakeLock.acquire(TimeUnit.MINUTES.toMillis(30)) showOngoingNotification() } .doOnComplete { @@ -595,9 +595,9 @@ class OpenHumansUploader @Inject constructor( .setRequiredNetworkType(NetworkType.CONNECTED) .setRequiresCharging(sp.getBoolean("key_oh_charging_only", false)) .build() - val workRequest = PeriodicWorkRequestBuilder(1, TimeUnit.MINUTES) // TODO OH: DAYS + val workRequest = PeriodicWorkRequestBuilder(1, TimeUnit.DAYS) .setConstraints(constraints) - .setBackoffCriteria(BackoffPolicy.LINEAR, 1, TimeUnit.MINUTES) //TODO OH: HOURS + .setBackoffCriteria(BackoffPolicy.LINEAR, 20, TimeUnit.MINUTES) .build() WorkManager.getInstance(context).enqueueUniquePeriodicWork(WORK_NAME, if (replace) ExistingPeriodicWorkPolicy.REPLACE else ExistingPeriodicWorkPolicy.KEEP, workRequest) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 28110a0afb..5469404513 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1409,7 +1409,7 @@ Open Humans Finishing Open Humans setup… - This may take a while. Do not turn your phone off. + This may take a while. Do not turn your phone or this plugin off. Setup finished Your phone will upload data to Open Humans soon. Your phone is uploading data to Open Humans now.