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

feat: Allow users to provide Android context instance to AndroidContextUtil instance #361

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lgoldstein
Copy link

Description

In order to support various special properties the code requires access to an Android context instance. By default, the framework uses a workaround based on reflection that seems to work for the time being. However, in view of Google's restrictions on non-SDK interfaces this code might not work anymore. Therefore, the framework should provide a special API that enables the application to provide an Android context instance that will be used instead of the workaround. See the README file for description as to how this feature would be used if necessary.

Linked Issues

None

Additional context

Note:

  • The usage of Context instead of ContextWrapper (also related to next issue)
  • The usage of application context instead of the original context - as it is durable and does not cause possible memory leaks.
  • The fix to package version code retrieval according to current API level
  • Raised min. Java level to 7 and API version to 21 since getting Java 6 level no longer supported. This should not be an issue as it is highly unlikely that the code will run on (extremely) old versions. However, if backward compatibility to Java 6 is still required, this setting can be reverted (though still need to fix the compilation error).

@lgoldstein lgoldstein changed the title Allow users to provide Android context instance to AndroidContextUtil instance feat: Allow users to provide Android context instance to AndroidContextUtil instance Sep 21, 2023
@lgoldstein lgoldstein force-pushed the external-android-context branch from f5640e6 to 5d93955 Compare September 21, 2023 05:11
@lgoldstein
Copy link
Author

Reverted min. API level to 9, but left Java JDK at 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant