Repository navigation
Fix Android Security documentation errors (R032, pass 3) - #1916
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 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
|
@dalexsoto review |
|
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
left a comment
There was a problem hiding this comment.
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>
|
@dalexsoto review |
dalexsoto
left a comment
There was a problem hiding this comment.
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.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
a01ec76a0e77776e3fbd5047dd0a874d2603117c↑ A fresh Gemini review found no blocking issue in the correction.
↓ SDK r02 source and device runtime behavior were not verified.
↓ Some current-reference claims could not be reconciled with the available r01 source.
↑ 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.AuthenticationPolicyandAndroid.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
FileIntegrityManagerdeprecation wording: the Android 15 service has a feature-flagged false result; the Android 16 method returns false without reading the certificate.transfer.Parcelablereturn and flag descriptions, managedcreftargets, identity property and deprecation wording, and the unnamedKeyStoreExceptionvalue 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
ChoosePrivateKeyAliasclearskeyTypeswhenissuersis null, and the chooser treats an empty list as unrestricted. The current reference describes key-type filtering. The behavior of r02 and devices has not been verified.KeyStoreExceptionError.Otherdescribes remapping errors for older target SDKs, but the pinned getter does not perform that mapping. Upstream filtering remains unverified.Checks
Docs, API metadata, BOMs, newline styles, attribution and placeholder counts.git diff --checkpassed.gemini-4-argonreview 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 freshgemini-4-argonreview found no blocker in the correction commit.