Skip to content

[Mono.Android] Fix handwritten build warnings - #12834

Merged
jonathanpeppers merged 3 commits into
mainfrom
simonrozsival-fix-mono-android-warnings
Sep 21, 2026
Merged

jonathanpeppers merged 3 commits into
mainfrom
simonrozsival-fix-mono-android-warnings

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Summary

  • fix all compiler and analyzer warnings originating from handwritten src/Mono.Android C# sources
  • replace obsolete event helper and XML pull parser usage where direct replacements exist
  • use narrowly scoped pragmas for compatibility shims that must preserve obsolete or legacy-nullable APIs
  • correct IAndroidAuthenticationModule return nullability and update API baselines
  • remove CS8609, CS8610, CS8613, CS8614, and CS8617 from the project-wide NoWarn list

Generated binding and JNIEnv.g.cs warnings remain suppressed for now and will be addressed in a dependent code-generation PR.

Validation

  • API 37, 37.1, and 37.2 builds contain no diagnostics from handwritten Mono.Android C# with NoWarn cleared
  • API compatibility validation passes for the default API level

Replace obsolete helper usage, scope unavoidable compatibility warnings, and align authentication nullability with its implementations.

Remove warning suppressions that are no longer needed by handwritten sources while leaving generated binding diagnostics for a follow-up.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 19, 2026 23:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Updates handwritten Mono.Android sources to eliminate compiler/analyzer warnings while preserving legacy APIs and correcting authentication nullability.

Changes:

  • Replaces obsolete event/parser helpers.
  • Adds scoped compatibility warning suppressions.
  • Updates nullable API baselines and removes obsolete project-wide warning suppressions.
File Description
src/​Mono.Android/​Xamarin.Android.Net/​IAndroidAuthenticationModule.cs Updated as part of this pull request.
src/​Mono.Android/​Xamarin.Android.Net/​AndroidMessageHandler.cs Updated as part of this pull request.
src/​Mono.Android/​PublicAPI/​API-37/​PublicAPI.Unshipped.txt Updated as part of this pull request.
src/​Mono.Android/​PublicAPI/​API-37.2/​PublicAPI.Unshipped.txt Updated as part of this pull request.
src/​Mono.Android/​PublicAPI/​API-37.1/​PublicAPI.Unshipped.txt Updated as part of this pull request.
src/​Mono.Android/​Mono.Android.csproj Updated as part of this pull request.
src/​Mono.Android/​Java.IO/​ObjectStreamField.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Widget/​MediaController.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Widget/​AbsListView.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Views/​WindowManagerLayoutParams.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Views/​View.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Views/​MotionEvent.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Telecom/​InCallService.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Runtime/​XmlReaderPullParser.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Runtime/​XmlPullParserReader.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Runtime/​TimingLogger.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Runtime/​JavaSet.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Runtime/​JavaList.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Runtime/​JavaDictionary.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Runtime/​JavaCollection.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Runtime/​AndroidRuntime.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Content/​Context.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Content/​ContentProvider.cs Updated as part of this pull request.
src/​Mono.Android/​Android.App/​Notification.cs Updated as part of this pull request.
src/​Mono.Android/​Android.App/​AlertDialog.cs Updated as part of this pull request.
src/​Mono.Android/​Android.App/​ActionBar.cs Updated as part of this pull request.
src/​Mono.Android/​Android.Accounts/​AccountManager.cs Updated as part of this pull request.

Comment thread src/Mono.Android/Android.App/Notification.cs Outdated
jonathanpeppers and others added 2 commits September 21, 2026 08:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jonathanpeppers

Copy link
Copy Markdown
Member

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event and parser changes preserve the existing contracts, and the nullable authentication returns are consistent with their implementations and all three API baselines. No blocking issues found.

@jonathanpeppers
jonathanpeppers merged commit e4a859c into main Sep 21, 2026
44 checks passed
@jonathanpeppers
jonathanpeppers deleted the simonrozsival-fix-mono-android-warnings branch September 21, 2026 19:48
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.

4 participants