Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 0f8ab2b9502dab6cb0124be78ce800ee7ec27779
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Nov 20 11:02:04 2020
Don't allow initializing FragmentScenario with DESTROYED
Fragments should never go to DESTROYED until they are actually be
destroyed, therefore FragmentScenario should not be initialized with
DESTROYED.
Relnote: "Initializing a FragmentScenario with a DESTROYED state will
now throw an IllegalArgumentException"
Test: FragmentScenarioTest
Bug: 170765622
Change-Id: I7359000183f73a7b2f01eb637655ca8c655e371e
M fragment/fragment-testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioTest.kt
M fragment/fragment-testing/src/main/java/androidx/fragment/app/testing/FragmentScenario.kt
https://android-review.googlesource.com/1506500
Branch: androidx-master-dev
commit 0f8ab2b9502dab6cb0124be78ce800ee7ec27779
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Nov 20 11:02:04 2020
Don't allow initializing FragmentScenario with DESTROYED
Fragments should never go to DESTROYED until they are actually be
destroyed, therefore FragmentScenario should not be initialized with
DESTROYED.
Relnote: "Initializing a FragmentScenario with a DESTROYED state will
now throw an IllegalArgumentException"
Test: FragmentScenarioTest
Bug: 170765622
Change-Id: I7359000183f73a7b2f01eb637655ca8c655e371e
M fragment/fragment-testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioTest.kt
M fragment/fragment-testing/src/main/java/androidx/fragment/app/testing/FragmentScenario.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit a3365d1ea3629f44a25d7e89b6b7e8f24410d828
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Nov 20 10:51:35 2020
Throw when setting max lifecycle to DESTROYED
Fragment should only move to DESTROYED when they are actually being
destroyed. Attempting to set the max lifecycle to DESTROYED should
throw an error.
Relnote: "Attempting to set the max lifecycle of a fragment to DESTROYED
will now throw an IllegalArgumentException"
Test: BackStateTest
Bug: 170765622
Change-Id: Ie765188cbaf8473b2aac8f171e869c8fec84e212
M fragment/fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
https://android-review.googlesource.com/1507686
Branch: androidx-master-dev
commit a3365d1ea3629f44a25d7e89b6b7e8f24410d828
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Nov 20 10:51:35 2020
Throw when setting max lifecycle to DESTROYED
Fragment should only move to DESTROYED when they are actually being
destroyed. Attempting to set the max lifecycle to DESTROYED should
throw an error.
Relnote: "Attempting to set the max lifecycle of a fragment to DESTROYED
will now throw an IllegalArgumentException"
Test: BackStateTest
Bug: 170765622
Change-Id: Ie765188cbaf8473b2aac8f171e869c8fec84e212
M fragment/fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be available in the Fragment 1.3.0-beta02
release.
Description
There are no use cases when we should allow a fragment's Lifecycle to be moved to
DESTROYED
other than when the fragment is actually destroyed.Therefore, you should not be able to
setMaxLifecycle()
toDESTROYED
through aFragmentTransaction
, initialize aFragmentScenario
withDESTROYED
, or move aFragmentScenario
to theDESTROYED
state usingmoveToState()
.Doing any of these things should throw an error.