Fixed
Status Update
Comments
su...@google.com <su...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit c73bd92631a2ff341f89001bc9143c7b998333e8
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Aug 18 18:03:13 2022
Add project dependency constraint between lifecycle-viewmodel and lifecycle-viewmodel-savedstate
Added bi-directional project version constraint between
lifecycle-viewmodel and lifecycle-viewmodel-savedstate.
If both artifacts are in the dependency tree, their
versions should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I3ab2abf9b6b1861038afc0e651da80e4ee75efb8
M lifecycle/lifecycle-viewmodel-savedstate/build.gradle
https://android-review.googlesource.com/2189976
Branch: androidx-main
commit c73bd92631a2ff341f89001bc9143c7b998333e8
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Aug 18 18:03:13 2022
Add project dependency constraint between lifecycle-viewmodel and lifecycle-viewmodel-savedstate
Added bi-directional project version constraint between
lifecycle-viewmodel and lifecycle-viewmodel-savedstate.
If both artifacts are in the dependency tree, their
versions should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I3ab2abf9b6b1861038afc0e651da80e4ee75efb8
M lifecycle/lifecycle-viewmodel-savedstate/build.gradle
su...@google.com <su...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e7a81dc92c9c56b31455c75161a8becf49f761e3
Author: Sanura N'Jaka <sanura@google.com>
Date: Wed Aug 17 22:44:55 2022
Add project dependency constraint between lifecycle-runtime and lifecycle-runtime-compose
Added bi-directional project version constraint between
lifecycle-runtime and lifecycle-runtime-compose. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I0f6b3928ac0b338b0fcc6835828dd43fadee8c0d
M lifecycle/lifecycle-runtime-compose/build.gradle
M lifecycle/lifecycle-runtime/build.gradle
https://android-review.googlesource.com/2189951
Branch: androidx-main
commit e7a81dc92c9c56b31455c75161a8becf49f761e3
Author: Sanura N'Jaka <sanura@google.com>
Date: Wed Aug 17 22:44:55 2022
Add project dependency constraint between lifecycle-runtime and lifecycle-runtime-compose
Added bi-directional project version constraint between
lifecycle-runtime and lifecycle-runtime-compose. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I0f6b3928ac0b338b0fcc6835828dd43fadee8c0d
M lifecycle/lifecycle-runtime-compose/build.gradle
M lifecycle/lifecycle-runtime/build.gradle
Description
Version used: 1.0.0-alpha12
Devices/Android versions reproduced on: Pixel 2 Emulator
Canceling work that is deeper in the chain (by tag) seems to cancel the work correctly, but it get enqueued again incorrectly.
DownloadCommentsWorker:
```
override fun doWork(): Result {
System.out.println("$this::class.java - Started")
Thread.sleep(Random.nextLong(5000))
System.out.println("$this::class.java - Done")
return Result.success()
}
```
FinalWorker:
```
override fun doWork(): Result {
System.out.println("ALL WORK COMPLETE")
return Result.success()
}
```
```
WorkManager.getInstance()
.beginUniqueWork("unique", ExistingWorkPolicy.KEEP, OneTimeWorkRequestBuilder<DownloadCommentsWorker>().build())
.then(OneTimeWorkRequestBuilder<FinalWorker>().addTag("finally").build())
.enqueue()
WorkManager.getInstance().getWorkInfosForUniqueWorkLiveData("unique").observe(this, workInfos -> {
for (WorkInfo info : workInfos) {
System.out.println(info.toString());
}
});
WorkManager.getInstance().cancelAllWorkByTag("finally").getState().observe(this, state -> {
System.out.println(state);
});
```
Console Output
```
2018-12-11 11:04:51.182 6991-6991/com.plangrid.android.devgrid I/System.out: SUCCESS
2018-12-11 11:04:51.184 6991-7056/com.plangrid.android.devgrid I/System.out: com.plangrid.android.workmanager.DownloadCommentsWorker@e5d859f::class.java - Started
2018-12-11 11:04:51.240 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='4eac7884-3374-494a-a549-fcd7505fc5b4', mState=CANCELLED, mOutputData=androidx.work.Data@0, mTags=[finally, com.plangrid.android.workmanager.FinalWorker]}
2018-12-11 11:04:51.240 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='c8e75590-8f60-40b7-a2e6-4e7aa6e7830d', mState=RUNNING, mOutputData=androidx.work.Data@0, mTags=[com.plangrid.android.workmanager.DownloadCommentsWorker]}
2018-12-11 11:04:54.488 6991-7056/com.plangrid.android.devgrid I/System.out: com.plangrid.android.workmanager.DownloadCommentsWorker@e5d859f::class.java - Done
2018-12-11 11:04:54.508 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='4eac7884-3374-494a-a549-fcd7505fc5b4', mState=ENQUEUED, mOutputData=androidx.work.Data@0, mTags=[finally, com.plangrid.android.workmanager.FinalWorker]}
2018-12-11 11:04:54.509 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='c8e75590-8f60-40b7-a2e6-4e7aa6e7830d', mState=SUCCEEDED, mOutputData=androidx.work.Data@0, mTags=[com.plangrid.android.workmanager.DownloadCommentsWorker]}
2018-12-11 11:04:54.518 6991-7057/com.plangrid.android.devgrid I/System.out: ALL WORK COMPLETE
2018-12-11 11:04:54.528 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='4eac7884-3374-494a-a549-fcd7505fc5b4', mState=SUCCEEDED, mOutputData=androidx.work.Data@0, mTags=[finally, com.plangrid.android.workmanager.FinalWorker]}
2018-12-11 11:04:54.528 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='c8e75590-8f60-40b7-a2e6-4e7aa6e7830d', mState=SUCCEEDED, mOutputData=androidx.work.Data@0, mTags=[com.plangrid.android.workmanager.DownloadCommentsWorker]}
```