Repository navigation
Fix documentation errors in Android.App.PrivateCompute (R137, pass 3) - #2015
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The caller-trust, binder-proxy, and SharedMemory contract changes require human verification because the pinned Android server/SDK sources and supporting audit ledger were unavailable for independent review.
No open issues 🎉
What changed in this PR
This documentation-only follow-up to #1823 corrects Android.App.PrivateCompute API descriptions and managed references without changing API metadata or runtime behavior.
Changes:
- Clarifies stored exception information and trusted-UID package checks.
- Corrects binder proxy, data sanitization, SharedMemory, and JNI reference-handling descriptions.
- Replaces Java-only references with managed links and terminology, and fixes parcel-writing wording.
| File | Description |
|---|---|
docs/xml/Android.App.PrivateCompute/PccService.xml |
Clarifies JNI handling, proxy selection, and sanitization conditions. |
docs/xml/Android.App.PrivateCompute/PccSandboxManager.xml |
Documents trusted-UID exceptions to package-name checks. |
docs/xml/Android.App.PrivateCompute/PccEgressException+SensitiveCategoryInfo+InterfaceConsts.xml |
Replaces raw Parcelable references with managed links. |
docs/xml/Android.App.PrivateCompute/PccEgressException+SensitiveCategoryInfo.xml |
Clarifies category terminology, links a flag, and corrects parcel-writing wording. |
docs/xml/Android.App.PrivateCompute/PccEgressException+InterfaceConsts.xml |
Replaces raw Parcelable references with managed links. |
docs/xml/Android.App.PrivateCompute/PccEgressException.xml |
Corrects stored-information descriptions, constructor terminology, and parcel-writing wording. |
Review effort: Balanced
|
The pinned excerpts below support the caller-trust, proxy, SharedMemory, and stored-information corrections. They are included here because Copilot could not retrieve the external sources or local ledger.
400: for (int uid : TRUSTED_UIDS) {
401: if (UserHandle.isSameApp(appUid, uid)) {
402: return true;
403: }
404: }
406: if (appPackage != null) {
408: if (!mPackageManagerInternal.isSameApp(appPackage, appUid,
409: UserHandle.getUserId(appUid))) {
410: return false;
411: }
412: }
540: if (isTrustedClient(clientUid) || hasSysConfigExemption) {
541: return binder;
542: }
544: return pccServiceInfo.getWrappedBinder();
641: private boolean isTrustedClient(int clientUid) {
642: if (Process.isPrivateComputeCoreUid(clientUid)) {
643: return true;
644: }
645: AndroidPackage androidPackage = mPackageManagerInternal.getPackage(clientUid);
646: if (androidPackage != null) {
647: return isPccTrustedSystemComponent(clientUid, androidPackage.getPackageName());
648: }
649: return isPccTrustedSystemComponent(clientUid, null);
105: case SharedMemory sm -> {
106: if (com.android.libcore.Flags.enablePccFrameworkSupport()) {
107: if (!sm.isRegionReadOnly()) {
108: throw new IllegalArgumentException("SharedMemory must be read-only.");
109: }
110: } else {
111: sm.setProtect(OsConstants.PROT_READ);
112: }
113: }
196: public PccEgressException(
197: @StatusCode int statusCode, @NonNull SensitiveCategoryInfo sensitiveCategoryInfo) {
198: super("Egress failed with status: " + statusCode);
199: Objects.requireNonNull(sensitiveCategoryInfo);
201: mStatusCode = statusCode;
202: mSensitiveCategoryInfo = sensitiveCategoryInfo;
203: }
252: public SensitiveCategoryInfo getSensitiveCategoryInfo() {
253: return mSensitiveCategoryInfo;
254: } |
|
@dalexsoto review |
|
In response to @jonathanpeppers's request: I checked the six changed-file patches and managed link targets at bae0089. The remaining reviewer coverage gap, not a defect in this PR, is independent verification of the PR-cited PccSandboxManagerInternal.java trusted-UID/proxy branches, PccBundleSanitizationUtil.java SharedMemory branches, SDK 37.2 PccEgressException.java getter/constructor, and the JNI ownership source correspondence, followed by a complete final pass. Those external source reads were not completed within this tick's time budget; no upstream fetch error was observed. The completed checks and exact missing source ranges are retained for continuation. |
dalexsoto
left a comment
There was a problem hiding this comment.
Reviewed the six changed documentation files against the Android implementations and JNI handle-ownership paths. The stored-value, trusted-UID, proxy, SharedMemory and transfer descriptions are consistent; no blocking issues found.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
bae0089ba1101fde968c064863bd0312b58996dc↑ XML, exact references, API metadata, and byte-preservation checks pass; independent gemini-4-argon review found no issues.
↓ Public server sources are older than the 37.2 SDK for egress; those exception channels remain unchanged.
↑ Raw Java link fragments and incorrect JNI ownership wording are present in the old text.
Scope
Pass-3 review item R137: all seven assigned
Android.App.PrivateComputefiles. The files did not exist at pre-AI revision86f7744a1. Reviewed 65 Docs blocks, comprising 143 personally checked in-scope channels / 143 total in-scope channels, plus 38 explicitly deferred runtime boilerplate channels. Results: 120 correct, 20 fixed, 3 uncertain channels. Six XML files changed; API metadata is unchanged.The per-channel ledger contains current XML, each specific claim checked, the personal decision, and numeric pinned source lines. Local evidence folder:
C:\Users\jopepper\.copilot\session-state\aed05b1e-e5da-4c0b-9893-b13cad8af979\filesFiles:
R137-ledger.json,R137-ledger.md,personal-decisions.tsv,validation.json,verbatim-comparison.json,gemini-review.txt, and pinned sources. The scripted comparison found 59 exact normalized visible-source matches; it assigned no verdicts. Each in-scope channel has an individual personal decision.Fixes
GetSensitiveCategoryInforeturns the stored information even for a non-sensitivity error when a constructor was given that information. The old return text promised null for every other error. SDKPccEgressException.java:196-202,215-224,252-253stores and returns the field without checking the status.IsPccTrustedSystemComponentparameter text no longer promises false for every UID/package mismatch. Pinned implementation, lines 389-411, accepts trusted instrumented callers and trusted UIDs before checking the package name.PccService.OnBindreturns its own binder (PccService.java:103-105). The system can replace it for an untrusted external client; trusted external clients can receive the original binder. The remarks no longer claim that all external data is sanitized. Pinned proxy selection, lines 501-544 and 641-649; sanitization at 790-803.PccServicenow uses the established Object-derived wording for incoming-reference release and peer registration. Object.cs:110-118 and JNIEnv.cs:360-393 show that the peer copies its own reference.#FLAG_CATEGORY_HEALTHfragment with exact managed DocIds. Removed hidden JavaStatusCode/SensitiveCategoryannotation names from six channels; the constructor and property text now describes the stored code or mask. SDKPccEgressException.java:75-98,136-146,168-184,239-240andParcelable.java:103-110,166-183establish those contracts. Correctedin totointoin four parcel-write channels without changing their meaning.Pinned SDK evidence
Official Android SDK source archive, SHA256:
9d637c3af6654a2f1b696b3d19c54bb77e38df2b0106116934703f314b3d4e84.SDK paths above are under
src/android/app/privatecompute, exceptParcelable.javaundersrc/android/os. Bindings use platform-37.2_r02; no API-version or r02 obsolescence metadata was changed based on r01.Uncertain finding (three channels, not changed)
PccSandboxManager.EgressDatadocumentsSecurityException,IllegalArgumentException, andIllegalStateExceptionin SDKPccSandboxManager.java:311-315. The pinned Android 17 binder interface, lines 25-35, predatesegressData. It does not decide whether these failures reach the caller synchronously or through a callback. No newer pinned server implementation is available, so the published contract remains.Pass-2 #1823 and its reviews were read. Its four exception additions remain correct as published contracts;
NullPointerExceptionis directly proven by SDK lines 324-326 before the binder call. Its hidden-annotation/link observations are addressed here. Its missing-attribution observation on the two constructors is resolved by replacing the copied summaries/parameter wording with original, implementation-supported descriptions.Checks and review
crefresolves to an exact existing DocId.git diff --checkpasses. No importer code changed.gemini-4-argonreview found no issues. Verified in localassistant_usage_events, rows 352877, 352878, 352879, 352890.