Repository navigation
Fix documentation errors in Android.App.PermissionUI (R060, pass 3) - #1941
Conversation
…rFactory (R060) The activation constructor always copies the JNI reference and releases the passed handle as the transfer value specifies, so ownership does not transfer to the instance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the documentation-only clarification of the JNI constructor’s transfer parameter.
No open issues 🎉
What changed in this PR
Corrects the JNI constructor documentation for LocationButtonProviderFactory in the Android API reference. This is a documentation-only change; API behavior is unchanged.
Changes:
- Replaces ownership-transfer wording with a description covering JNI reference release and peer registration.
| File | Description |
|---|---|
| docs/xml/Android.App.PermissionUI/LocationButtonProviderFactory.xml | Clarifies the constructor’s transfer parameter description. |
Review effort: Balanced
LocationButtonClientWrapper reports a dialog start failure through onSessionError without closing the session, so the remarks no longer say the session is always closed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@dalexsoto review |
|
In response to @jonathanpeppers's request: I verified the JNI |
dalexsoto
left a comment
There was a problem hiding this comment.
Reviewed both documentation changes and their binding/runtime context. The JNI ownership parameter now describes reference release and peer registration accurately. The OnSessionError clarification matches the Android 37.2 implementation: remote/connection failures close the session, while a dialog-start failure reports the error without closing it. No blocking issues found.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
273a2d823e7fa8d9fdedbcae063caae3016d32dc↑ Fix 2 matches LocationButtonClientWrapper.java:116-118 and LocationButtonProviderFactory.java:307-326.
↑ XML parses;
git diff --checkpasses; gemini-4-argon review of each fix commit found no issues.↓ OpenPublishing.Build result for the new head not yet inspected.
↑ The dialog-start failure path calls onSessionError with no close() and no onSessionClosed.
Scope
Pass-3 review item R060. All 249 AI-changed Docs channels (since 86f7744) in the 10 remaining
Android.App.PermissionUIfiles were checked against pinned sources:source-37.2_r01.zip(android/app/permissionui/*.java, android/os/Parcelable.java) and dotnet/android@9bc18c75.Result: 247 correct, 2 fixed, 0 uncertain.
The 10
Android.App.PersonalContextandAndroid.App.PersonalContext.Insight.Interactionfiles listed for this item no longer exist on main (removed by #1594). No action was taken for them.Fixes
LocationButtonProviderFactory(IntPtr, JniHandleOwnership),transferparam: "Specifies whether ownership of the JNI reference transfers to this instance." is wrong.JNIEnv.ToJniObjectReferenceOptions(dotnet/android@9bc18c75 JNIEnv.cs:388-392) always setsCopy, andObject.SetHandle(Object.cs:110-118) releases the passed handle byDeleteRef(value, transfer)(JNIEnv.cs:360-372). Changed to the established wording "Specifies how the runtime handles the JNI reference, including its release and peer registration."ILocationButtonClient.OnSessionErrorremarks: "The session is automatically closed before this callback is invoked" repeats LocationButtonClient.java:103, but the implementation does not do this on all paths. WhenstartIntentSenderfails, LocationButtonClientWrapper.java:116-118 callsonSessionErrorwithoutclose()oronSessionClosed. The connection-lost path closes first (LocationButtonProviderFactory.java:307-326), and the remote-error path removes the session record (LocationButtonClientWrapper.java:98). The text now says that the session is closed for those errors, and that it is not closed when the permission dialog cannot be started.Kept as correct after review
"All callbacks on this interface are invoked serially..." (LocationButtonClient.java:33). The implementation decides this: the factory wraps the client executor in one
SerialExecutorfor each session (LocationButtonProviderFactory.java:131-132, 474-502), and all wrapper callbacks and the disconnect path use it (LocationButtonClientWrapper.java:75, 87, 99, 118). The raw executor is used only byreportSessionErrorSerialized(LocationButtonProviderFactory.java:251-254), for a request that never opened a session, so no other callback can overlap it.Pass 2
#1749 changed "in to" to "into" in
LocationButtonRequest.WriteToParcel. Checked: correct.Source excerpts (source-37.2_r01.zip, SHA256 9d637c3a...4e84)
These excerpts let reviewers check the two lifecycle claims without access to the Android sources.
src/android/app/permissionui/LocationButtonClientWrapper.java:src/android/app/permissionui/LocationButtonProviderFactory.java:Checks
git diff --checkpasses; no new placeholders; CRLF kept.