Fixed
Status Update
Comments
jb...@google.com <jb...@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
jb...@google.com <jb...@google.com> #3
It looks like removed fragments are also getting the onConfigurationChanged
callback, which should not be the case.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 448093dd529e151c486343aedcfb1f656abe9819
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Sep 13 13:34:06 2022
Dispatch config change on added fragmentManagers
With the new provider callbacks, each fragment manager registers for
config change with the host once it is attached, and does not unregister
until it is destroyed. This means that even after fragments have been
put on the back stack, their childFragmentManagers can still dispatch
config changes, even though the fragment is not currently added.
We need to make it so that only added fragments (and their child
fragment managers) dispatch config changes.
RelNote: "Fixed an error that caused fragments on the back stack to get
onConfigurationChanged() callbacks."
Test: Added ProviderCallbackTest
Bug: 242570955
Fixes: 243982866
Change-Id: I8dfe68f7b8700f0c1d3b13a3d5b826fc924b7452
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/androidTest/java/androidx/fragment/app/ProviderCallbackTest.kt
https://android-review.googlesource.com/2216147
Branch: androidx-main
commit 448093dd529e151c486343aedcfb1f656abe9819
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Sep 13 13:34:06 2022
Dispatch config change on added fragmentManagers
With the new provider callbacks, each fragment manager registers for
config change with the host once it is attached, and does not unregister
until it is destroyed. This means that even after fragments have been
put on the back stack, their childFragmentManagers can still dispatch
config changes, even though the fragment is not currently added.
We need to make it so that only added fragments (and their child
fragment managers) dispatch config changes.
RelNote: "Fixed an error that caused fragments on the back stack to get
onConfigurationChanged() callbacks."
Test: Added ProviderCallbackTest
Bug: 242570955
Fixes: 243982866
Change-Id: I8dfe68f7b8700f0c1d3b13a3d5b826fc924b7452
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/androidTest/java/androidx/fragment/app/ProviderCallbackTest.kt
jb...@google.com <jb...@google.com> #5
This has been fixed internally and will be available in the Fragment 1.5.3
release.
na...@google.com <na...@google.com> #6
This bug was linked in a change in the following release(s):
androidx.fragment:fragment:1.6.0-alpha03
na...@google.com <na...@google.com> #7
This bug was linked in a change in the following release(s):
androidx.fragment:fragment:1.5.3
na...@google.com <na...@google.com> #8
This bug was linked in a change in the following release(s):
androidx.fragment:fragment:1.6.0-alpha03
Description
Version used: 1.5.2
Devices/Android versions reproduced on: Android 11 phone, but actually I believe it does not matter
If this is a bug in the library, we would appreciate if you could attach:
see README in the project for details including how to reproduce the issue.
This behavior appeared in 1.5.2 library version. Version 1.4.* do not have such problem.