Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit cb3b96b2858feed4b2289b7281aff9d1b7831aba
Author: Simon Schiller <simonschiller@users.noreply.github.com>
Date: Wed Mar 03 23:36:49 2021
[GH] [FragmentStrictMode] Detect calls to Fragment#setUserVisibleHint
## Proposed Changes
- Detect calls to `Fragment#setUserVisibleHint`
## Testing
Test: See `FragmentStrictModeTest#detectSetUserVisibleHint`
## Issues Fixed
Fixes: 153738974
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/136 .
Resolves #136
Github-Pr-Head-Sha: 0e253b7d7f9fc6e5cfe850a339605865c7f38384
GitOrigin-RevId: 5695bed064b7d0d34bf92ae57627fc0a2a709ae6
Change-Id: I17aaf805a09827c5ffeb888ded3fbb99560c49f3
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/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentStrictMode.java
A fragment/fragment/src/main/java/androidx/fragment/app/strictmode/SetUserVisibleHintViolation.java
https://android-review.googlesource.com/1616690
Branch: androidx-main
commit cb3b96b2858feed4b2289b7281aff9d1b7831aba
Author: Simon Schiller <simonschiller@users.noreply.github.com>
Date: Wed Mar 03 23:36:49 2021
[GH] [FragmentStrictMode] Detect calls to Fragment#setUserVisibleHint
## Proposed Changes
- Detect calls to `Fragment#setUserVisibleHint`
## Testing
Test: See `FragmentStrictModeTest#detectSetUserVisibleHint`
## Issues Fixed
Fixes: 153738974
This is an imported pull request from
Resolves #136
Github-Pr-Head-Sha: 0e253b7d7f9fc6e5cfe850a339605865c7f38384
GitOrigin-RevId: 5695bed064b7d0d34bf92ae57627fc0a2a709ae6
Change-Id: I17aaf805a09827c5ffeb888ded3fbb99560c49f3
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/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentStrictMode.java
A fragment/fragment/src/main/java/androidx/fragment/app/strictmode/SetUserVisibleHintViolation.java
Description
Component used: Fragment
Allow developers to detect the usage of
setUserVisibleHint()
.This would hook into calls to
setUserVisibleHint()
and apply the appropriate penalties if this detection was enabled.