Skip to content

Fix Android.Media documentation errors (R061, pass 3) - #1943

Merged
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-review-android-media-r061-666
Nov 27, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-review-android-media-r061-666

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 273d480f7b2b4fc322d79b44b0eae9f5f8854ebd

Dimension Assessment Rationale
Change confidence 8/10 ↑ Reviewed 676 changed blocks against pinned sources; parsed all 107 scoped files and checked bytes and links.
↑ Independent Gemini review found no actionable issues.
↓ Android device behavior and published-page rendering were not tested.
Diagnosis confidence 8.5/10 ↑ Android implementation and managed binding evidence support the corrections.
↓ Four conflicting deprecation dates remain unchanged.
Evidence fit Unknown ↓ This audit has no user-reported symptoms or reproduction to compare with the findings.

Scope

Third-pass review of the 107 Android.Media files in R061 against pre-AI commit 86f7744a1. I reviewed all 676 changed documentation blocks and recorded a personal verdict for each of their 1,188 changed channels. This PR changes 268 channels in 209 blocks across 46 files. Four additional channels have unresolved source conflicts and are unchanged.

I also rechecked pass-2 #1752: it listed no uncertain findings, Copilot found no issues, and dalexsoto approved it. This pass corrects further version and routing details in that work.

Fixes and evidence

  • Correct incoming JNI reference ownership and peer registration in managed constructors. The peer takes a copy; transfer flags govern release of the incoming reference and registration. Object.cs, JNIEnv.cs.
  • Correct callback thread selection for null handlers. Recorder and track routing listeners use the construction looper, while manager playback and recording callbacks use the registration looper. Focus requests use the manager's looper. Each falls back to the main looper when needed. AudioRecord, Android 6, AudioTrack, Android 6, AudioManager, Android 7, Android 8.
  • Remove unconditional claims that stopped recorders and tracks have no routed device. The native implementation can retain prior route IDs. AudioRecord.cpp, AudioTrack.cpp.
  • Correct the privacy-sensitive builder description: playback capture returns before privacy handling; otherwise explicit settings can override defaults and incompatible sources can fail. Limit the usage restrictions to the playback-capture path. AudioRecord, Android 11, AudioRecord, Android 16.
  • Describe the incompatible managed ExcludeUsages and MatchingUsages return signatures: the binding requests scalar ()I, but Android declares int[]. Correct the builder parameter descriptions to name usage values rather than AudioAttributes objects. Managed metadata, matching metadata, Android 10 source.
  • Correct track constructor sample-rate boundaries, playback-state mapping, timestamp handling, and written-frame counter descriptions. Zero selects an unspecified sample rate starting in Android 7; internal stopping-state mapping starts in Android 10; the timestamp is ignored only on the relevant streaming path. AudioFormat, Android 6, Android 7, AudioTrack, Android 10, and AudioTrack.java in the SDK source archive below, lines 2383–2408 and 3820–3854.
  • Correct input-position mask restrictions, channel diagrams, multichannel wording, the AudioFormat constructor deprecation boundary, and managed enum references. AudioRecord, Android 2, AudioFormat, Android 5, and AudioFormat.java and AudioRecord.java in the SDK archive.
  • Correct the volume-fixed failure behavior, audio metadata key descriptions, callback nullability, and routing-listener bridges. AudioManager, Android 12, Android 13, AudioMetadata, Android 11.
  • Correct CamcorderProfile.Duration: setting a recorder profile does not apply its duration. MediaRecorder, Android 2.2, and MediaRecorder.java in the SDK archive, lines 836–847.
  • Replace Java-only member names and broken labels with exact managed DocIds for Parcelable creators and flags, audio focus, formats, sources, mixer attributes, direct playback, DRM errors, and HDR types. Preserve Android reference links and attribution. Parcelable contract, and the corresponding class declarations in the SDK archive.

The current source archive is Android SDK sources 37.2 r01, SHA-256 9d637c3af6654a2f1b696b3d19c54bb77e38df2b0106116934703f314b3d4e84. The bindings target r02; conflicting r02 facts were not replaced with r01 facts.

Uncertain findings

The four ChannelConfiguration fields below are unchanged. Android 2.0 AudioFormat.java already annotates them @Deprecated, while data/api-versions.xml in the Android 37.2 r01 platform package reports API 15. The metadata file's SHA-256 is 3cd2413cc3d1b285b1dff6d568116f351ae80c6274f3496e830e5669a9dd0ed9.

Field Android 2.0 source line API metadata line
Default 44 36285
Invalid 41 36286
Mono 47 36287
Stereo 50 36288

Checks

  • Parsed all 107 scoped XML files; 1,337 Docs blocks are present and there are no placeholders.
  • Compared original and changed bytes outside the approved documentation channels; BOM, API metadata, reference links and attribution are unchanged.
  • Resolved all 138 distinct newly added managed references, including System.Int32.
  • Checked all ledger source paths and numeric line ranges; 676/676 blocks and 1,188/1,188 channels have personal verdicts.
  • git diff --check.
  • Independent gemini-4-argon review of the committed diff: no actionable findings; the model was verified in local usage events.

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

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 Android.Media documentation updates.

No open issues 🎉

What changed in this PR

This documentation-only PR continues the Android.Media corrections from #1752, aligning .NET Android API guidance with managed bindings and Android behavior. It does not change API signatures or runtime code.

Changes:

  • Corrects JNI reference handling, callback threading, routing behavior, and version-specific guidance.
  • Clarifies playback-capture restrictions, incompatible usage-property bindings, and recording settings.
  • Replaces Java-only names with managed documentation links and improves Parcelable, nullability, and channel descriptions.
File Description
docs/​xml/​Android.Media/​DrmErrorCode.xml Links DRM error guidance to managed APIs.
docs/​xml/​Android.Media/​DirectPlaybackSupport.xml Adds managed playback-support references.
docs/​xml/​Android.Media/​ChannelOut.xml Links channel diagrams and fixes punctuation.
docs/​xml/​Android.Media/​ChannelIn.xml Clarifies input-position mask restrictions.
docs/​xml/​Android.Media/​CapturePolicies.xml Scopes usage restrictions to playback capture.
docs/​xml/​Android.Media/​CamcorderProfile.xml Clarifies that profile duration is not applied automatically.
docs/​xml/​Android.Media/​AudioTrackPerformanceMode.xml Uses managed buffer-tuning API references.
docs/​xml/​Android.Media/​AudioTrack+StreamEventCallback.xml Clarifies JNI handling and links Stop.
docs/​xml/​Android.Media/​AudioTrack+PeriodicNotificationEventArgs.xml Documents nullable track values.
docs/​xml/​Android.Media/​AudioTrack+MarkerReachedEventArgs.xml Documents nullable track values.
docs/​xml/​Android.Media/​AudioTrack+IOnRoutingChangedListener.xml Clarifies nullability and routing bridge behavior.
docs/​xml/​Android.Media/​AudioTrack+IOnPlaybackPositionUpdateListener.xml Documents nullable callback parameters.
docs/​xml/​Android.Media/​AudioTrack+CodecFormatChangedEventArgs.xml Links the metadata key definitions.
docs/​xml/​Android.Media/​AudioTrack+Builder.xml Corrects JNI wording and managed API references.
docs/​xml/​Android.Media/​AudioTrack.xml Corrects threading, routing, version, and timestamp guidance.
docs/​xml/​Android.Media/​AudioTimestamp.xml Clarifies Parcelable creator and flag documentation.
docs/​xml/​Android.Media/​AudioSource.xml Links managed sources, streams, and permissions.
docs/​xml/​Android.Media/​AudioRoutingOnRoutingChangedEventArgs.xml Documents nullable routing objects.
docs/​xml/​Android.Media/​AudioRecordingConfiguration.xml Updates Parcelable references and flag wording.
docs/​xml/​Android.Media/​AudioRecord+PeriodicNotificationEventArgs.xml Documents nullable recorder values.
docs/​xml/​Android.Media/​AudioRecord+MarkerReachedEventArgs.xml Documents nullable recorder values.
docs/​xml/​Android.Media/​AudioRecord+IOnRoutingChangedListener.xml Clarifies nullability and routing bridge behavior.
docs/​xml/​Android.Media/​AudioRecord+IOnRecordPositionUpdateListener.xml Documents nullable callback parameters.
docs/​xml/​Android.Media/​AudioRecord+Builder.xml Clarifies privacy settings, construction, and API references.
docs/​xml/​Android.Media/​AudioRecord.xml Corrects callback threading and stopped-route guidance.
docs/​xml/​Android.Media/​AudioProfile.xml Clarifies JNI handling and Parcelable documentation.
docs/​xml/​Android.Media/​AudioPresentation.xml Updates Parcelable creator and flag references.
docs/​xml/​Android.Media/​AudioPlaybackConfiguration.xml Updates Parcelable creator and flag references.
docs/​xml/​Android.Media/​AudioPlaybackCaptureConfiguration+Builder.xml Describes filtering by usage rather than attributes.
docs/​xml/​Android.Media/​AudioPlaybackCaptureConfiguration.xml Documents incompatible scalar usage-property signatures.
docs/​xml/​Android.Media/​AudioMixerAttributes.xml Updates Parcelable creator and flag references.
docs/​xml/​Android.Media/​AudioMetadata+IKey.xml Clarifies Java value classes, including Boolean.
docs/​xml/​Android.Media/​AudioMetadata+Format.xml Clarifies bitrate semantics and JNI handling.
docs/​xml/​Android.Media/​AudioManager+AudioRecordingCallback.xml Corrects incoming JNI reference wording.
docs/​xml/​Android.Media/​AudioManager+AudioPlaybackCallback.xml Corrects incoming JNI reference wording.
docs/​xml/​Android.Media/​AudioManager.xml Corrects callback threading, version guidance, and references.
docs/​xml/​Android.Media/​AudioFormat+Builder.xml Updates channel-mask references and JNI wording.
docs/​xml/​Android.Media/​AudioFormat.xml Corrects constructor version guidance and Parcelable references.
docs/​xml/​Android.Media/​AudioFocusRequestClass+Builder.xml Clarifies callback threading and managed focus APIs.
docs/​xml/​Android.Media/​AudioFlags.xml Links managed low-latency configuration APIs.
docs/​xml/​Android.Media/​AudioDeviceCallback.xml Corrects incoming JNI reference wording.
docs/​xml/​Android.Media/​AudioDescriptor.xml Clarifies JNI handling and Parcelable documentation.
docs/​xml/​Android.Media/​AudioAttributes+Builder.xml Uses managed capture-policy, flag, and stream references.
docs/​xml/​Android.Media/​AudioAttributes.xml Updates Parcelable creator and descriptor references.
docs/​xml/​Android.Media/​ApplicationMediaCapabilities+Builder.xml Links managed HDR constants.
docs/​xml/​Android.Media/​ApplicationMediaCapabilities.xml Updates Parcelable creator and flag references.

Review effort: Balanced

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto

Copy link
Copy Markdown
Member

In response to @jonathanpeppers's request: The reviewed AudioManager looper/version claims and managed-signature changes look consistent. I am carrying the remaining review into the next scheduled pass: complete untruncated paragraphs in AudioFlags, AudioRecord+Builder, AudioTrack+Builder, AudioTrackPerformanceMode, CapturePolicies, DirectPlaybackSupport and DrmErrorCode; the later Parcel/transfer edits; and source correspondence for AudioRecord.cpp/AudioTrack.cpp routing after stop, callback nullability and JNI transfer ownership. My earlier diff display truncated long lines; there was no source-fetch error. These are gaps in my reviewer coverage, not defects found in this PR. I have not yet completed the final whole-PR blocker pass.

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

Reviewed the 46 Android.Media documentation changes, including managed references, callback/looper behavior, routing and JNI transfer semantics, against the managed signatures and relevant AOSP sources. The changes do not alter signatures or binding metadata. No blocking correctness issue found in static review.

@jonathanpeppers
jonathanpeppers merged commit cf7ffeb into main Nov 27, 2026
4 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-review-android-media-r061-666 branch November 27, 2026 08:24
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