Repository navigation
Fix documentation errors in Android.Health.Connect (R093, pass 3) - #1972
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 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>
|
@dalexsoto review |
dalexsoto
left a comment
There was a problem hiding this comment.
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.

Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
d23f6f72071f84e47d50c299ecbe5354ac63ef43↑ Both XML files parse;
git diff --checkclean.↓ OpenPublishing.Build pending.
Object.cs:110-118,Throwable.cs:99-110andJNIEnv.cs:360-393showtransferselects reference release (and registration forObject), not a yes/no ownership transfer.↑ Copilot finding on
Throwablefixed.Pass-3 review of item R093: AI-written text in 25
Android.Health.Connectfiles (text changed since86f7744a1). 317 in-scope channels reviewed against platform sources and the managed pin dotnet/android@9bc18c75.Fixes (2)
Constructor
(IntPtr, JniHandleOwnership), paramtransfer. Old text in both files: "Specifies whether ownership of the JNI reference transfers to this instance." Same error as #1958.HealthConnectManager.xml(derives fromJava.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(SetHandlepassesToJniObjectReferenceOptions(transfer)toConstructPeer, then callsJNIEnv.DeleteRef(value, transfer));src/Mono.Android/Android.Runtime/JNIEnv.cs:360-372(DeleteRefdeletes a local or global reference from thetransferbits) and:374-393(DoNotRegistermaps toCopyAndDoNotRegister).HealthConnectException.xml(derives fromJava.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 callsSetHandle) and:99-110(alwaysCopy;transfergoes only toJNIEnv.DeleteRef);JNIEnv.cs:360-372.Uncertain findings (not changed)
AggregateRecordsResponse,AggregateRecordsGroupedByDurationResponse,AggregateRecordsGroupedByPeriodResponseGetDataOrigins: text says "data origins that contributed to the aggregation result". The public Javadoc ({@link DataOrigin}s for the underlying aggregation record) differs, butAggregateResult.java:70says "contributed to the aggregation result" andgetDataOriginsInternal(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.HealthConnectManager.CreateMatchmakingIntentremarks: "How to launch this IntentThis intent…" has no space. It comes from the Javadoc<b>markup atHealthConnectManager.java:3970.DeviceDataTypeSourceCreator,IsAvailable,IsUserEnabledsummaries repeat the value text (style only).Checks
git diff --checkclean; noTo be addedadded;index.xml,_filter.xml, FrameworksIndex untouched.