[devragrin] [GmsCore] Implement guardWithRequest service path (#2851)#3524
[devragrin] [GmsCore] Implement guardWithRequest service path (#2851)#3524kwanter wants to merge 2 commits into
Conversation
The IDroidGuardService.guardWithRequest method was previously stubbed with TODO, which caused request-backed DroidGuard flows (e.g. Play Integrity multi-step attestation) to throw NotImplementedError. This wires the missing entry point to the existing handle lifecycle: - call getHandle() to obtain the active handle (embedded or remote) - try initWithRequest(flow, request) with fallback to init(flow) - deliver the snapshot result through IDroidGuardCallbacks.onResult - always close the handle in a finally block - on error, deliver an empty byte array (matching the existing KeyRetrievalService error convention) to avoid binder exceptions This is the minimal change to unblock the request-backed flow while keeping behavior aligned with the existing one-shot guard() entry point.
|
Update / implementation note: This PR intentionally keeps #2851 narrow: it only replaces the missing Runtime flow implemented: If Reason for the small diff:
Happy to expand this if maintainers want explicit multi-step session APIs, but this should address the immediate |
Brief setup doc for the remote DroidGuard path, covering client configuration, server endpoint expectations, and quick validation. Addresses the documentation gap noted in the bounty discussion.
|
Update: added a brief setup doc for the remote DroidGuard path. No AIDL or API surface changes — the doc only covers client config, server endpoint expectations, and quick validation notes. PR diff is now 2 files, +55/-1 total (service impl + setup doc). Happy to rebase or address review feedback. |
/claim #2851
Summary
IDroidGuardService.guardWithRequestso request-backed DroidGuard flows can execute instead of throwingNotImplementedError.getHandle()→initWithRequest(flow, request)→snapshot(map)→callbacks.onResult(bytes)→close().Why
guardWithRequestwas a literalTODO("Not yet implemented"). Apps using Play Integrity / Firebase AppCheck-backed flows can hit this request-backed path, which breaks attestation on microG-only devices before the configured remote DroidGuard server can be used.Error handling
initWithRequestreturnsnull, fall back to the existinginit(flow)path.finally.callbacks.onResult(...)instead of throwing through Binder.Test Plan
Local environment note: my current runner has no Java runtime installed (
java -versionreturns “Unable to locate a Java Runtime”), so I could not run Gradle locally in this session.Recommended maintainer validation:
./gradlew :play-services-droidguard:core:compileDebugKotlin./gradlew :play-services-droidguard:core:testDebugUnitTestguardWithRequestwithNotImplementedError.guard()and continue to use the same handle implementation.Metadata note
Public issue/repo context only. No private prompts, memory, credentials, or hidden runtime context are disclosed. PR is intended to be evaluated on its own merits against issue #2851.
Bounty: claimed via BountyHub for the
$100total listed on this issue.