Skip to content

fix(android): preserve split SMS permission grants#99147

Merged
steipete merged 2 commits into
openclaw:mainfrom
NianJiuZst:codex/android-sms-split-permission-state
Jul 2, 2026
Merged

fix(android): preserve split SMS permission grants#99147
steipete merged 2 commits into
openclaw:mainfrom
NianJiuZst:codex/android-sms-split-permission-state

Conversation

@NianJiuZst

@NianJiuZst NianJiuZst commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Android third-party onboarding could keep showing SMS as unauthorized when users granted SEND_SMS and READ_SMS in separate permission prompts.

Why This Change Was Made

ActivityResultContracts.RequestMultiplePermissions only reports the permissions included in the current launch result. The onboarding callback previously used the aggregate smsGranted value as the fallback for each SMS permission, so a callback that only included READ_SMS could discard the already-granted SEND_SMS state. This change merges SMS callback results against the current per-permission grant state instead.

User Impact

Users who grant SMS permissions incrementally can complete the third-party onboarding SMS row once both SMS permissions are actually granted. Denied permissions still keep the row unauthorized until the missing permission is granted.

Evidence

  • Dependency contract checked: androidx.activity:activity 1.13.0 RequestMultiplePermissions maps results from the launched permission list.
  • cd apps/android && ./gradlew :app:testThirdPartyDebugUnitTest --tests ai.openclaw.app.ui.OnboardingFlowLogicTest
  • cd apps/android && ./gradlew :app:testPlayDebugUnitTest --tests ai.openclaw.app.ui.OnboardingFlowLogicTest
  • git diff --check
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --prompt "Scope: Android onboarding SMS permission state merge after rebase to current upstream/main. Review only the one-commit diff for split SEND_SMS/READ_SMS permission callback regressions."

AI-assisted: yes.

@NianJiuZst
NianJiuZst force-pushed the codex/android-sms-split-permission-state branch from ffcaa2d to 8694f29 Compare July 2, 2026 15:48
@NianJiuZst
NianJiuZst marked this pull request as ready for review July 2, 2026 15:50
@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 2:15 PM ET / 18:15 UTC.

Summary
The PR changes Android onboarding SMS permission aggregation to merge split permission callback results against current per-permission Android grant state and adds a unit test.

PR surface: Other +39. Total +39 across 2 files.

Reproducibility: yes. Source inspection shows current main can request only the still-missing SMS permission, and AndroidX 1.13.0 returns callback maps keyed to requested/returned permissions, so omitted entries can preserve stale aggregate SMS state.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No ClawSweeper repair lane is needed; the remaining action is normal maintainer review and merge gating for a clean, focused PR.

Security
Cleared: The diff changes only Android permission-state logic and a unit test; it adds no permissions, dependencies, scripts, secrets handling, or code-execution surface.

Review details

Best possible solution:

Land the focused onboarding permission-state merge after normal maintainer merge gating; no repair lane is needed.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows current main can request only the still-missing SMS permission, and AndroidX 1.13.0 returns callback maps keyed to requested/returned permissions, so omitted entries can preserve stale aggregate SMS state.

Is this the best way to solve the issue?

Yes. The PR fixes the bug inside the existing onboarding permission callback by making callback values authoritative and reading omitted required permissions from current Android state, without adding config, API, or product surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 826c84ea1942.

Label changes

Label justifications:

  • P2: The PR fixes a real Android onboarding permission-state bug with limited blast radius and focused regression coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR discussion includes maintainer Testbox, emulator install/launch, and API 36.1 split-grant system-smoke proof of the changed behavior after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR discussion includes maintainer Testbox, emulator install/launch, and API 36.1 split-grant system-smoke proof of the changed behavior after the fix.
Evidence reviewed

PR surface:

Other +39. Total +39 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 41 2 +39
Total 2 41 2 +39

What I checked:

  • Repository policy: Root AGENTS.md and apps/android/AGENTS.md were read fully; the Android scoped policy is release-focused and did not change this non-release onboarding review. (AGENTS.md:1, 826c84ea1942)
  • Current-main bug path: Current main filters already-granted permissions before launch, but the SMS callback falls both SEND_SMS and READ_SMS callback entries back to aggregate smsGranted, so a one-permission callback can preserve stale false row state. (apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt:1442, 826c84ea1942)
  • PR implementation: The head and potential merge ref replace the aggregate SMS fallback with mergedRequiredPermissionGrantState, where callback values remain authoritative and omitted required permissions are read from current Android permission state. (apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt:1443, f396b6886008)
  • Regression coverage: The added unit test covers SEND_SMS-only still false, READ_SMS-only plus current SEND_SMS becoming true, and explicit READ_SMS denial staying false. (apps/android/app/src/test/java/ai/openclaw/app/ui/OnboardingFlowLogicTest.kt:64, f396b6886008)
  • Dependency contract: AndroidX activity is pinned to 1.13.0, and its RequestMultiplePermissions source returns maps keyed from the input or returned permissions array, so omitted callback entries must be recovered from current system state. (apps/android/gradle/libs.versions.toml:3, 826c84ea1942)
  • Real behavior proof: The PR discussion includes maintainer verification for local and Testbox OnboardingFlowLogicTest runs, Play and third-party APK assembly, third-party install/launch on API 36.1, and a system smoke showing SEND_SMS granted while READ_SMS remained denied, then both granted after the second operation. (f396b6886008)

Likely related people:

  • lixuankai: Commit c86de67 introduced Android sms.search support and expanded onboarding/settings SMS permissions to include READ_SMS with SEND_SMS. (role: feature introducer; confidence: medium; commits: c86de678f3eb; files: apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/SettingsSheet.kt, apps/android/app/src/main/java/ai/openclaw/app/node/DeviceHandler.kt)
  • Ayaan Zaidi: Commits 88716f0 and 0462a7f changed SMS permission UI state handling around the same onboarding/settings surface. (role: prior SMS permission UI contributor; confidence: high; commits: 88716f02de1e, 0462a7fd8c66; files: apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/SettingsSheet.kt)
  • NianJiu: Commit 04e4c37 updated selected-photo permissions in the same OnboardingFlow RequestMultiplePermissions callback area shortly before this SMS fix. (role: recent adjacent contributor; confidence: medium; commits: 04e4c3719de3; files: apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt)
  • steipete: steipete merged the recent current-main carrier PR and provided the current branch’s real-behavior verification plus refactor commit. (role: recent verifier and merger; confidence: medium; commits: 4f933ccf7b62, f396b6886008; files: apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt, apps/android/app/src/test/java/ai/openclaw/app/ui/OnboardingFlowLogicTest.kt)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 2, 2026
@steipete steipete self-assigned this Jul 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: google size: XL and removed size: XS labels Jul 2, 2026
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Maintainer verification

Improved the SMS-specific patch into a reusable per-permission merge. Callback values remain authoritative when present; omitted entries query that permission's current Android state, so an explicit denial cannot be masked.

Validation:

  • Local Play OnboardingFlowLogicTest: passed.
  • Testbox Play + third-party OnboardingFlowLogicTest: passed on blacksmith-testbox lease tbx_01kwhyv64b66m8292qmhkft0v6.
  • Play and third-party debug APK assembly; third-party install/launch on API 36.1 emulator: passed.
  • API 36.1 system smoke observed SEND_SMS granted while READ_SMS remained denied, then both granted after the second operation.
  • Fresh branch autoreview: no actionable findings.

Proof gap: reaching the permission screen requires a paired Gateway. I did not bypass onboarding for a cosmetic screenshot; the actual split OS grants and callback merge boundary are the relevant proof.

@steipete
steipete force-pushed the codex/android-sms-split-permission-state branch from 47c3e14 to f396b68 Compare July 2, 2026 18:03
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed docs Improvements or additions to documentation channel: telegram Channel integration: telegram scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: google size: XL labels Jul 2, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jul 2, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 2, 2026
@steipete
steipete merged commit 36361fc into openclaw:main Jul 2, 2026
77 of 85 checks passed
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 3, 2026
* fix: preserve split SMS permission grants

* refactor(android): generalize split permission grant merging

---------

Co-authored-by: NianJiuZst <180004567+users.noreply.github.com>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants