Skip to content

Fix documentation errors in Android.OS.Ext (R074, pass 3) - #1955

Merged
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-review-android-os-subnamespaces-r074
Nov 28, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-review-android-os-subnamespaces-r074

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 65a54c11ca61870ae12eec799a86a94aa9503f02

Dimension Assessment Rationale
Change confidence 9.5/10 ↑ New text and exception tag follow SdkExtensions.java lines 124, 127-128 and 155.
↑ XML parses; git diff --check is clean; the cref target exists in BuildVersionCodes.xml.
↑ gemini-4-argon review found no issues.
↓ Copilot review is not done yet.
Diagnosis confidence 9.5/10 ↑ Source line 127-128 throws for identifiers below VERSION_CODES.R, so the old text "zero when no version is available for that identifier" is wrong for those identifiers.
Evidence fit 9/10 ↑ Found by the pass-3 line-by-line review of all 434 AI-changed channels in this scope.
↓ No user report; the error comes from the review only.

Pass-3 review of campaign item R074: Android.OS.Ext, Android.OS.Flagging, Android.OS.Health, Android.OS.MultiSensory, Android.OS.Storage and Android.OS.Storage.Operations (36 files, 592 AI-changed channels, 434 review rows).

Fix

M:Android.OS.Ext.SdkExtensions.GetExtensionVersion(System.Int32) in docs/xml/Android.OS.Ext/SdkExtensions.xml:

  • The old <returns> text said the method returns zero "when no version is available for that identifier". This is wrong for identifiers below VERSION_CODES.R. AOSP SdkExtensions.java has @throws IllegalArgumentException if extension is not a valid extension (line 124), and the method throws when extension < VERSION_CODES.R (lines 127-128). The method returns 0 only for identifiers at R or higher that have no version (line 155; the system properties default to 0 at lines 58-66).
  • New <returns>: "The version of the specified extension, or 0 when the extension identifier is BuildVersionCodes.R or higher and the device has no version for it."
  • Added <exception cref="T:Java.Lang.IllegalArgumentException">, with the @throws text from line 124. The placement follows Environment.xml.
  • The developer.android.com page also lists the throw.

Uncertain items

None. The R054 note about AppDataFileSource relative paths does not apply here: FileOperationResult.Source only names AppDataFileSource as an example, word for word from FileOperationResult.java:190-191.

Checks

  • Version claims: the only version claim in scope was the fix above. Flagging (ApiSince=36) and MultiSensory (ApiSince=37) docs make no availability claims.
  • Permission claims: StorageManager.GetStorageVolumesIncludingSharedProfiles says MANAGE_EXTERNAL_STORAGE, which matches @RequiresPermission at StorageManager.java:1382.
  • The XML parses, git diff --check is clean, and the change adds no To be added placeholders.

…s 3)

SdkExtensions.java:124,127-128 throws IllegalArgumentException for identifiers below VERSION_CODES.R. The method returns 0 only for identifiers at R or higher with no version (line 155). Add the missing exception tag.

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

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 recorded for this documentation-only clarification of extension-version return values and invalid-identifier exceptions.

No open issues 🎉

What changed in this PR

Corrects the SdkExtensions.GetExtensionVersion(int) API documentation to distinguish unavailable extension versions from invalid identifiers. No runtime code changes are included.

Changes:

  • Clarifies that zero is returned for identifiers at BuildVersionCodes.R or higher when no version is available.
  • Documents IllegalArgumentException for invalid extension identifiers.
File Description
docs/​xml/​Android.OS.Ext/​SdkExtensions.xml Corrects return-value documentation and adds the exception contract.

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.

Reviewed the GetExtensionVersion documentation against AOSP implementation branches and the unchanged binding signature. The return-value and exception descriptions and cref targets are correct; no blocking issues found. Static source review only.

@jonathanpeppers
jonathanpeppers merged commit 08781ec into main Nov 28, 2026
4 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-review-android-os-subnamespaces-r074 branch November 28, 2026 02: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