cleanup
This commit is contained in:
parent
ae980e12f4
commit
02f85398d7
3 changed files with 5 additions and 5 deletions
|
@ -42,7 +42,7 @@ class OHUploadWorker(context: Context, workerParameters: WorkerParameters)
|
||||||
val isConnectedToWifi = wifiManager?.isWifiEnabled ?: false && wifiManager?.connectionInfo?.networkId != -1
|
val isConnectedToWifi = wifiManager?.isWifiEnabled ?: false && wifiManager?.connectionInfo?.networkId != -1
|
||||||
if (!wifiOnly || (wifiOnly && isConnectedToWifi)) {
|
if (!wifiOnly || (wifiOnly && isConnectedToWifi)) {
|
||||||
setForegroundAsync(createForegroundInfo())
|
setForegroundAsync(createForegroundInfo())
|
||||||
openHumansUploader.uploadData().delay(12, TimeUnit.MINUTES) //TODO OH: No Delay
|
openHumansUploader.uploadData().delay(12, TimeUnit.MINUTES)
|
||||||
.andThen(Single.just(Result.success()))
|
.andThen(Single.just(Result.success()))
|
||||||
.onErrorResumeNext { Single.just(Result.retry()) }
|
.onErrorResumeNext { Single.just(Result.retry()) }
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -382,7 +382,7 @@ class OpenHumansUploader @Inject constructor(
|
||||||
.map { enqueueTempTarget(it); increaseCounter() }
|
.map { enqueueTempTarget(it); increaseCounter() }
|
||||||
.ignoreElements()
|
.ignoreElements()
|
||||||
.doOnSubscribe {
|
.doOnSubscribe {
|
||||||
wakeLock.acquire(TimeUnit.MINUTES.toMillis(20))
|
wakeLock.acquire(TimeUnit.MINUTES.toMillis(30))
|
||||||
showOngoingNotification()
|
showOngoingNotification()
|
||||||
}
|
}
|
||||||
.doOnComplete {
|
.doOnComplete {
|
||||||
|
@ -595,9 +595,9 @@ class OpenHumansUploader @Inject constructor(
|
||||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||||
.setRequiresCharging(sp.getBoolean("key_oh_charging_only", false))
|
.setRequiresCharging(sp.getBoolean("key_oh_charging_only", false))
|
||||||
.build()
|
.build()
|
||||||
val workRequest = PeriodicWorkRequestBuilder<OHUploadWorker>(1, TimeUnit.MINUTES) // TODO OH: DAYS
|
val workRequest = PeriodicWorkRequestBuilder<OHUploadWorker>(1, TimeUnit.DAYS)
|
||||||
.setConstraints(constraints)
|
.setConstraints(constraints)
|
||||||
.setBackoffCriteria(BackoffPolicy.LINEAR, 1, TimeUnit.MINUTES) //TODO OH: HOURS
|
.setBackoffCriteria(BackoffPolicy.LINEAR, 20, TimeUnit.MINUTES)
|
||||||
.build()
|
.build()
|
||||||
WorkManager.getInstance(context).enqueueUniquePeriodicWork(WORK_NAME, if (replace) ExistingPeriodicWorkPolicy.REPLACE else ExistingPeriodicWorkPolicy.KEEP, workRequest)
|
WorkManager.getInstance(context).enqueueUniquePeriodicWork(WORK_NAME, if (replace) ExistingPeriodicWorkPolicy.REPLACE else ExistingPeriodicWorkPolicy.KEEP, workRequest)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1409,7 +1409,7 @@
|
||||||
|
|
||||||
<string name="open_humans">Open Humans</string>
|
<string name="open_humans">Open Humans</string>
|
||||||
<string name="finishing_open_humans_setup">Finishing Open Humans setup…</string>
|
<string name="finishing_open_humans_setup">Finishing Open Humans setup…</string>
|
||||||
<string name="this_may_take_a_while">This may take a while. Do not turn your phone off.</string>
|
<string name="this_may_take_a_while">This may take a while. Do not turn your phone or this plugin off.</string>
|
||||||
<string name="setup_finished">Setup finished</string>
|
<string name="setup_finished">Setup finished</string>
|
||||||
<string name="your_phone_will_upload_data">Your phone will upload data to Open Humans soon.</string>
|
<string name="your_phone_will_upload_data">Your phone will upload data to Open Humans soon.</string>
|
||||||
<string name="your_phone_is_upload_data">Your phone is uploading data to Open Humans now.</string>
|
<string name="your_phone_is_upload_data">Your phone is uploading data to Open Humans now.</string>
|
||||||
|
|
Loading…
Reference in a new issue