Skip to content

fix: require Android contact and calendar write permissions in onboarding#99158

Merged
steipete merged 2 commits into
openclaw:mainfrom
NianJiuZst:codex/android-contact-calendar-permissions
Jul 2, 2026
Merged

fix: require Android contact and calendar write permissions in onboarding#99158
steipete merged 2 commits into
openclaw:mainfrom
NianJiuZst:codex/android-contact-calendar-permissions

Conversation

@NianJiuZst

Copy link
Copy Markdown
Contributor

What Problem This Solves

Android onboarding could show Contacts or Calendar as authorized after only the read permission was granted, even though the app requests both read and write permissions from that row.

That left onboarding out of sync with the rest of the Android app: Settings already treats Contacts and Calendar as granted only when both read and write permissions are present, and the actual Contacts/Calendar add handlers require the write permission before they can create records.

This also fixes the filtered callback case. The onboarding request helper filters out permissions that are already granted before launching RequestMultiplePermissions; if READ was granted first and WRITE was granted later, the callback map can contain only WRITE. The state merge now uses the callback result plus the current system grant state for the omitted permission.

AI-assisted: yes.

Why This Change Was Made

The previous onboarding state used only READ_CONTACTS and READ_CALENDAR for initial grant status, and the ActivityResult callback also only looked at those read permissions.

This change adds a focused read/write permission merge helper and uses it for Contacts and Calendar onboarding state. Initial state now requires both read and write permissions, and callback state now preserves already-granted permissions that were filtered out before the request was launched.

User Impact

Users will no longer see Contacts or Calendar marked as ready in Android onboarding until the permissions needed by both read and add workflows are actually available. Users who grant the two permissions in separate prompts should now see the row update correctly once the missing permission is granted.

Evidence

  • 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 local
    • Result: autoreview clean: no accepted/actionable findings reported

@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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

Summary
The PR updates Android onboarding Contacts and Calendar permission rows to require both read and write grants, shares permission-group constants across request/callback state, and adds unit coverage for partial grant maps.

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

Reproducibility: yes. by source inspection: current main can mark Contacts or Calendar onboarding rows granted from READ_* even though those rows launch both read and write permissions and add handlers require write permission. I did not run a failing emulator repro in this read-only review.

Review metrics: none identified.

Root-cause cluster
Relationship: canonical
Canonical: #99158
Summary: This PR owns the remaining Contacts/Calendar onboarding permission mismatch; the merged SMS PR shares the filtered-permission root cause but does not cover these rows.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
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

  • [P2] No repair lane is needed; the patch has no blocking findings and the remaining action is ordinary maintainer review and merge handling.

Security
Cleared: The diff changes Android Kotlin onboarding UI logic and unit tests only; it does not touch dependencies, CI, build scripts, secrets, publishing, or other supply-chain surfaces.

Review details

Best possible solution:

Land the focused onboarding permission-state fix and keep Contacts/Calendar rows tied to shared read/write permission groups once normal maintainer merge gates pass.

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

Yes, by source inspection: current main can mark Contacts or Calendar onboarding rows granted from READ_* even though those rows launch both read and write permissions and add handlers require write permission. I did not run a failing emulator repro in this read-only review.

Is this the best way to solve the issue?

Yes, this is the best fix: it updates the onboarding state owner that filters launch permissions and shares the same required permission groups for initial state, callback merge, and request launch. Changing Settings or handlers would not fix onboarding's stale row state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 97ad0b7c211c.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Maintainer verification reports after-fix Testbox tests, debug APK install/launch on an API 36.1 emulator, and system grant smoke showing the read-only and read-plus-write states.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Maintainer verification reports after-fix Testbox tests, debug APK install/launch on an API 36.1 emulator, and system grant smoke showing the read-only and read-plus-write states.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a normal-priority Android onboarding correctness fix with limited blast radius and no evidence of data loss, security impact, or core runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Maintainer verification reports after-fix Testbox tests, debug APK install/launch on an API 36.1 emulator, and system grant smoke showing the read-only and read-plus-write states.
  • proof: sufficient: Contributor real behavior proof is sufficient. Maintainer verification reports after-fix Testbox tests, debug APK install/launch on an API 36.1 emulator, and system grant smoke showing the read-only and read-plus-write states.
Evidence reviewed

PR surface:

Other +45. Total +45 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 51 6 +45
Total 2 51 6 +45

What I checked:

Likely related people:

  • NianJiuZst: Authored the merged SMS split-permission fix that introduced the current OnboardingFlow merge helper and adjacent regression test, and authored the first commit of this PR. (role: recent area contributor; confidence: high; commits: 36361fc2a0f5, dbcf3b3df392; 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)
  • obviyus: Merged the Android Contacts/Calendar command, manifest permission, and setup-surface work that defines the read/write capability behavior this PR aligns with. (role: introduced Android contacts/calendar capability surface; confidence: high; commits: 079bc2461315, 3f056a729495; files: apps/android/app/src/main/AndroidManifest.xml, apps/android/app/src/main/java/ai/openclaw/app/node/ContactsHandler.kt, apps/android/app/src/main/java/ai/openclaw/app/node/CalendarHandler.kt)
  • steipete: Merged the SMS split-permission fix, authored the PR refactor that shares Contacts/Calendar permission groups, and provided maintainer verification on the current head. (role: recent reviewer and adjacent Android UI contributor; confidence: medium; commits: 36361fc2a0f5, cf50b9f5ab9a, 40d4e321105a; 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, apps/android/app/src/main/java/ai/openclaw/app/ui/SettingsScreens.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
@NianJiuZst
NianJiuZst marked this pull request as ready for review July 2, 2026 16:57
@steipete steipete self-assigned this Jul 2, 2026
@steipete
steipete force-pushed the codex/android-contact-calendar-permissions branch from c4bdc0e to cf50b9f Compare July 2, 2026 18:27
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Maintainer verification

Rebased onto landed #99147 and removed the duplicate read/write helper. Contacts and Calendar now share one canonical permission group each across initial state, partial callback merging, and request launch.

Validation:

  • Local Play OnboardingFlowLogicTest: passed.
  • Testbox Play + third-party OnboardingFlowLogicTest: passed on blacksmith-testbox lease tbx_01kwhyv64b66m8292qmhkft0v6.
  • Third-party debug APK assemble/install/launch on API 36.1 emulator: passed.
  • API 36.1 system smoke observed READ_CONTACTS and READ_CALENDAR granted while both write permissions remained denied, then all four granted after the write grants.
  • Fresh branch autoreview: no actionable findings.

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

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 db7bfc6 into openclaw:main Jul 2, 2026
62 of 70 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
…ding (openclaw#99158)

* fix: require Android contact and calendar write permissions in onboarding

* refactor(android): share required onboarding permission groups

---------

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