Skip to content

Fix documentation errors in Android.Health.Connect (R093, pass 3) - #1972

Merged
jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-review-health-connect-docs-r093
Nov 28, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-review-health-connect-docs-r093

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: d23f6f72071f84e47d50c299ecbe5354ac63ef43

Dimension Assessment Rationale
Change confidence 9.5/10 ↑ Two-line change; same fix as #1958.
↑ Both XML files parse; git diff --check clean.
↓ OpenPublishing.Build pending.
Diagnosis confidence 9.5/10 ↑ dotnet/android@9bc18c75 Object.cs:110-118, Throwable.cs:99-110 and JNIEnv.cs:360-393 show transfer selects reference release (and registration for Object), not a yes/no ownership transfer.
↑ Copilot finding on Throwable fixed.
Evidence fit 9/10 ↑ The old text states a boolean ownership model that the pinned code does not implement.

Pass-3 review of item R093: AI-written text in 25 Android.Health.Connect files (text changed since 86f7744a1). 317 in-scope channels reviewed against platform sources and the managed pin dotnet/android@9bc18c75.

Fixes (2)

Constructor (IntPtr, JniHandleOwnership), param transfer. Old text in both files: "Specifies whether ownership of the JNI reference transfers to this instance." Same error as #1958.

  • HealthConnectManager.xml (derives from Java.Lang.Object). New: "Specifies how the runtime handles the JNI reference, including its release and peer registration." Evidence (dotnet/android@9bc18c75): src/Mono.Android/Java.Lang/Object.cs:110-118 (SetHandle passes ToJniObjectReferenceOptions(transfer) to ConstructPeer, then calls JNIEnv.DeleteRef(value, transfer)); src/Mono.Android/Android.Runtime/JNIEnv.cs:360-372 (DeleteRef deletes a local or global reference from the transfer bits) and :374-393 (DoNotRegister maps to CopyAndDoNotRegister).
  • HealthConnectException.xml (derives from Java.Lang.Throwable). New: "Specifies how the runtime releases the incoming JNI reference after the instance copies it." Evidence: src/Mono.Android/Java.Lang/Throwable.cs:16-23 (constructor calls SetHandle) and :99-110 (always Copy; transfer goes only to JNIEnv.DeleteRef); JNIEnv.cs:360-372.

Uncertain findings (not changed)

  1. AggregateRecordsResponse, AggregateRecordsGroupedByDurationResponse, AggregateRecordsGroupedByPeriodResponse GetDataOrigins: text says "data origins that contributed to the aggregation result". The public Javadoc ({@link DataOrigin}s for the underlying aggregation record) differs, but AggregateResult.java:70 says "contributed to the aggregation result" and getDataOriginsInternal (AggregateRecordsResponse.java:81-91) returns that set. Unpinned HealthFitness service code (android17 a292a16a, AggregateRecordRequest.java:146-150,330-345) computes one request-wide set, which it calls an approximation. No pinned source decides it.
  2. HealthConnectManager.CreateMatchmakingIntent remarks: "How to launch this IntentThis intent…" has no space. It comes from the Javadoc <b> markup at HealthConnectManager.java:3970.
  3. DeviceDataTypeSource Creator, IsAvailable, IsUserEnabled summaries repeat the value text (style only).

Checks

  • Both changed XML files parse; git diff --check clean; no To be added added; index.xml, _filter.xml, FrameworksIndex untouched.
  • Rubber-duck reviews (gemini-4-argon) on 4ed721c and d23f6f7: fixes and uncertain classification confirmed; citation gaps fixed in the ledger.
  • Per-channel ledger (317 rows; current text read from the XML at the head commit) kept in session storage.

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

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 constructor documentation incorrectly implies that DoNotRegister can suppress peer registration, when transfer only controls release of the incoming reference.

1 open issue
What changed in this PR

This documentation-only PR revises JNI constructor parameter descriptions in Android.Health.Connect, continuing the ownership-wording corrections from #1958.

Changes:

  • Replaces boolean ownership-transfer wording with runtime reference-handling descriptions in two constructors.
  • Leaves API signatures and runtime behavior unchanged.
File Description
docs/​xml/​Android.Health.Connect/​HealthConnectManager.xml Revises the constructor’s transfer parameter documentation.
docs/​xml/​Android.Health.Connect/​HealthConnectException.xml Revises the exception constructor’s transfer parameter documentation.

Review effort: Balanced

Throwable.SetHandle always copies the reference; transfer only controls its release.

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 are reported for the constructor documentation 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.

The two constructor parameter descriptions now match the pinned managed implementation: the exception copies its JNI reference before releasing the incoming reference, while the manager also honors peer-registration options. The generated IntPtr/ownership constructor forwards these options unchanged. No blocking issue found in these changes.

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