Fixed
Status Update
Comments
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 1c6838207fdf0a3af0d0b8b704c87ee22af1e804
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu May 13 01:31:39 2021
Update FragmentStrictMode API to allow for a particular fragment
class to bypass the penalties for a set of violations
Updating the FragmentStrictMode API to hold a map within a Policy
that keeps track of the set of Violations that a particular Fragment
class should allow, meaning it will bypass any penalties if that
Violation is detected.
RelNote: "`FragmentStrictMode` now allows a `Policy` to set specific
`Violation`s for a particular `Fragment` class to allow, meaning that
it will bypass any penalties if that violation is detected."
Bug: 184786736
Test: FragmentStrictModeTest.kt
Change-Id: Ib4e5d6217110d76bcc9ce2a15b12e350ccbc773b
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/strictmode/FragmentStrictMode.java
https://android-review.googlesource.com/1706379
Branch: androidx-main
commit 1c6838207fdf0a3af0d0b8b704c87ee22af1e804
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu May 13 01:31:39 2021
Update FragmentStrictMode API to allow for a particular fragment
class to bypass the penalties for a set of violations
Updating the FragmentStrictMode API to hold a map within a Policy
that keeps track of the set of Violations that a particular Fragment
class should allow, meaning it will bypass any penalties if that
Violation is detected.
RelNote: "`FragmentStrictMode` now allows a `Policy` to set specific
`Violation`s for a particular `Fragment` class to allow, meaning that
it will bypass any penalties if that violation is detected."
Bug: 184786736
Test: FragmentStrictModeTest.kt
Change-Id: Ib4e5d6217110d76bcc9ce2a15b12e350ccbc773b
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/strictmode/FragmentStrictMode.java
il...@google.com <il...@google.com> #3
This has been fixed internally and will be available in Fragment 1.4.0-alpha02
.
Description
When using FragmentStrictMode, it might not be possible or prudent to fix all violations at once.
It would be convenient to let developers build up their allow list of Fragment class name + Violation class name pairs that could serve as the baseline for their app.
This would allow developers to enable more strict penalties for new violations while slowly working down the set of known violations, effectively allowing them to stop the bleeding and avoid regressions as new features are developed.