Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 8a8e061b36655a79e76f13d8d84a0b13b9c18395
Author: Sumir Kataria <sumir@google.com>
Date: Tue Aug 28 14:27:36 2018
Enforce the FJD minimum backoff delay for FJD implementations only.
FJD has a minimum 30 second backoff delay (JobScheduler's is 10
seconds). We will silently use the 30 second delay when using FJD.
Also changed uses of TimeUnit.convert() to TimeUnit.toSeconds which
I think is more readable.
Also assert that the FJD Job objects are valid during each test.
Bug: 113304626
Test: Added testConvert_backoffPolicyBelowMinimumSize. Ran all tests.
Change-Id: Ia97819b1eebd6ef36fd6d973c9ccdf5351db0501
M work/workmanager-firebase/src/androidTest/java/androidx/work/impl/background/firebase/FirebaseJobConverterTest.java
M work/workmanager-firebase/src/main/java/androidx/work/impl/background/firebase/FirebaseJobConverter.java
https://android-review.googlesource.com/740383
https://goto.google.com/android-sha1/8a8e061b36655a79e76f13d8d84a0b13b9c18395
Branch: androidx-master-dev
commit 8a8e061b36655a79e76f13d8d84a0b13b9c18395
Author: Sumir Kataria <sumir@google.com>
Date: Tue Aug 28 14:27:36 2018
Enforce the FJD minimum backoff delay for FJD implementations only.
FJD has a minimum 30 second backoff delay (JobScheduler's is 10
seconds). We will silently use the 30 second delay when using FJD.
Also changed uses of TimeUnit.convert() to TimeUnit.toSeconds which
I think is more readable.
Also assert that the FJD Job objects are valid during each test.
Bug: 113304626
Test: Added testConvert_backoffPolicyBelowMinimumSize. Ran all tests.
Change-Id: Ia97819b1eebd6ef36fd6d973c9ccdf5351db0501
M work/workmanager-firebase/src/androidTest/java/androidx/work/impl/background/firebase/FirebaseJobConverterTest.java
M work/workmanager-firebase/src/main/java/androidx/work/impl/background/firebase/FirebaseJobConverter.java
Description
android.arch.work:work-runtime
android.arch.work:work-firebase
Version used:
Devices/Android versions reproduced on:
Reproducible on API 21 emulator with google play services
If OneTimeWorkRequest setInitialDelay() method is set to WorkRequest.MIN_BACKOFF_MILLIS app will crash at runtime with
com.firebase.jobdispatcher.ValidationEnforcer$ValidationException: JobParameters is invalid: Initial backoff must be at least 30s
Therefore, I think WorkRequest.MIN_BACKOFF_MILLIS should be at least 30 seconds, or, perhaps, you could create a separate constant for the initial delay and crash WorkManager always if initial delay is less than 30 seconds, no matter what API level.