Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[java-runtime] move MonoPackageManager.Context to ApplicationRegistration #9779

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

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

jonathanpeppers
Copy link
Member

Calling Android.App.Application.Context currently reads the mono.MonoPackageManager.Context field, which is set on startup by a ContentProvider. mono.MonoPackageManager does not exist in NativeAOT (or CoreCLR), so let's move the field to:

  • net.dot.android.ApplicationRegistration.Context

The ApplicationRegistration class is already used in NativeAOT, so this can work for all of the runtimes.

…tration`

Calling `Android.App.Application.Context` currently reads the
`mono.MonoPackageManager.Context` field, which is set on startup by a
`ContentProvider`. `mono.MonoPackageManager` does not exist in
NativeAOT (or CoreCLR), so let's move the field to:

* `net.dot.android.ApplicationRegistration.Context`

The `ApplicationRegistration` class is already used in NativeAOT, so
this can work for all of the runtimes.
@jonathanpeppers jonathanpeppers marked this pull request as ready for review February 11, 2025 16:33
@jonpryor jonpryor merged commit 21c4131 into main Feb 11, 2025
58 checks passed
@jonpryor jonpryor deleted the dev/peppers/MonoPackageManager.Context branch February 11, 2025 19:10
grendello added a commit that referenced this pull request Feb 12, 2025
* main:
  Bump to dotnet/java-interop@57f7bc84 (#9724)
  [XABT] Fix Xamarin.Android.Build.Tasks.sln (#9782)
  [java-runtime, Mono.Android] Use `ApplicationRegistration.Context` (#9779)
  [Xamarin.Android.Build.Tasks] temporarily support .NET 8 in .NET 10 (#9777)
  Bump to dotnet/sdk@c0f88f2416 10.0.100-preview.2.25108.4 (#9775)
  [docs] update dotnetbuilds domain (#9772)
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2025
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