Skip to content

Fix documentation errors in Android.Content (R099, pass 3) - #1979

Merged
jonathanpeppers merged 3 commits into
mainfrom
jonathanpeppers-review-android-content-r099-pass3
Nov 28, 2026
Merged

jonathanpeppers merged 3 commits into
mainfrom
jonathanpeppers-review-android-content-r099-pass3

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: a155200ff77ad9c626f79d805b5c693699236a92

Dimension Assessment Rationale
Change confidence 9/10 ↑ Each fix cites a pinned AOSP r01 or dotnet/android@9bc18c75 source line.
↑ gemini-4-argon rubber-duck review confirmed all 8 change groups; a second gemini-4-argon review confirmed the IsUiContext fix and checked every onIncorrectContextUsed caller; a third confirmed the matching remarks fix.
↑ All changed XML parses; git diff --check is clean; 20 lines changed, bytes and BOM kept.
↓ Bindings follow platform r02; pinned archive is r01.

Scope

Pass-3 review item R099: 77 files in docs/xml/Android.Content. I reviewed only text changed in git diff 86f7744a1 origin/main. Ledger: 1536 channels (1342 correct, 12 fix rows here, 3 uncertain, 174 deferred boilerplate).

Fixes

Member Error Evidence
AttributionSource.Builder.SetPid summary and remarks Said the PID always defaults to INVALID_PID. Builder(AttributionSource) copies the PID of the source. AttributionSource.java:640-643, 651-658
ContentProvider.OnLowMemory remarks Said the method is called on low memory. Since API 34 the system never calls it. ComponentCallbacks.java:58-60
ContentValues.GetAsBoolean/Byte/Double/Float/Integer/Long/Short returns (7) Said "or null". The C# methods return value types; a null Java result causes an exception. ContentValues.java:321-471; dotnet/android@9bc18c75 ContentValues.cs:10-114
Context.UpdateBindingParams.Flags value Said "cannot be null". getFlags() returns null for an unbind request. Context.java:906-918, 978-982
Context.UpdateableFlags remarks Listed BIND_ABOVE_CLIENT. BIND_UPDATEABLE_FLAGS does not include it. Context.java:798-804
ContextWrapper.CreateContextForSplit summary Said each call returns a new Context. Without isolated split loading, it returns the base context. ContextImpl.java:3176-3180
ContextWrapper.GetSystemService remarks Said WALLPAPER_SERVICE returns a WallpaperService. The registry returns WallpaperManager. SystemServiceRegistry.java:1037-1038
FileCreationMode.WorldReadable/WorldWriteable summary Said the mode throws starting from N on all apps. It throws only when the app targets N or higher. ContextImpl.java:4153-4161
Context.IsUiContext value and remarks Said non-UI access "throws Violation". StrictMode reports the violation through the VM policy penalties (log, dropbox, death, listener) and does not throw it. StrictMode.java:2713-2715, 2900-2960

Uncertain findings (not changed)

  • AsyncTaskLoader.CancelLoad: Loader contract return text vs. AsyncTaskLoader behavior for a waiting task.
  • ContextParams.Builder copy ctor: pre-AI text says it inherits all sub-parameters; outside the AI-changed span.
  • ContextWrapper.BindService: @return says false without permission; @throws says SecurityException. The ActivityManager result mapping is not in pinned sources.

Checks

  • Each changed XML file parses.
  • git diff --check is clean.
  • No edits to index.xml, _filter.xml, or FrameworksIndex.
  • No AI-changed text in scope has the wrong transfer parameter wording.

Correct AI-added text that pinned AOSP sources contradict: AttributionSource.Builder PID default, ContentProvider.OnLowMemory API 34 note, ContentValues GetAs* null returns, UpdateBindingParams.Flags nullability, UpdateableFlags list, ContextWrapper.CreateContextForSplit and WALLPAPER_SERVICE, FileCreationMode world-access target SDK qualifier.

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

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 were identified for this documentation-only update.

No open issues 🎉

What changed in this PR

This documentation-only update corrects Android.Content API descriptions to better reflect Android platform behavior and .NET binding contracts. No runtime code changes are included.

Changes:

  • Clarifies PID defaults, binding flags, split-context behavior, and the wallpaper service return type.
  • Corrects seven ContentValues return descriptions to explain exceptions when Java returns null.
  • Documents API-level and target-SDK conditions for low-memory callbacks and world-accessible file modes.
File Description
docs/​xml/​Android.Content/​FileCreationMode.xml Clarifies target-SDK conditions for security exceptions.
docs/​xml/​Android.Content/​ContextWrapper.xml Corrects split-context behavior and wallpaper service type.
docs/​xml/​Android.Content/​Context+UpdateBindingParams.xml Documents null flags for unbind requests.
docs/​xml/​Android.Content/​Context.xml Removes an unsupported updateable binding flag.
docs/​xml/​Android.Content/​ContentValues.xml Clarifies non-nullable managed return behavior.
docs/​xml/​Android.Content/​ContentProvider.xml Notes that low-memory callbacks stop at API 34.
docs/​xml/​Android.Content/​AttributionSource+Builder.xml Distinguishes default PID behavior from copied-source behavior.

Review effort: Balanced

StrictMode reports IncorrectContextUseViolation through VmPolicy penalties and does not throw it (StrictMode.java:2713-2715, 2900-2960).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

The property’s updated value description conflicts with its unchanged remarks about whether StrictMode throws a violation, leaving contradictory guidance in the published API documentation.

1 open issue

Review effort: Balanced

Comment thread docs/xml/Android.Content/Context.xml Resolved
The remarks also said the access throws a Violation. StrictMode reports it through VmPolicy penalties (StrictMode.java:2713-2715, 2900-2960).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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 this documentation-only update to Android.Content API descriptions.

No open issues 🎉

1 resolved since last review

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 source checks are not finished for ContentValues.GetAs* null/exception behavior (managed return types and the pinned JNI boxed-value conversion), UpdateBindingParams.Flags nullability, and the platform-version claims in Context, ContextWrapper, ContentProvider, AttributionSource.Builder, and FileCreationMode. The remaining seven-file review is deferred to the next scheduled pass. This is a reviewer coverage gap, not a defect identified in the PR; no source-tool failure or blocking finding was established.

@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 seven doc corrections at a155200 against the Android 17 platform source (frameworks/base android-17.0.0_r1 Context.java and the previously cited AOSP/dotnet/android sources); the corrections match the implementation. LGTM.

@jonathanpeppers
jonathanpeppers merged commit 5274e7b into main Nov 28, 2026
4 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-review-android-content-r099-pass3 branch November 28, 2026 17:24
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