[Android] add MonoPackageManager.setContext

As reported in #530, there are some cases where libraries use
`MonoPackageManager.setContext`, which has a “vestigial”
implementation/comment in Xamarin.Android.

I added this method and a couple quick tests for future validation.
This commit is contained in:
Jonathan Peppers 2017-10-30 10:24:36 -05:00
Родитель 63fe9f14ad
Коммит 64a3c23ead
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -3,4 +3,9 @@ package mono;
/* This is used if Application.Context is invoked from C#, see: https://github.com/xamarin/xamarin-android/blob/master/src/Mono.Android/Android.App/Application.cs */
public class MonoPackageManager {
public static android.content.Context Context;
public static void setContext (android.content.Context context)
{
// Ignore; vestigial
}
}

Просмотреть файл

@ -175,4 +175,15 @@ public class AndroidTests {
public void googlePlayServices() {
assertNotNull(GooglePlayServices.createClient());
}
@Test
public void monoPackageManagerContext() {
assertNotNull(mono.MonoPackageManager.Context);
}
@Test
public void monoPackageManagerSetContext() {
//Just make sure this compiles, and doesn't throw
mono.MonoPackageManager.setContext(null);
}
}