Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 57ca221882695bd6a52549f4d9ea3b812e6fe87c
Author: Simon Schiller <simonschiller@users.noreply.github.com>
Date: Mon Mar 22 16:09:30 2021
[GH] [FragmentStrictMode] Detect <fragment> tag usage
## Proposed Changes
- Detect `<fragment>` tag usage inside XML layouts
## Testing
Test: See `FragmentStrictModeTest#detectFragmentTagUsage`
## Issues Fixed
Fixes: 153738235
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/141 .
Resolves #141
Github-Pr-Head-Sha: 4ea052596e4341b9f11bcf335e2bc38045a91f19
GitOrigin-RevId: 62e7487aa4874eef6bb556490e193717cf937251
Change-Id: Iae48578e85e4e4897f806d7ade2e2a660adf9479
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/strictmode/FragmentStrictModeTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentLayoutInflaterFactory.java
M fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentStrictMode.java
A fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentTagUsageViolation.java
https://android-review.googlesource.com/1649748
Branch: androidx-main
commit 57ca221882695bd6a52549f4d9ea3b812e6fe87c
Author: Simon Schiller <simonschiller@users.noreply.github.com>
Date: Mon Mar 22 16:09:30 2021
[GH] [FragmentStrictMode] Detect <fragment> tag usage
## Proposed Changes
- Detect `<fragment>` tag usage inside XML layouts
## Testing
Test: See `FragmentStrictModeTest#detectFragmentTagUsage`
## Issues Fixed
Fixes: 153738235
This is an imported pull request from
Resolves #141
Github-Pr-Head-Sha: 4ea052596e4341b9f11bcf335e2bc38045a91f19
GitOrigin-RevId: 62e7487aa4874eef6bb556490e193717cf937251
Change-Id: Iae48578e85e4e4897f806d7ade2e2a660adf9479
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/strictmode/FragmentStrictModeTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentLayoutInflaterFactory.java
M fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentStrictMode.java
A fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentTagUsageViolation.java
il...@google.com <il...@google.com>
sa...@google.com <sa...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 5020e04fbdb1e3c8de4e0d7da9f45a097c60a13f
Author: sanura <sanura@google.com>
Date: Mon Nov 14 23:25:08 2022
Put nested fragment without childFragmentManager behind flag
When nesting fragments, the child fragment should
be added using the parent's childFragmentManager.
However, since we previously allowed this
functionality, we want to put its removal behind
a flag in FragmentStrictMode.
RelNote: "The functionality of nested fragments
without the use of the parent's
`childFragmentManager` is now behind a flag in
`FragmentStrictMode`, which can be enabled to
check for violations."
Bug: 249299268
Test: ./gradlew checkApi
Change-Id: I725210f957b9be5875f7c0eadaaa992deda6614a
M fragment/fragment/api/current.txt
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/strictmode/FragmentStrictModeTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentStrictMode.kt
A fragment/fragment/src/main/java/androidx/fragment/app/strictmode/WrongNestedHierarchyViolation.kt
https://android-review.googlesource.com/2288634
Branch: androidx-main
commit 5020e04fbdb1e3c8de4e0d7da9f45a097c60a13f
Author: sanura <sanura@google.com>
Date: Mon Nov 14 23:25:08 2022
Put nested fragment without childFragmentManager behind flag
When nesting fragments, the child fragment should
be added using the parent's childFragmentManager.
However, since we previously allowed this
functionality, we want to put its removal behind
a flag in FragmentStrictMode.
RelNote: "The functionality of nested fragments
without the use of the parent's
`childFragmentManager` is now behind a flag in
`FragmentStrictMode`, which can be enabled to
check for violations."
Bug: 249299268
Test: ./gradlew checkApi
Change-Id: I725210f957b9be5875f7c0eadaaa992deda6614a
M fragment/fragment/api/current.txt
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/strictmode/FragmentStrictModeTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentStrictMode.kt
A fragment/fragment/src/main/java/androidx/fragment/app/strictmode/WrongNestedHierarchyViolation.kt
sa...@google.com <sa...@google.com> #4
This has been completed internally and will be available in the Fragment 1.6.0-alpha04 release.
ju...@google.com <ju...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.fragment:fragment:1.6.0-alpha04
Description
In aosp/1244918, we added checks for developers using nested fragments without using the childFragmentManager. Since this is not how nested fragments should be used, we want to remove this functionality. However, since it may break people, let's put this behind a flag in FragmentStrictMode.