Repository navigation
Complete Android.App.Backup documentation - #1193
Conversation
Fill 44 remaining documentation placeholders with reviewed source-backed text for managed task wrappers, backup state, transport flags, and restore properties. Co-authored-by: Copilot App <[email protected]>
|
@dalexsoto review |
There was a problem hiding this comment.
🟡 Changes recommended
The new asynchronous write result descriptions promise byte counts where the cited implementation returns status values, potentially misleading callers.
2 open issues
What changed in this PR
Completes the remaining documentation in Android.App.Backup, addressing issue #61 without changing API metadata or importer code.
Changes:
- Replaces 44 placeholders across nine XML files.
- Documents task wrappers, operation ordering, and object lifetimes.
- Adds property and parameter descriptions for backup quotas, transport flags, helper state, and restore data.
| File | Description |
|---|---|
| docs/xml/Android.App.Backup/IBackupHelperExtensions.xml | Documents helper task execution and state-descriptor handling. |
| docs/xml/Android.App.Backup/FullRestoreDataInput.xml | Describes restore property values. |
| docs/xml/Android.App.Backup/FullBackupDataOutput.xml | Describes quota and transport flag values. |
| docs/xml/Android.App.Backup/FileBackupHelperBase.xml | Documents writing helper state after restore. |
| docs/xml/Android.App.Backup/BackupTransportFlags.xml | Explains transport flags and their combinations. |
| docs/xml/Android.App.Backup/BackupManager.xml | Clarifies ancestral profile lookup parameters and results. |
| docs/xml/Android.App.Backup/BackupDataOutput.xml | Documents asynchronous writes, quotas, and transport flags. |
| docs/xml/Android.App.Backup/BackupDataInput.xml | Documents asynchronous reads and operation ordering. |
| docs/xml/Android.App.Backup/BackupAgent.xml | Documents asynchronous full-file backup and object lifetimes. |
Review effort: Balanced
dalexsoto
left a comment
There was a problem hiding this comment.
Reviewed all 9 changed documentation files and their material API/publication contracts, including a separate final blocker search.
Describe forwarded write status, not byte counts, in both async results (docs/xml/Android.App.Backup/BackupDataOutput.xml:356, docs/xml/Android.App.Backup/BackupDataOutput.xml:445)
Both newly authored returns descriptions promise byte counts, but the framework-backed operations complete with zero status after successful nonempty writes. Task.Run forwards the synchronous int result without converting it into a byte count. The synchronous Java Javadoc also says byte count, but its implementation and JNI/native writer demonstrably return status; copying that sentence does not establish the promised runtime contract.
For size > 0 a successful awaited WriteEntityDataAsync can return 0 after writing the entire requested chunk. A caller treating the documented result as progress can resend already-written data or never advance its write loop, violating the entity size declared in the header and corrupting the backup stream. Using the header result as the documented stream-byte count likewise undercounts bytes already emitted.
Fix: Change both new returns descriptions to the forwarded synchronous status (zero on successful framework writes), rather than bytes written. Do not change the wrapper/native APIs or demand native asynchronous I/O.
This is a static source-contract finding, not an executed runtime reproduction.
Document forwarded status values and zero-on-success native writes instead of byte counts. Cite the pinned native writer and warn against byte-count calculations. Co-authored-by: Copilot App <[email protected]>
dalexsoto
left a comment
There was a problem hiding this comment.
The prior consolidated writer-result blocker is fixed in both async methods: the new descriptions forward synchronous status, qualify zero-on-success to framework writes, and warn against byte-count retry/accounting without promising all errors throw.
Reviewed the complete 9-file documentation change and relevant API, reference and publication contracts. The backup descriptions match synchronous task results, operation lifetimes and native backup contracts. Existing documentation, attribution and API metadata are preserved, and no high-confidence blockers remain in the bounded static review.

Closes #61.
Fills all 44 remaining exact placeholders across nine Android.App.Backup XML files. The namespace file already has documentation. No placeholders remain.
The scoped importer preview found no eligible official imports and reported all 44 gaps. Both preview reports were reviewed. These gaps use authored, source-backed text after that coverage check, not guessed importer matches. Sources include the Android reference, AOSP framework revision
1cdfff555f4a21f71ccc978290e2e212e2f8b168, and .NET Java.Interop generator revision92b5d471f1e0f6164fc332b1f661b472f5cf3aad.Verification: all namespace XML parses; all 44 exact placeholders are filled; structural comparison preserves prior non-placeholder text and metadata;
git diff --checkpasses; final offline importer scan reports zero changes, skips, or errors. A separate Gemini 4 Argon review found no issues.Known baseline failure: the full importer self-test fails before these changes in
TestControlsTemplatesRangeSource, withactual pipeline preserves an old-layout list with authored code whose comment newline changed. This PR does not change the importer or attempt to fix that unrelated failure.