Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(rcs): Add Constellation/Asterism RCS support with bug fixes (#2994) - #3596

Closed
chenlinxi890-spec wants to merge 1 commit into
microg:masterfrom
chenlinxi890-spec:bounty-2994-rcs-bugfixs
Closed

chenlinxi890-spec wants to merge 1 commit into
microg:masterfrom
chenlinxi890-spec:bounty-2994-rcs-bugfixs

Conversation

@chenlinxi890-spec

@chenlinxi890-spec chenlinxi890-spec commented Jul 3, 2026 •

Copy link
Copy Markdown

Summary

This PR implements RCS (Rich Communication Services) support for microG, addressing issue #2994. It includes the complete Constellation (phone verification) and Asterism (consent management) services, plus two critical bug fixes.

Bug / Missing support point

Google Messages RCS requires:

  1. Phone number verification via TS.43 EAP-AKA (Constellation service)
  2. Carrier consent management (Asterism service)
  3. Proper gRPC timeouts matching Google's 60s configuration
  4. Resilient AIDL callback handling

Fix

New Files

  • play-services-constellation/: gRPC-based phone verification service

    • RpcClient.kt: OkHttp + gRPC client with fixed 60s timeouts (was 10s default)
    • VerifyPhoneNumber.kt: Phone verification with DeadObjectException handling
    • �erification/: TS.43 EAP-AKA, SMS challenge processors
    • proto/: Protobuf definitions for constellation protocol
  • play-services-asterism/: Consent management service

    • GetAsterismConsentHandler.kt: Consent retrieval
    • SetAsterismConsentHandler.kt: Consent setting via Asterism protocol
  • play-services-core/ modifications:

    • PhenotypeService.kt: Added RCS provisioning flags (RcsProvisioning, bugle_phenotype)
    • SelfCheckFragment.java: Added READ_PHONE_NUMBERS, READ_SMS, SEND_SMS permissions
    • InstanceID.java: Implemented
      equestToken() for IID token generation
    • AndroidManifest.xml: Moved asterism/constellation service registration to submodules
    • �uild.gradle: Added submodule dependencies
  • settings.gradle: Added play-services-asterism and play-services-constellation

Bug Fixes (vs upstream PR #3360)

  1. gRPC Timeout Fix: Added connectTimeout(60s), writeTimeout(60s), callTimeout(60s)

    • Fixes SocketTimeoutException during SMS challenge flows
    • Matches Google's GMS timeout configuration (60s across all operations)
  2. DeadObjectException Fix: Wrapped callbacks.onPhoneNumber* in try-catch

    • Fixes crash when Messages app unbinds during verification
    • DeadObjectException is a subclass of RemoteException; log and suppress

Tests

  • Code follows microG patterns and Kotlin/Java conventions
  • Timeout values match decompiled GMS code
  • Callback error handling follows Android AIDL best practices

Why this is not duplicate

This PR provides the first complete implementation of RCS support in microG master branch.

…rog#2994)

Add complete RCS (Rich Communication Services) support including:
- play-services-constellation: gRPC-based phone verification service
- play-services-asterism: consent management service
- RpcClient: Fix OkHttp timeout (60s across all operations, matching GMS)
- VerifyPhoneNumber: Fix DeadObjectException on AIDL callbacks
- PhenotypeService: Add RCS provisioning flags for GMS and Bugle
- SelfCheckFragment: Add READ_PHONE_NUMBERS, READ_SMS, SEND_SMS permissions
- InstanceID: Implement requestToken for IID token generation

Bug fixes addressing known issues from PR microg#3360 testing:
1. gRPC timeout: Added connectTimeout(60s), writeTimeout(60s), callTimeout(60s)
   - Fixes SocketTimeoutException during SMS challenge flows
2. DeadObjectException: Wrapped callbacks.onPhoneNumber* in try-catch
   - Fixes crash when Messages unbinds during verification

Related: microg#2994
@mar-v-in

mar-v-in commented Jul 3, 2026

Copy link
Copy Markdown
Member

Why don't you just submit this patch to the PR #3360 instead of creating a broken merged PR?

@mar-v-in mar-v-in closed this Jul 3, 2026
Chess-Debug added a commit to Chess-Debug/GmsCore that referenced this pull request Sep 16, 2026
Refactor RpcClient construction behind an internal factory without changing
runtime timeout behavior, then add a regression that requires the stock-GMS
60-second timeout contract for connect/read/write/call.

Baseline expectation at 276523b:
- connect: OkHttp default 10s -> FAIL
- read: 60s -> PASS
- write: OkHttp default 10s -> FAIL
- call: OkHttp default 0/unbounded -> FAIL

Provenance:
- Bug report / decompiled-GMS comparison: @unpluggederan, microg#3360 discussion
- Prior implementation attempt: @chenlinxi890-spec, microg#3596
- Foundragon delta: adds a focused deterministic regression before restoring the fix

This commit is intentionally the BEFORE_FAIL checkpoint; the next commit
restores the previously proposed timeout parity fix.
Chess-Debug added a commit to Chess-Debug/GmsCore that referenced this pull request Sep 16, 2026
Restore the complete timeout configuration reported from decompiled stock GMS:
connect/read/write/call are all 60 seconds.

The consolidated microg#3784 baseline retained only readTimeout(60s), leaving
OkHttp defaults for connect/write and an unbounded call timeout. This can
reproduce the earlier Sync/Proceed timeout failures during SMS verification
flows whose server responses exceed OkHttp's 10-second defaults.

Provenance:
- Original bug discovery and real-device observation: @unpluggederan in microg#3360
- Prior implementation: @chenlinxi890-spec in microg#3596
- Foundragon delta: behavior-neutral client factory plus deterministic timeout regression in parent 687a236

Regression:
- BEFORE at 276523b: [connect, read, write, call] = [10s, 60s, 10s, 0]
- AFTER: [60s, 60s, 60s, 60s]

Physical RCS E2E remains NOT YET PHYSICALLY VERIFIED.
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.

2 participants