diff --git a/.external b/.external index c7fab31f441..41ef6411e84 100644 --- a/.external +++ b/.external @@ -1 +1 @@ -DevDiv/android-platform-support:main@3b4e16f197ff3e102ffb59af0b0f056046cc7658 +DevDiv/android-platform-support:main@cc26de2b33292462ab2daa70c593c78ef2a241e7 diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/MainActivity.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/MainActivity.cs index 98a18bc4b55..77cc29f0185 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/MainActivity.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/MainActivity.cs @@ -11,6 +11,7 @@ namespace ${ROOT_NAMESPACE} { [Register ("${JAVA_PACKAGENAME}.MainActivity"), Activity (Label = "${PROJECT_NAME}", MainLauncher = true, Icon = "@drawable/icon")] + //${ATTRIBUTES} public class MainActivity : Activity { //${FIELDS} diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs index 24badd0933b..2883e771a10 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs @@ -46,6 +46,33 @@ public void DotNetRun ([Values (true, false)] bool isRelease) Assert.IsTrue (didLaunch, "Activity should have started."); } + [Test] + public void ActivityAliasRuns ([Values (true, false)] bool isRelease) + { + var proj = new XamarinAndroidApplicationProject { + IsRelease = isRelease + }; + proj.AndroidManifest = proj.AndroidManifest.Replace ("", @" + + + + + + +"); + proj.MainActivity = proj.DefaultMainActivity.Replace ("//${ATTRIBUTES}",$"[Register(\"{proj.PackageName}.MainActivity\")]").Replace("MainLauncher = true", "MainLauncher = false"); + using var builder = CreateApkBuilder (); + Assert.IsTrue (builder.Install (proj), "Install should have succeeded."); + RunProjectAndAssert (proj, builder); + Assert.True (WaitForActivityToStart (proj.PackageName, "MainActivityAlias", + Path.Combine (Root, builder.ProjectDirectory, "logcat.log"), 30), "Activity MainActivityAlias should have started."); + } + [Test] public void NativeAssemblyCacheWithSatelliteAssemblies ([Values (true, false)] bool enableMarshalMethods) {