Status Update
Comments
ra...@google.com <ra...@google.com> #2
I have read that WorkManager 2.7.0 is needed if an app targets API 31/Android 12, and in order to do that, I have added setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST)
to my OneTimeWorkRequestBuilder
and added the necessary changes in the AndroidManifest as well. Now running my app I've encountered the following error:
java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Expedited WorkRequests require a ListenableWorker to provide an implementation for `getForegroundInfoAsync()`
So I tried looking up info on how to do implement this, and found no examples available from official Google sources (Github, developers.android.com, changelog, etc), but found this
My question is how do you implement the said getForegroundInfoAsync
for RxWorker
when getForegroundInfoAsync
has to return ListenableFuture<ForegroundInfo
>--reading the docs it seems I have to add Guava to my app to do this? Since the docs for ListenableFuture says to Avoid implementing ListenableFuture from scratch. If you can't get by with the standard implementations, prefer to derive a new Future instance with the methods in Futures or, if necessary, to extend AbstractFuture
.
zi...@gmail.com <zi...@gmail.com> #3
I also have tried adding a SettableFuture
but it is annotated with @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
Description
Version used: 2.4.0-beta01
Because the facilities for storing state for each https://issuetracker.google.com/issues/143847546 ).
WorkRequest
are not sufficient for my app, I'm storing their ids in my own database. To query the running state of multipleWorkRequest
s at once, I'm using tags together withWorkManager::getWorkInfos
(added inIt would be nice to drop the tag management and query for multiple ids at once. One possible implementation of this feature would be to add a
List<UUID>
for the ids toWorkQuery
.