Skip to content

[Microsoft.Android.Run] Protect managed activity startup on .NET 11 - #13574

Draft
davidnguyen-tech wants to merge 12 commits into
dotnet:release/11.0.1xxfrom
davidnguyen-tech:davidnguyen-tech-android-net11-package-production
Draft

davidnguyen-tech wants to merge 12 commits into
dotnet:release/11.0.1xxfrom
davidnguyen-tech:davidnguyen-tech-android-net11-package-production

Conversation

@davidnguyen-tech

Copy link
Copy Markdown
Member

Managed-only Android debugger launches can pause before startup completes long enough for Android's startup ANR detection to terminate the app. Avoiding Java-debugger wait alone does not protect an intentional managed pause.

Backport the shared managed-activity launch transaction to release/11.0.1xx, retaining both production RunActivity (-t:Run) and CLI (dotnet run) entry points. Eligible cold launches temporarily select Android's debug-app state without Java-debugger waiting; ownership checks, bounded cleanup, cancellation, diagnostics, and a private opt-out preserve the safety boundaries. Add fake-ADB host regressions and documentation. No device or live ADB access is used by these tests.

Published source: ad64196d59f9d3321b32234367ea4e66af59a70e, tree 5e496baab89862f734744ba533aaa2953f228755, based on release/11.0.1xx at e5cdeb4ebc2517df09e1efa7fff1fb98d8e6e67c. The release SDK remains 11.0.100-rtm.26555.108; dependency pins are unchanged.

Fresh host validation on this exact source with the isolated exact-pin SDK (CLI version 11.0.100, SDK metadata commit 1f64ef47a8bab8b70faef698083e1d7a45dc4146):

  • .\bin\Debug\dotnet\dotnet.exe test tests\Microsoft.Android.Run-Tests\Microsoft.Android.Run-Tests.csproj -c Debug -nodeReuse:false --logger "trx;LogFileName=cli.trx" --results-directory <evidence>: 73 passed, zero failed; one Unix-only SIGINT case not executed on Windows. The unmodified net10.0 CLI test host uses its declared Major runtime roll-forward to the isolated 11.0.0 runtime; the SDK itself did not roll forward.
  • .\bin\Debug\dotnet\dotnet.exe test src\Microsoft.Android.Build.Tasks\Tests\Microsoft.Android.Build.Tasks.Tests\Microsoft.Android.Build.Tasks.Tests.csproj -c Debug -nodeReuse:false --filter "FullyQualifiedName~RunActivityManagedLaunch" --logger "trx;LogFileName=runactivity.trx" --results-directory <evidence>: 27 passed, zero failed.

A fresh source-bound public producer and Windows MAUI debugger acceptance remain pending. Unsigned CI packages are intermediate validation inputs, not signed product delivery. This PR does not claim emulator acceptance, a sustained managed pause, or final Windows debugger success. .NET 10/Mono and Hot Reload are deferred.

No issue reference supplied.


Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

  • Useful description of why the change is necessary.
  • Links to issues fixed
  • Unit tests

davidnguyen-tech and others added 12 commits September 14, 2026 21:45
Use a bounded transient non-wait debug-app transaction for eligible cold activity launches, observe process attach before clearing, and preserve unsupported launch paths with explicit diagnostics.

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 04451b92-11f6-4da6-99b3-c9843d508975
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 04451b92-11f6-4da6-99b3-c9843d508975
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 04451b92-11f6-4da6-99b3-c9843d508975
Microsoft.Android.Run cancels in-flight adb children when a polling
deadline expires. On Windows the killed fake adb proxy resets its
connection, and ManagedLaunchTestServer rethrew that IOException from
DisposeAsync after the test's assertions had already passed
(PidPollingTimeoutIsFailure). Treat client transport failures as an
ended exchange and add a synchronized regression test.

Co-authored-by: Copilot App <[email protected]>

This branch has not been deployed

No deployments
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