Skip to content

[fix-finder] Add XML documentation to KeyCharacterMap convenience overloads in Mono.Android #11745

Description

@github-actions

Problem

The two public convenience overloads in src/Mono.Android/Android.Views/KeyCharacterMap.cs ship in Mono.Android.dll but have no XML documentation. KeyCharacterMap is a developer-facing input-handling type, so IntelliSense docs describing the behavior, parameters, and return values would help consumers. Both methods are managed overloads that accept the meta-key state as an int and delegate to the strongly-typed MetaKeyStates overloads, so they have no base/interface documentation to inherit.

Location

  • File(s): src/Mono.Android/Android.Views/KeyCharacterMap.cs
  • Line(s): Get at line 5; GetMatch at line 10

Current Code

namespace Android.Views {

	partial class KeyCharacterMap {

		public int Get (Keycode keyCode, int metaState)
		{
			return Get (keyCode, (MetaKeyStates) metaState);
		}

		public char GetMatch (Keycode keyCode, char[] chars, int metaState)
		{
			return GetMatch (keyCode, chars, (MetaKeyStates) metaState);
		}
	}
}

Suggested Fix

Add /// XML doc comments above each of the two public methods only. Do not change any code, signatures, or behavior, and do not add #nullable enable. Use tabs for indentation to match the file. The result should look like:

namespace Android.Views {

	partial class KeyCharacterMap {

		/// <summary>
		/// Gets the Unicode character generated by the specified key and meta key state combination.
		/// </summary>
		/// <param name="keyCode">The key code.</param>
		/// <param name="metaState">A combination of <see cref="MetaKeyStates"/> values, expressed as an integer.</param>
		/// <returns>The Unicode character (code point) produced by the key, or <c>0</c> if the key does not produce a character.</returns>
		/// <seealso href="(developer.android.com/redacted),%20int)">Android documentation for <c>android.view.KeyCharacterMap.get</c></seealso>
		public int Get (Keycode keyCode, int metaState)
		{
			return Get (keyCode, (MetaKeyStates) metaState);
		}

		/// <summary>
		/// Gets the first character in <paramref name="chars"/> that can be generated by the specified key code.
		/// If there are multiple choices, prefers the one that would be generated with the specified meta key modifier state.
		/// </summary>
		/// <param name="keyCode">The key code.</param>
		/// <param name="chars">The array of characters to match against.</param>
		/// <param name="metaState">A combination of <see cref="MetaKeyStates"/> values, expressed as an integer.</param>
		/// <returns>The matching character, or the null character (<c>'\0'</c>) if no match was found.</returns>
		/// <seealso href="(developer.android.com/redacted),%20char[],%20int)">Android documentation for <c>android.view.KeyCharacterMap.getMatch</c></seealso>
		public char GetMatch (Keycode keyCode, char[] chars, int metaState)
		{
			return GetMatch (keyCode, chars, (MetaKeyStates) metaState);
		}
	}
}

Guidelines

  • Follow the existing XML-doc style already used in src/Mono.Android/Android.Util/Log.cs (<summary>, <param>, <returns>, <seealso href>), using tabs for indentation.
  • Comment-only change: do not alter signatures, logic, using directives, or add #nullable enable.
  • MetaKeyStates is in the same Android.Views namespace, so the <see cref> references resolve without a qualifier.

Acceptance Criteria

  • Both public Get and GetMatch overloads have /// XML documentation.
  • No code, signatures, or behavior are changed (docs only).
  • All tests pass.
  • No new warnings introduced.

Fix-finder metadata

  • Script: 04-missing-xml-docs
  • Score: 29/30 (actionability: 10, safety: 10, scope: 9)

Generated by Nightly Fix Finder · 299.5 AIC · ⌖ 50.3 AIC · ⊞ 40.8K ·

  • expires on Jul 3, 2026, 2:33 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions