Skip to content

Fix documentation errors in Android.App.PrivateCompute (R137, pass 3) - #2015

Merged
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-review-privatecompute-r137-p3
Nov 28, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-review-privatecompute-r137-p3

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: bae0089ba1101fde968c064863bd0312b58996dc

Dimension Assessment Rationale
Change confidence 9/10 ↑ Corrections match pinned SDK, Android 17 server, and JNI implementations.
↑ 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.
Diagnosis confidence 9.5/10 ↑ Constructors store category information regardless of status; trusted UIDs bypass the package check; sanitization has separate SharedMemory branches.
↑ Raw Java link fragments and incorrect JNI ownership wording are present in the old text.
Evidence fit Unknown ↓ This is a documentation audit, not a reported application failure.

Scope

Pass-3 review item R137: all seven assigned Android.App.PrivateCompute files. The files did not exist at pre-AI revision 86f7744a1. 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\files

Files: 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

  1. Category information is not selected by the error code. GetSensitiveCategoryInfo returns 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. SDK PccEgressException.java:196-202,215-224,252-253 stores and returns the field without checking the status.
  2. Trusted UIDs can bypass the package-name check. The IsPccTrustedSystemComponent parameter 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.
  3. Proxy use and sanitization depend on caller trust. PccService.OnBind returns 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.
  4. Writable SharedMemory is not always silently made read-only. When PCC framework support is enabled, sanitization rejects a writable region. Otherwise it restricts write access. Pinned sanitization implementation, lines 105-112. The allowed-type list and depth limit are retained.
  5. JNI transfer is not a yes/no ownership handoff. PccService now 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.
  6. Managed references and terminology. Replaced four raw Parcelable method link fragments and one #FLAG_CATEGORY_HEALTH fragment with exact managed DocIds. Removed hidden Java StatusCode/SensitiveCategory annotation names from six channels; the constructor and property text now describes the stored code or mask. SDK PccEgressException.java:75-98,136-146,168-184,239-240 and Parcelable.java:103-110,166-183 establish those contracts. Corrected in to to into in 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, except Parcelable.java under src/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.EgressData documents SecurityException, IllegalArgumentException, and IllegalStateException in SDK PccSandboxManager.java:311-315. The pinned Android 17 binder interface, lines 25-35, predates egressData. 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; NullPointerException is 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

  • All seven XML files parse; no placeholders.
  • Every scoped cref resolves to an exact existing DocId.
  • API metadata, BOM, CRLF, and bytes outside the 20 approved changed channels are preserved.
  • git diff --check passes. No importer code changed.
  • Independent gemini-4-argon review found no issues. Verified in local assistant_usage_events, rows 352877, 352878, 352879, 352890.

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

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.

🔵 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

@jonathanpeppers

Copy link
Copy Markdown
Member Author

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.

PccSandboxManagerInternal.java, Android tag android-17.0.0_r1:

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);

PccBundleSanitizationUtil.java, same Android tag:

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: }

PccEgressException.java, verified SDK source-37.2_r01.zip:

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: }

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto

Copy link
Copy Markdown
Member

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

@jonathanpeppers
jonathanpeppers merged commit cbb7093 into main Nov 28, 2026
4 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-review-privatecompute-r137-p3 branch November 28, 2026 21:38
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