Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented May 2, 2019

Fixes flutter/flutter#28848

Depends on #8821
Should not be landed until after #8824

This PR gets rid of any lint warnings about static leaks. It involves reworking a bit of ResourceExtractor.java to avoid passing the Context object into a static field.

@dnfield dnfield marked this pull request as ready for review May 3, 2019 21:41
@dnfield
Copy link
Contributor Author

dnfield commented May 3, 2019

This is ready for review. Once this one is good, we should be able to close flutter/flutter#28848


/// Returns true if successfully unpacked APK resources,
/// otherwise deletes all resources and returns false.
private boolean extractAPK(File dataDir) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a long-running method? If so, should it be executed on the @UiThread or @WorkerThread?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sbaranov would know. I'm going to imagine it's long running.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, this is only called from doInBackground, which I believe should mean it's fine to annotate this with @WorkerThread

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that sounds good.

Copy link
Contributor

@matthew-carroll matthew-carroll left a comment

Choose a reason for hiding this comment

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

LGTM pending a couple updates that would be nice to make while you're here.

Copy link
Contributor

@mklim mklim left a comment

Choose a reason for hiding this comment

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

LGTM


/// Returns true if successfully unpacked APK resources,
/// otherwise deletes all resources and returns false.
private boolean extractAPK(@NonNull File dataDir) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this just be made static and kept in the outer class, instead of moving it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could, you just then have to pass more references around to the method here (mResources, mAssetManager, mDataDirPath)

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit - It might be slightly better, to keep it symmetrical with deleteFiles and checkTimestamp.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

@dnfield dnfield merged commit 88e82d3 into flutter:master May 3, 2019
@dnfield dnfield deleted the static_leak branch May 3, 2019 23:57
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 4, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request May 4, 2019
flutter/engine@33cf682...88e82d3

git log 33cf682..88e82d3 --no-merges --oneline
88e82d3 Remove static leaks (flutter/engine#8825)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff (amirha@google.com), and stop
the roller if necessary.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address the output of the current Android linting metabug

5 participants