Fixed
Status Update
Comments
ra...@google.com <ra...@google.com>
ra...@google.com <ra...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit c2e2d002a60112016c40b88a097044e3e55266e8
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Tue Jan 05 16:46:07 2021
Specify WorkSpec as the entity to observe when using LivaData.
Test: Existing tests pass.
Fixes: b/173769028
Change-Id: I3fef2a016121f21edfd29b8cd0663abfccac03be
M work/workmanager/src/main/java/androidx/work/impl/model/RawWorkInfoDao.java
https://android-review.googlesource.com/1540566
Branch: androidx-main
commit c2e2d002a60112016c40b88a097044e3e55266e8
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Tue Jan 05 16:46:07 2021
Specify WorkSpec as the entity to observe when using LivaData.
Test: Existing tests pass.
Fixes:
Change-Id: I3fef2a016121f21edfd29b8cd0663abfccac03be
M work/workmanager/src/main/java/androidx/work/impl/model/RawWorkInfoDao.java
Description
Component used: WorkManager
Version used: 2.4.0
Devices/Android versions reproduced on: Pixel 3a
Sample project:https://github.com/npike/android-workmanager-fromStates
It seems that when I have a Worker running with a constraint of RequiredNetworkType(NetworkType.CONNECTED), and disable my device's WiFi, that Worker is correctly cancelled, but the LiveData returned by the following code does not update to reflect the change in state from RUNNING to ENQUEUED.
The LiveData returned by the following code (observing a single tag for the same Worker above) updates as expected to reflect the new ENQUEUED state of my Worker.
This logic can be found in MainViewModel of the sample project linked in this ticket.