Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Use StrictMode VmPolicy only in debug build type #2002

Merged

Conversation

adamszewe
Copy link
Contributor

@adamszewe adamszewe commented Nov 12, 2023

Description

StrictMode makes sense mainly in for debug build types, enabling it for release does not provide any value as it can add additional overhead and its logs going to be removed (because R8 strips them).

Changes

  • Enable the StrictMode VM policy only for debug build type

@adamszewe adamszewe marked this pull request as ready for review November 12, 2023 00:10
@imsodin
Copy link
Member

imsodin commented Nov 28, 2023

I am not not that convinced by the benefits of of the content provider. Aren't we abusing a it, as it's intended to do something else? And those other checks you mentioned, couldn't we do that in Application as well?

@adamszewe adamszewe force-pushed the use-strict-mode-only-in-debug-build branch from 804bd71 to 90fdf09 Compare December 5, 2023 20:24
@adamszewe
Copy link
Contributor Author

I am not not that convinced by the benefits of of the content provider. Aren't we abusing a it, as it's intended to do something else? And those other checks you mentioned, couldn't we do that in Application as well?

Hello 👋
Using a ContentProvider is a "trick" other libraries, like Firebase uses among many, use.
I think I over-engineered a bit the solution initially thus I rewrote the PR and just moved the code that sets the VMPolicy to a dedicated function which is invoked only when the build type is debug.

@imsodin imsodin merged commit f4ccad8 into syncthing:main Dec 5, 2023
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants