Skip to content

Fix Android Security documentation errors (R032, pass 3) - #1916

Merged
jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-review-android-security-docs-r032
Nov 28, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-review-android-security-docs-r032

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: a01ec76a0e77776e3fbd5047dd0a874d2603117c

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ XML, scope, byte preservation, placeholders, attribution and new managed links were checked.
↑ A fresh Gemini review found no blocking issue in the correction.
↓ SDK r02 source and device runtime behavior were not verified.
Diagnosis confidence 8.5/10 ↑ Pinned Android service and client sources confirm the corrected exception boundary.
↓ Some current-reference claims could not be reconciled with the available r01 source.
Evidence fit 9/10 ↑ Android 7 and 9 sources show the exception path identified in review.
↑ Android 10 returns null for the missing-grant path.
↓ No device runtime test was performed.

Scope

Pass-3 review of the 64 files in R032: Android.Security, Android.Security.AdvancedProtection, Android.Security.AuthenticationPolicy and Android.Security.Identity.

The inventory contains 366 AI-changed documentation blocks. All 230 non-deferred blocks have personal, source-backed ledger rows covering 560 changed channels. The other 136 blocks are deferred JNI boilerplate; four generic or previously repaired channels and four formatting-only channels are also marked as such. This PR changes 39 files, 62 blocks and 88 channels, including 10 older channels that contradicted an AI-changed channel and the pinned source.

The pass-2 PR #1718 and its human review were checked. This PR completes the version range raised there.

Corrections and evidence

  • Correct KeyChain availability, null and exception behavior, callback selection, CA installation, supported-algorithm checks and main-thread retrieval. The Android 4.3, 6.0, 7.0, 12 and 17 implementations show the version boundaries. The managed async wrapper awaits selection before retrieving the key and certificate.
  • After review, corrected the missing-grant exception boundary to before Android 10. The Android 7 and Android 9 services throw, and the Android 9 client wraps the runtime exception. The Android 10 service returns null for this path. The URI helper starts at API 23; both managed async helpers propagate lookup exceptions through their tasks. The other version-range claims in the PR were also checked against pinned releases.
  • Correct the FileIntegrityManager deprecation wording: the Android 15 service has a feature-flagged false result; the Android 16 method returns false without reading the certificate.
  • Correct legacy keystore encryption and optional key-generation parameters. Compare the Android 11, Android 12 and Android 17 implementations.
  • Describe release of the incoming JNI reference instead of saying the peer takes ownership of that same reference. The managed Object and Throwable implementations dispose of the incoming reference according to transfer.
  • Correct Parcelable return and flag descriptions, managed cref targets, identity property and deprecation wording, and the unnamed KeyStoreException value 17. Evidence includes AppUriAuthenticationPolicy, the Android 14 error mapping, the current identity reference, and the Android 37.2 r01 SDK source archive.

Uncertain findings left unchanged

Checks

  • Parsed every changed XML file; checked unchanged bytes outside Docs, API metadata, BOMs, newline styles, attribution and placeholder counts.
  • Verified 19 new managed link targets against the Android framework index and checked all local ledger source paths and numeric line references.
  • git diff --check passed.
  • Focused assertions checked all five corrected KeyChain passages. The other changed version ranges were checked against pinned release sources.
  • Independent gemini-4-argon review found no blocking issues. Its first report misstated the Android 4.3 algorithm check; a targeted second Gemini review and the pinned source confirmed the text. A fresh gemini-4-argon review found no blocker in the correction commit.
  • No device runtime tests were run. The available SDK source archive is r01, while the binding uses r02.

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

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 .NET Android security API documentation clarifications.

No open issues 🎉

What changed in this PR

Continues #1718 with documentation-only corrections to the .NET Android security APIs. This pass clarifies version-specific behavior and managed API guidance without changing runtime code or API metadata.

Changes:

  • Corrects KeyChain selection, retrieval, threading, and installation guidance, plus legacy keystore and file-integrity behavior.
  • Clarifies how constructors release incoming JNI references.
  • Updates Parcelable contracts, identity deprecation guidance, and managed API links.
File Description
docs/​xml/​Android.Security/​NetworkSecurityPolicy.xml Clarifies JNI reference release and domain-encryption links.
docs/​xml/​Android.Security/​KeyStoreParameter+Builder.xml Clarifies legacy screen-lock encryption behavior.
docs/​xml/​Android.Security/​KeyStoreParameter.xml Documents version-specific encryption flag results.
docs/​xml/​Android.Security/​KeyStoreExceptionError.xml Documents unnamed error value 17.
docs/​xml/​Android.Security/​KeyStoreException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security/​KeyPairGeneratorSpec+Builder.xml Clarifies legacy encryption and algorithm guidance.
docs/​xml/​Android.Security/​KeyPairGeneratorSpec.xml Documents optional parameters and encryption flag behavior.
docs/​xml/​Android.Security/​KeyChain.xml Corrects selection, retrieval, threading, installation, and algorithm guidance.
docs/​xml/​Android.Security/​IKeyChainAliasCallback.xml Accounts for device-policy alias selection.
docs/​xml/​Android.Security/​GrantedKeyInfo+InterfaceConsts.xml Links Parcelable constants to managed methods.
docs/​xml/​Android.Security/​GrantedKeyInfo.xml Corrects Parcelable return values, flags, and links.
docs/​xml/​Android.Security/​FileIntegrityManager.xml Clarifies deprecation and version-specific certificate checks.
docs/​xml/​Android.Security/​ConfirmationPrompt.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security/​ConfirmationNotAvailableException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security/​ConfirmationCallback.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security/​ConfirmationAlreadyPresentingException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security/​AppUriAuthenticationPolicy+Builder.xml Adds managed links for alias-selection overloads.
docs/​xml/​Android.Security/​AppUriAuthenticationPolicy.xml Corrects Parcelable return values, flags, and links.
docs/​xml/​Android.Security.Identity/​WritableIdentityCredential.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​UnknownAuthenticationKeyException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​SessionTranscriptMismatchException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​ResultData.xml Clarifies JNI release and versioned deprecation guidance.
docs/​xml/​Android.Security.Identity/​PresentationSession.xml Clarifies JNI release, deprecation, and key-pair property wording.
docs/​xml/​Android.Security.Identity/​PersonalizationData.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​NoAuthenticationKeyAvailableException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​MessageDecryptionException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​InvalidRequestMessageException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​InvalidReaderSignatureException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​IdentityCredentialStore.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​IdentityCredentialException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​IdentityCredential.xml Updates JNI release, property guidance, deprecations, and links.
docs/​xml/​Android.Security.Identity/​EphemeralPublicKeyNotFoundException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​DocTypeNotSupportedException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​CredentialDataResult.xml Clarifies JNI release and property deprecation guidance.
docs/​xml/​Android.Security.Identity/​CredentialDataRequest.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​CipherSuiteNotSupportedException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​AlreadyPersonalizedException.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​AccessControlProfileId.xml Clarifies incoming JNI reference release.
docs/​xml/​Android.Security.Identity/​AccessControlProfile.xml Clarifies incoming JNI reference release.

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 reviewer coverage is the API 37.2 deprecation claims in CredentialDataResult, IdentityCredential, PresentationSession and ResultData; API 35–37 FileIntegrityManager behavior; the added generated-binding cref targets; and the managed KeyChain wrappers and API 24–28 exception boundary in Android.Security/KeyChain.xml (around lines 723, 806, 1295–1307 and 1362). The source reads completed without a transport error, but these paths are not yet fully verified. These are gaps in my review, not findings against the PR; I am preserving the completed patch review for the next pass.

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

Please preserve the pre-Android 10 exception boundary in docs/xml/Android.Security/KeyChain.xml (lines 723, 806, 1295, 1307–1308 and 1362).

The new API 14–23 cutoff incorrectly excludes Android 7–9 (API 24–28). For an inaccessible/missing key, Android 7/9 KeyChainService throws, Android 9 KeyChain wraps the runtime exception in KeyChainException, and the managed async wrapper faults its Task. Android 10 introduces the null-return behavior; the official SDK 37.2 KeyChain source likewise explicitly says “prior to Q” throws rather than returning null. The previous text at 1295/1307 had the correct boundary. Callers following the new text could check only for null and miss the exception on API 24–28.

Restore “before Android 10 (API 29)” at 1295/1307, use API 14–28 at 806/1362, and API 23–28 for the Uri overload at 723. The three additional async hunks were present in this revision already; identifying them now closes a review-completeness miss, not a new author change.

Static review of all 39 changed files and relevant integration paths is complete; no additional blocking issue was found.

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 block the Android Security documentation clarifications.

No open issues 🎉

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.

The five KeyChain version-range corrections resolve my previous blocking finding: API 24-28 retain the exception behavior, and Android 10/API 29 starts the null-return behavior. Rechecked the current 39-file boundary, relevant cross-references, and current-target correspondence; no blocking issues remain. Static review only; no builds or tests executed.

@jonathanpeppers
jonathanpeppers merged commit 499610b into main Nov 28, 2026
4 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-review-android-security-docs-r032 branch November 28, 2026 05:39
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