Fixed
Status Update
Comments
al...@google.com <al...@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> #3
Feel free to file a new issue if this is still reproducible with
dz...@gmail.com <dz...@gmail.com> #4
Just updated to stable and the problem still persists
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 38d0ad0aef7f1561f8587d411007dd885e8c028c
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Feb 18 17:20:17 2021
Only setFocusedView for entering fragments
We should only the set the focused view for incoming fragments. Any out
going fragments will have their view destroyed so we do not care about
the focused view. Fragments using show/hide, will not change their
lifecycle so any saved focus views would not ever be restored anyway.
RelNote: "Fixed a memory leak in fragments caused by `mFocusedView`"
Test: FragmentFocusTest and in sample
Bug: 179925887
Change-Id: Ib4e9eddfba3ad925471890ff0078d9a65416f7da
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentFocusTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
https://android-review.googlesource.com/1595207
Branch: androidx-main
commit 38d0ad0aef7f1561f8587d411007dd885e8c028c
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Feb 18 17:20:17 2021
Only setFocusedView for entering fragments
We should only the set the focused view for incoming fragments. Any out
going fragments will have their view destroyed so we do not care about
the focused view. Fragments using show/hide, will not change their
lifecycle so any saved focus views would not ever be restored anyway.
RelNote: "Fixed a memory leak in fragments caused by `mFocusedView`"
Test: FragmentFocusTest and in sample
Bug: 179925887
Change-Id: Ib4e9eddfba3ad925471890ff0078d9a65416f7da
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentFocusTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
jb...@google.com <jb...@google.com>
jb...@google.com <jb...@google.com> #6
This has been fixed internally and will be available in the Fragment version 1.3.1
release.
Description
Version used: 1.3.0-beta01
Devices/Android versions reproduced on:
OnePlus 8 (API30), OnePlus 2 (API23), Emulator (API30)
Repository:
Steps to reproduce: Select input field -> Click button to navigate to new fragment (via Navigation library) -> Check notification for LeakCanary message (After returning back via back button all objects are garbage collected, but if you close app via home button you will receive warning from LeakCanary).
Additional info: It seems like there is no such problem in alpha02 version