Skip to content
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

Remove the AppMode global #200

Closed
ignoramous opened this issue Dec 28, 2020 · 3 comments
Closed

Remove the AppMode global #200

ignoramous opened this issue Dec 28, 2020 · 3 comments
Assignees
Labels
P1 Priority: 1 (urgent)
Milestone

Comments

@ignoramous
Copy link
Collaborator

Per Daniel,

  • VpnController has a static field braveVpnService. This is not an important fix because it is set to null with stop(). If the service is killed by the system it is pulled from memory entirely, so no reason to do cleanup.
  • HomeScreenActivity leaks AppMode, which references Context and multiple DAOs. It is used extensively across the app. It is fixable, but I'm not sure whether I'd mess up the logic behind it.
  • GoVpnAdapter has a non-static AsyncTask. It potentially leaks Context through this as it is an inner-class. It also is fixable, but requires refactor (also, IntelliSense doesn't work in this class for me).

#188 (comment)

@ignoramous ignoramous added the P1 Priority: 1 (urgent) label Dec 28, 2020
@ignoramous ignoramous added this to the v054 milestone Dec 28, 2020
@hussainmohd-a
Copy link
Collaborator

hussainmohd-a commented Jun 3, 2021

Remove some of the inconsistent methods from the Persistentstate.
eg., - modifyAllowedWifi(), getConnectedDNS(), getBraveMode(), setBraveMode()

@ignoramous
Copy link
Collaborator Author

@ignoramous
Copy link
Collaborator Author

ignoramous commented Sep 7, 2021

  1. VpnController is likely to remain as-is, as it is extensively used throughout the code-base and doesn't seem to critically leak anything, as of yet.
  2. AppMode is still a global, but it kind of acts like a DatabaseManager at this point, though not quite. In a limbo, but the code has since been extensively refactored with Connection monitor changes #282
  3. GoVpnAdapter's use of AsyncTask has been replaced with Kotlin Coroutines. Replace AsyncTask with Workers #240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Priority: 1 (urgent)
Projects
None yet
Development

No branches or pull requests

2 participants