Skip to content

Fix PDF and text documentation errors (R064, pass 3) - #1946

Merged
jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-review-pdf-text-docs-r064
Nov 27, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-review-pdf-text-docs-r064

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 50dbf01ada71c2bb67a2c122c48d520db56d9a0a

Dimension Assessment Rationale
Change confidence 8/10 ↑ Reviewed the scoped documentation against pinned sources; XML, links, changed examples, and OpenPublishing.Build passed.
↑ Gemini reviewed the corrected head.
↓ The platform 37.2 r02 implementation was not available.
Diagnosis confidence 9/10 ↑ Pinned source and managed signatures establish the corrected behavior for the reviewed implementations.
↓ Runtime behavior was not tested on devices.
Evidence fit Unknown ↓ No specific symptom or reproduction was reported.

Scope

Third-pass review of the 37 files in Android.Graphics.Pdf.Models, Android.Graphics.Pdf.Models.Selection, and Android.Graphics.Text assigned to R064. The personal ledger covers all 152 in-scope AI-changed documentation blocks and all 384 changed channels; 61 binding-runtime boilerplate blocks were excluded. The review found 62 AI-changed channels to fix. Two older channels in the same FormWidgetInfo.WidgetIndex block also changed because they contradicted the corrected value. No placeholders were present before or after.

I rechecked pass-2 #1753, including its review: its constant-owner corrections and citation removals are supported. Its two zero-value questions remain qualified below.

Changes and evidence

  • Correct widget-index descriptions and edit-record guidance. The Android 15 and Android 16 sources use the page annotation index; Android 17 calculates an index from nonhidden widgets and maps it to an annotation index. A type-filtered query can count a skipped unsupported widget that the edit lookup omits. This source-level edge case was not reproduced on a device. Because the PDF implementation can be updated independently, the wording does not infer a fixed OS-version boundary.
  • Correct widget text and accessibility-label descriptions, builder null/error timing, and index range validation. See PDF field values, JNI string conversion, and SDK FormWidgetInfo.java:377-382 and FormEditRecord.java:233-317.
  • Correct automatic line-break style and word-style behavior, including the first locale, Korean and Japanese selection, and both line-count checks. See locale selection, style resolution, word-style resolution, and the greedy retry.
  • Correct descriptions of line-breaking strategy, tab handling, hyphenation, justification, indents, and invalid input assumptions. Minikin's dispatch selects greedy breaking for tabs; the SDK LineBreaker.java:197-247, 505-509 and MeasuredText.java:390-428 supply the managed configuration facts.
  • Correct WriteToParcel flags and DescribeContents results using SDK ListItem.java:95-104, PageMatchBounds.java:99-108, and LineBreakConfig.java:627-636. Correct JNI reference ownership using Java.Lang.Object and JNIEnv.
  • Repair managed links and integer-versus-enum wording, and convert four examples labelled as Java from Kotlin syntax to Java.

The platform 37.2 r01 SDK source archive used above has SHA-256 9d637c3af6654a2f1b696b3d19c54bb77e38df2b0106116934703f314b3d4e84. The bindings target r02; the archive alone does not establish r02 implementation behavior.

Uncertain findings

  • FormWidgetInfo.Builder.SetFontSize: the SDK r01 and Android 15-17 sources check fontSize > 0, rejecting zero and NaN. The current Android reference permits zero. The r02 implementation was not found, so the corrected text recommends a positive value and identifies the observed rejection without claiming all implementations reject zero.
  • FormWidgetInfo.Builder.SetMaxLength: the SDK r01 and Android 15-17 sources check maxLength > 0, while the current Android reference permits zero. The r02 implementation was not found; the wording states the observed difference.

Checks and follow-ups

  • Parsed all 37 scoped XML files. Confirmed unchanged bytes outside <Docs>, preserved BOMs and line endings, and preserved API metadata. git diff --check and OpenPublishing.Build passed.
  • All 32 new cref values resolve to exact prefixed DocIds. Four changed Java examples compile against the installed 37.2 r02 android.jar (SHA-256 2507cf762abe2171a8cb3c289837fc71f2e66e598f396f1cc10bb7dc10020329).
  • Compared attributed Javadoc by owner and JNI signature; personally reviewed every changed channel, including nonexact and unattributed text. The personal ledger has 384 of 384 channels and 152 of 152 blocks.
  • Independent gemini-4-argon review identified a filtered-widget index edge case; the correction was reviewed again with no remaining findings. The local usage log confirms the model on both review turns.
  • Follow-up, outside this pass's edit scope: pre-AI class examples in LineBreaker.xml contain errors including appednStyleRun and a duplicate c variable; MeasuredText+Builder.xml uses text.length rather than text.length(). Both examples also contain escaped code markup.

jonathanpeppers and others added 2 commits November 27, 2026 09:18
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 15:28
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) November 27, 2026 15:28

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 documentation-only updates to PDF form and text-layout guidance.

No open issues 🎉

What changed in this PR

This documentation-only follow-up to #1753 corrects PDF form and text-layout guidance in the .NET Android API reference without changing API metadata or runtime code.

Changes:

  • Clarify PDF widget indices, field values, and builder validation, including implementation-dependent behavior.
  • Correct line-breaking, locale, hyphenation, and justification descriptions; repair managed links and four Java examples.
  • Clarify JNI reference handling, parcel flags, and descriptor-reporting results.
File Description
docs/​xml/​Android.Graphics.Text/​TextRunShaper.xml Clarifies JNI reference release and peer registration.
docs/​xml/​Android.Graphics.Text/​MeasuredText+Builder.xml Refines computation guidance and managed API links.
docs/​xml/​Android.Graphics.Text/​MeasuredText.xml Clarifies JNI reference handling.
docs/​xml/​Android.Graphics.Text/​LineBreakWordStyle.xml Corrects automatic phrase-breaking behavior and Java syntax.
docs/​xml/​Android.Graphics.Text/​LineBreakStyle.xml Corrects locale selection, style descriptions, and examples.
docs/​xml/​Android.Graphics.Text/​LineBreakHyphenation.xml Repairs managed links and the merge example.
docs/​xml/​Android.Graphics.Text/​LineBreaker+Result.xml Clarifies JNI reference handling.
docs/​xml/​Android.Graphics.Text/​LineBreaker+ParagraphConstraints.xml Clarifies numeric input guidance and tab-stop results.
docs/​xml/​Android.Graphics.Text/​LineBreaker+Builder.xml Clarifies defaults, empty indents, and justification behavior.
docs/​xml/​Android.Graphics.Text/​LineBreaker.xml Clarifies JNI reference handling.
docs/​xml/​Android.Graphics.Text/​LineBreakConfig+Builder.xml Repairs Java syntax and integer-versus-enum guidance.
docs/​xml/​Android.Graphics.Text/​LineBreakConfig.xml Documents zero descriptor results and unused parcel flags.
docs/​xml/​Android.Graphics.Text/​JustificationMode.xml Revises the justification summary.
docs/​xml/​Android.Graphics.Text/​BreakStrategy.xml Documents tab-triggered greedy breaking and hyphenation conditions.
docs/​xml/​Android.Graphics.Pdf.Models/​PageMatchBounds.xml Clarifies highlight responsibilities and unused parcel flags.
docs/​xml/​Android.Graphics.Pdf.Models/​ListItem.xml Documents unused parcel flags.
docs/​xml/​Android.Graphics.Pdf.Models/​FormWidgetInfo+Builder.xml Clarifies index validation and implementation-dependent zero rejection.
docs/​xml/​Android.Graphics.Pdf.Models/​FormWidgetInfo.xml Corrects field-value, label, and widget-index descriptions.
docs/​xml/​Android.Graphics.Pdf.Models/​FormEditRecord+Builder.xml Clarifies target indices and null-validation timing.
docs/​xml/​Android.Graphics.Pdf.Models/​FormEditRecord.xml Removes the annotation-array assumption from index documentation.

Review effort: Balanced

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto

Copy link
Copy Markdown
Member

In response to @jonathanpeppers's request: My remaining checks are the PDF form-builder defaults and validation (FormEditRecord+Builder.xml, FormWidgetInfo+Builder.xml), PDF result/selection contracts (FormEditRecord.xml, FormWidgetInfo.xml, ListItem.xml, PageMatchBounds.xml), and the 14 changed Android.Graphics.Text files against AOSP API-version declarations and implementations. Those source comparisons and the final full-diff pass are not complete yet. No source-fetch error occurred; this is a reviewer coverage gap, not an identified PR defect. These checks are carried into the next scheduled 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.

Approving 50dbf01. I checked all 20 changed documentation files against the AOSP sources.

  • PDF: The FormWidgetInfo.Builder constructor text matches the source: it null-checks widgetRect, textValue and accessibilityLabel but doesn't range-check widgetIndex. The hedged zero/NaN wording for SetFontSize/SetMaxLength and the WriteToParcel/DescribeContents/nullable-getter text are accurate.
  • Text layout: The LineBreaker, LineBreakConfig, LineBreakStyle/LineBreakWordStyle and MeasuredText.Builder docs match LineBreakConfig.java, MeasuredText.java and minikin. That covers the unspecified-style resolution (None when the app targets SDK 34 or lower, Auto when it targets SDK 35 or higher), the run-coverage and builder-reuse rules, and the hyphenation and layout defaults.

Only <Docs> content changes, so the API surface is unchanged. Static review only; I didn't run any builds or tests.

@jonathanpeppers
jonathanpeppers merged commit 7c7936e into main Nov 27, 2026
4 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-review-pdf-text-docs-r064 branch November 27, 2026 18: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