Skip to content

Complete Android.App.Backup documentation - #1193

Merged
jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-backup-documentation
Oct 28, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-backup-documentation

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Closes #61.

Fills all 44 remaining exact placeholders across nine Android.App.Backup XML files. The namespace file already has documentation. No placeholders remain.

  • Documents the .NET task wrappers as Task.Run calls to their synchronous methods, including task results, operation order, and object lifetimes.
  • Completes quota, transport flag, helper state, ancestral profile, and full restore property documentation.
  • Preserves existing documentation, attribution, API metadata, and importer guards. No generated indexes or importer code changed.

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 revision 92b5d471f1e0f6164fc332b1f661b472f5cf3aad.

Verification: all namespace XML parses; all 44 exact placeholders are filled; structural comparison preserves prior non-placeholder text and metadata; git diff --check passes; 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, with actual 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.

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]>
Copilot AI balanced review requested due to automatic review settings October 27, 2026 23:02
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) October 27, 2026 23:02
@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

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 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 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 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 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.

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.

@jonathanpeppers
jonathanpeppers merged commit 2fdc39f into main Oct 28, 2026
3 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-backup-documentation branch October 28, 2026 02:29
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.

Add XML documentation for Android.App.Backup

3 participants