Commit 75e16eba authored by Mygod's avatar Mygod

Refine work manager

parent 667a9f95
......@@ -51,6 +51,7 @@ androidExtensions {
def lifecycleVersion = '2.1.0-rc01'
def roomVersion = '2.1.0'
def workVersion = '2.2.0-beta01'
dependencies {
api project(':plugin')
api "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
......@@ -58,7 +59,8 @@ dependencies {
api "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"
api 'androidx.preference:preference:1.1.0-rc01'
api "androidx.room:room-runtime:$roomVersion"
api 'androidx.work:work-runtime-ktx:2.1.0'
api "androidx.work:work-runtime-ktx:$workVersion"
api "androidx.work:work-gcm:$workVersion"
api 'com.crashlytics.sdk.android:crashlytics:2.10.1'
api 'com.google.code.gson:gson:2.8.5'
api 'com.google.firebase:firebase-config:18.0.0'
......
......@@ -128,5 +128,11 @@
android:process=":bg"
android:directBootAware="true"
tools:replace="android:directBootAware"/>
<!-- Used for API < 23. https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/work/workmanager-gcm/src/main/AndroidManifest.xml -->
<service android:name="androidx.work.impl.background.gcm.WorkManagerGcmService"
android:process=":bg"
android:directBootAware="true"
tools:replace="android:directBootAware"/>
</application>
</manifest>
......@@ -53,6 +53,6 @@ class AclSyncer(context: Context, workerParams: WorkerParameters) : CoroutineWor
Result.success()
} catch (e: IOException) {
e.printStackTrace()
Result.retry()
if (runAttemptCount > 5) Result.failure() else Result.retry()
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment