Skip to content

Fix documentation errors in Android.Widget.Inline and Android.Widget.PhotoPicker (R101, pass 3) - #1980

Merged
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-review-widget-inline-photopicker-docs-c1c
Nov 28, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-review-widget-inline-photopicker-docs-c1c

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 50fd3b03a19fe50e2911530a0fef88460ec72c43

Dimension Assessment Rationale
Change confidence 9/10 ↑ 4 one-line edits; each XML file parses; git diff --check passes.
↑ Each fix cites pinned source-37.2_r01 lines or FrameworksIndex lines.
↓ OpenPublishing.Build not yet observed.
Diagnosis confidence 9/10 ↑ Builder.setHighlightAlbumId throws only for null (EmbeddedPhotoPickerFeatureInfo.java:474-482); build() 753-771 has no check.
↓ The PhotoPicker service side is not in the pinned source.
Evidence fit 9/10 ↑ Each removed or changed claim maps to a specific line in the source or the API index.

Scope

Pass-3 review of AI-written text in docs/xml/Android.Widget.Inline and docs/xml/Android.Widget.PhotoPicker (25 files, text changed in 86f7744a1..origin/main). 489 channels were reviewed one at a time against Android source-37.2_r01. Previous passes: #1609, #1784.

Fixes

  1. InlineContentView.xml and EmbeddedPhotoPickerProviderFactory.xml, transfer param: "Specifies whether ownership of the JNI reference transfers to this instance" is wrong for Java.Lang.Object types. The peer makes its own reference. transfer selects deletion of the incoming reference and peer registration (dotnet/android@9bc18c75 Object.cs:110-118, JNIEnv.cs:360-393). The wording is the same as in Fix documentation errors in Android.App.PermissionUI (R060, pass 3) #1941.
  2. EmbeddedPhotoPickerFeatureInfo+Builder.xml, SetHighlightAlbumId remarks: removed two sentences that say an IllegalArgumentException is thrown for other album ids and when both highlight options are used. setHighlightAlbumId throws only for null (EmbeddedPhotoPickerFeatureInfo.java:474-482). build() (753-771) and EmbeddedPhotoPickerProviderFactory.openSession (156-260) do not validate these cases. Service errors go to onSessionError (EmbeddedPhotoPickerClientWrapper.java:72-75).
  3. AspectRatio.xml remarks: added "Starting with API level 37,". The AspectRatio enum is in the API 36 docs (FrameworksIndex/net-android-36.0.xml:121550), but EmbeddedPhotoPickerUiCustomizationParams.Builder.SetAspectRatio is in API 37 only (net-android-37.0.xml:123561,123564). This was a pass-2 follow-up from @dalexsoto.

Uncertain findings

None. Note only: PhotoPickerSelectionParams.Builder.setMinVideoDuration rejects zero (PhotoPickerSelectionParams.java:328-329), but its Javadoc says "negative". The current doc text makes no claim about this, so no edit was made.

Checks

  • All changed XML files parse. git diff --check passes. Encoding, BOM, and line endings are unchanged.
  • No changes to index.xml, _filter.xml, or FrameworksIndex.
  • Rubber-duck review (gemini-4-argon): no blocking issues.

…PhotoPicker (R101, pass 3)

- Correct transfer parameter wording for Object-derived constructors.
- Remove unsupported IllegalArgumentException claims from SetHighlightAlbumId.
- State that the embedded picker use of AspectRatio starts with API level 37.

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

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

The documentation updates have no active review issues.

No open issues 🎉

What changed in this PR

This documentation-only follow-up corrects API behavior and availability descriptions in the Android Inline and Photo Picker managed bindings.

Changes:

  • Clarifies JNI reference release and peer-registration behavior in two constructor parameters.
  • Removes unsupported exception claims from SetHighlightAlbumId remarks.
  • Identifies API level 37 as the introduction of the embedded picker’s enum-based aspect-ratio setter.
File Description
docs/​xml/​Android.Widget.PhotoPicker/​EmbeddedPhotoPickerProviderFactory.xml Corrects the JNI transfer parameter description.
docs/​xml/​Android.Widget.PhotoPicker/​EmbeddedPhotoPickerFeatureInfo+Builder.xml Removes unsupported highlight-validation exception claims.
docs/​xml/​Android.Widget.PhotoPicker/​AspectRatio.xml Adds the API-level qualification for the embedded picker setter.
docs/​xml/​Android.Widget.Inline/​InlineContentView.xml Corrects the JNI transfer parameter description.

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 JNI transfer wording checks out against the runtime. Two source checks remain: EmbeddedPhotoPickerFeatureInfo+Builder.xml removes exception claims that I could not verify because the attempted core/java/android/widget/photopicker/EmbeddedPhotoPickerFeatureInfo.java paths returned HTTP 404 in the Android source branches and mirror; AspectRatio.xml adds an API 37 boundary that I have not yet checked against the cited net-android-36.0.xml:121550 and net-android-37.0.xml:123561,123564 entries. I am retaining these exact checks for the next pass. This is a reviewer coverage gap, not an identified defect in this PR.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto: here is the evidence for the two checks that are still open.

1. SetHighlightAlbumId exception claims. The pinned source is the Android SDK sources package source-37.2_r01 (sources/android-37.2), at android/widget/photopicker/EmbeddedPhotoPickerFeatureInfo.java. This class is not in frameworks/base/core/java, which explains the 404. Lines 474-482:

public Builder setHighlightAlbumId(
        @NonNull @PickImagesHighlightAlbum String highlightAlbumId
) {
    if (highlightAlbumId == null) {
        throw new IllegalArgumentException("Input highlight album cannot be null");
    }
    mHighlightAlbumId = highlightAlbumId;
    return this;
}

build() (lines 753-771) only calls the constructor and does no validation. EmbeddedPhotoPickerProviderFactory.openSession (lines 156-260) does not validate these fields either. Service-side errors go to EmbeddedPhotoPickerClient.onSessionError (EmbeddedPhotoPickerClientWrapper.java:72-75) and are not thrown. So nothing in the pinned code throws IllegalArgumentException for "other values" or for "using both". The null case is still documented in the <exception> text.

2. AspectRatio API 37 boundary.

  • docs/xml/FrameworksIndex/net-android-36.0.xml:121550: <Type Name="Android.Widget.PhotoPicker.AspectRatio" ...>. The 36.0 index has 0 entries for EmbeddedPhotoPickerUiCustomizationParams.
  • net-android-37.0.xml:123561: <Type Name="Android.Widget.PhotoPicker.EmbeddedPhotoPickerUiCustomizationParams/Builder" ...>. Line 123564: <Member Id="M:...EmbeddedPhotoPickerUiCustomizationParams.Builder.SetAspectRatio(Android.Widget.PhotoPicker.AspectRatio)" />.
  • EmbeddedPhotoPickerUiCustomizationParams+Builder.xml has ApiSince=37 at lines 16 and 143.

The AspectRatio remarks are shared with the 36.0 docs, but the member they name exists only in 37.0, so the "Starting with API level 37" qualifier is needed.

@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 all four documentation changes and the relevant JNI ownership, pinned Android 37.2 source, and API 36/37 index context. The highlight-exception corrections and API-level qualification match the inspected implementation and availability evidence; no blocking issues found.

@jonathanpeppers
jonathanpeppers merged commit 36e7630 into main Nov 28, 2026
4 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-review-widget-inline-photopicker-docs-c1c branch November 28, 2026 13:55
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