Skip to content

Fix Android speech documentation errors (R100, pass 2) - #1786

Merged
jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-review-android-speech-docs-r100-pass-2
Nov 24, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-review-android-speech-docs-r100-pass-2

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: edbddb979d92ce929ac4dd5a2188c7ceabafec18

Dimension Assessment Rationale
Change confidence 9/10 ↑ All 54 scoped XML files parse; all 563 <Docs> elements have zero exact placeholders.
↑ The BCP 47 example now uses the IANA-listed GB region subtag; git diff --check passes.
↓ Runtime tests do not apply to documentation-only changes.

Scope

Reviewed all 54 files in Android.Speech and Android.Speech.Tts. Audited 290 changed <Docs> blocks across 52 files; two other files had attribute-only changes. Corrected six blocks. Uncertain findings: none.

Corrections

  • IRecognitionSupportCallback.OnError: describe the managed int error value and link to SpeechRecognizerError.
  • RecognitionService: remove the false null-return claim for its final OnBind; correct recognition-support method and enum references; explain when to override each overload to preserve access to AttributionSource.
  • SpeechRecognizer: describe the executor as dispatching support-query results to the support listener, complete the truncated TopLocaleAlternatives summary, and replace the invalid en-UK example with en-GB in the summary and remarks.

Evidence

Compared with pinned Android SDK sources from source-37.2_r01.zip (SHA-256 9d637c3af6654a2f1b696b3d19c54bb77e38df2b0106116934703f314b3d4e84): RecognitionService.java:217-224,404-430,507-512; RecognitionSupportCallback.java (onError(int)); SpeechRecognizer.java:142-165,509-518. The IANA Language Subtag Registry (file date 2026-11-18) lists GB as the United Kingdom region subtag and has no UK region entry: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry. A gemini-4-argon audit reviewed all 290 changed blocks: 284 correct, six fixed, zero uncertain; usage records confirm the model. The follow-up review confirmed the BCP 47 correction.

Checks

  • Parsed all 54 scoped XML files; counted 563 <Docs> elements; found zero exact placeholders.
  • git diff --check passed.
  • Checked new cref targets; no en-UK examples remain in Android.Speech.
  • No runtime tests apply to these documentation-only changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 21:59
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) November 24, 2026 21:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The documentation uses the invalid BCP 47 example en-UK in both the summary and remarks, which should be corrected to en-GB.

1 open issue
What changed in this PR

This documentation-only PR corrects six blocks in the .NET Android speech API reference, clarifying managed API contracts and recognition-support behavior.

Changes:

  • Clarifies integer error codes and adds managed API links.
  • Corrects service binding and support-check overload guidance.
  • Clarifies executor dispatch and completes the locale-alternatives summary.
File Description
docs/​xml/​Android.Speech/​SpeechRecognizer.xml Clarifies support-result dispatch and completes the locale summary.
docs/​xml/​Android.Speech/​RecognitionService.xml Corrects binding behavior, API references, and overload guidance.
docs/​xml/​Android.Speech/​IRecognitionSupportCallback.xml Documents the integer error value and links its enum.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the documentation-only Android speech API clarifications.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@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.

LGTM. All the edits match upstream AOSP and actual platform behavior, and the three files are well-formed XML.

  • IRecognitionSupportCallback.OnError: all 15 ERROR_* codes (1–15) have matching SpeechRecognizerError members, so the enum cref and the "int value corresponds to a member" wording are correct.
  • RecognitionService.OnBind: onBind is final and always returns the field-initialized mBinder, which is never nulled. I checked froyo through android16 and main. Dropping "may return null" is correct.
  • OnCheckRecognitionSupport links: they resolve. Linking SpeechRecognizerError.CannotCheckSupport is right because SpeechRecognizer.ErrorCannotCheckSupport is [Obsolete(..., true)].
  • Overload guidance: this matches dispatch. API 33 calls the two-parameter overload; API 34+ calls the three-parameter one, which delegates to the two-parameter one by default.
  • CheckRecognitionSupport executor: InternalSupportCallback sends both onSupportResult and onError through the executor.
  • TopLocaleAlternatives summary: now matches upstream, with the agreed en-GB correction.

Non-blocking suggestions:

  • RecognitionService.xml (OnCheckRecognitionSupport three-parameter remarks): consider adding that Android 13 only calls the two-parameter overload, so services supporting API 33 should override both.
  • SpeechRecognizer.xml:503-504 (DetectedLanguage): this summary was already cut off at "…(as defined by BCP 47, e.", the same problem fixed here for TopLocaleAlternatives. It could be completed the same way.
  • <c>#DETECTED_LANGUAGE</c> in the new summary: this could be <see cref="F:Android.Speech.SpeechRecognizer.DetectedLanguage" />.

@jonathanpeppers
jonathanpeppers merged commit 74f9c6f into main Nov 24, 2026
4 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-review-android-speech-docs-r100-pass-2 branch November 24, 2026 23:01
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.

3 participants