Skip to content

[FragmentStrictMode] Detect Fragment reuse #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

simonschiller
Copy link
Contributor

Proposed Changes

  • Detect reuse of Fragment instances

Testing

Test: See FragmentStrictModeTest#detectFragmentReuse and FragmentStrictModeTest#detectFragmentReuseInFlightTransaction

Issues Fixed

Fixes: 153738653

@dlam dlam requested a review from jbw0033 March 15, 2021 19:19
@jbw0033 jbw0033 requested a review from ianhanniballake March 16, 2021 20:10
@@ -283,6 +283,10 @@ public void run() {
// track it separately.
boolean mIsCreated;

// True if the fragment was already added to a FragmentManager, but has since been removed
// again.
boolean mRemovedFromFragmentManager;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name is long, I think mRemoved would be enough.

@simonschiller simonschiller requested a review from jbw0033 March 16, 2021 20:25
@dlam
Copy link
Member

dlam commented Mar 17, 2021

Build should be passing again now - if you rebase this checks should pass.

@simonschiller simonschiller force-pushed the feature/fragment-reuse branch from 319d1ce to d769700 Compare March 17, 2021 21:08
@simonschiller
Copy link
Contributor Author

Rebased and the checks here seem fine, but I got an email notification telling me that they didn't pass. Is this branch green on your internal CI?

@dlam
Copy link
Member

dlam commented Mar 19, 2021

I think the lint check has some issues with api files right now on push events - feel free to ignore since checks here are passing.

@simonschiller simonschiller force-pushed the feature/fragment-reuse branch from d769700 to f182f85 Compare March 22, 2021 09:00
@simonschiller simonschiller force-pushed the feature/fragment-reuse branch from f182f85 to d9bcea2 Compare March 23, 2021 16:04
@simonschiller simonschiller deleted the feature/fragment-reuse branch March 25, 2021 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants