Skip to content

fix: require Android contact and calendar write permissions#99204

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

fix: require Android contact and calendar write permissions#99204
steipete merged 2 commits into
openclaw:mainfrom
NianJiuZst:codex/android-device-permissions-readwrite

Conversation

@NianJiuZst

Copy link
Copy Markdown
Contributor

What Problem This Solves

device.permissions could report Contacts or Calendar as granted when Android had only granted the read half of the permission pair. The actual contact and calendar add flows require write access, and the onboarding/settings permission rows request both read and write, so the device status payload could overstate what the app can do.

Why This Change Was Made

This updates the Android device permission payload to require both read and write grants before reporting the combined Contacts or Calendar capability as granted. It also adds Robolectric regression coverage for the read-only and read+write cases for both permission rows.

User Impact

Third-party onboarding and permission diagnostics now match the write-backed commands. Users should no longer see Contacts or Calendar as authorized while add-style actions still fail because the write permission is missing.

Evidence

  • git diff --check
  • cd apps/android && ./gradlew :app:testThirdPartyDebugUnitTest --tests ai.openclaw.app.node.DeviceHandlerTest
  • cd apps/android && ./gradlew :app:testPlayDebugUnitTest --tests ai.openclaw.app.node.DeviceHandlerTest
  • .agents/skills/autoreview/scripts/autoreview --mode local -> clean, no accepted/actionable findings

AI-assisted: yes

@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 4:17 PM ET / 20:17 UTC.

Summary
The branch changes Android Contacts/Calendar device.permissions status checks and regression tests, while its second commit also carries broader iOS/Feishu/Gateway/docs changes that already match current-main work.

PR surface: Source +91, Tests +265, Docs +23, Other +769. Total +1148 across 40 files.

Reproducibility: yes. Current main reports Contacts and Calendar from read permissions only while add handlers require write permissions, and the PR discussion includes real Gateway output showing the shipped read-only baseline and corrected candidate states.

Review metrics: 2 noteworthy metrics.

  • Potential merge surface: 2 Android files, +48/-4. GitHub's potential merge commit proves the actual merge result is narrow despite the stale 40-file PR display.
  • Permission payload entries tightened: 2 changed. Contacts and Calendar device.permissions semantics change for partial read/write grant states, which maintainers should notice before merge.

Stored data model
Persistent data-model change detected: serialized state: src/config/sessions/session-accessor.reply-init-concurrency.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: canonical
Canonical: #99204
Summary: This PR is the canonical open item for the remaining Android device.permissions Contacts/Calendar read/write status mismatch; related merged work fixed adjacent onboarding state but not this payload.

Members:

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

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

  • Before landing, verify the exact potential merge commit still changes only the two Android permission files.

Risk before merge

  • [P1] The PR branch display is stale/noisy; if GitHub regenerates the potential merge commit before landing, maintainers should recheck that the merge result still only changes the two Android permission files.

Maintainer options:

  1. Decide the mitigation before merge
    Land or squash the exact merge result that only changes Android DeviceHandler and its regression test after required CI completes; rebase first if maintainers want the PR UI to match the narrow merge surface.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair is needed; maintainer review should decide landing after checking the exact merge result and required Android CI.

Security
Cleared: No concrete security or supply-chain regression was found; the current merge result only changes Android permission-status logic and its Robolectric test, with no dependency, workflow, script, or secret-handling change.

Review details

Best possible solution:

Land or squash the exact merge result that only changes Android DeviceHandler and its regression test after required CI completes; rebase first if maintainers want the PR UI to match the narrow merge surface.

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

Yes. Current main reports Contacts and Calendar from read permissions only while add handlers require write permissions, and the PR discussion includes real Gateway output showing the shipped read-only baseline and corrected candidate states.

Is this the best way to solve the issue?

Yes. Tightening the combined device.permissions statuses in DeviceHandler is the narrow owner-boundary fix; splitting sub-capabilities would be a larger API/product change, and changing add handlers or UI would leave the payload inconsistent.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4df175baafcf.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. A PR comment provides after-fix real Android/Gateway output for baseline, read-only, and read+write Contacts/Calendar states on an API 36.1 emulator.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): A PR comment provides after-fix real Android/Gateway output for baseline, read-only, and read+write Contacts/Calendar states on an API 36.1 emulator.
  • 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 focused Android permission-status correctness fix with limited blast radius and no data-loss, security-bypass, crash-loop, or urgent channel outage signal.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): A PR comment provides after-fix real Android/Gateway output for baseline, read-only, and read+write Contacts/Calendar states on an API 36.1 emulator.
  • proof: sufficient: Contributor real behavior proof is sufficient. A PR comment provides after-fix real Android/Gateway output for baseline, read-only, and read+write Contacts/Calendar states on an API 36.1 emulator.
Evidence reviewed

PR surface:

Source +91, Tests +265, Docs +23, Other +769. Total +1148 across 40 files.

View PR surface stats
Area Files Added Removed Net
Source 3 106 15 +91
Tests 4 270 5 +265
Docs 4 27 4 +23
Config 0 0 0 0
Generated 0 0 0 0
Other 29 1100 331 +769
Total 40 1503 355 +1148

What I checked:

Likely related people:

  • NianJiuZst: Authored the adjacent merged Android Contacts/Calendar onboarding permission fix and SMS split-permission fix, and authored this focused DeviceHandler repair branch. (role: recent area contributor; confidence: high; commits: db7bfc618dd4, 36361fc2a0f5, af1a921f3cf1; 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/node/DeviceHandler.kt)
  • obviyus: Authored the merged Android capability PR that added contacts/calendar handlers, commands, and manifest permissions that define the read/write behavior this PR aligns with. (role: introduced Android contacts/calendar capability surface; confidence: high; commits: 079bc2461315; files: apps/android/app/src/main/java/ai/openclaw/app/node/ContactsHandler.kt, apps/android/app/src/main/java/ai/openclaw/app/node/CalendarHandler.kt, apps/android/app/src/main/AndroidManifest.xml)
  • steipete: Merged adjacent Android permission fixes and supplied the real Android/Gateway proof for this PR's candidate behavior. (role: recent reviewer and merger; confidence: medium; commits: 36361fc2a0f5, db7bfc618dd4, 3108d4a61c48; 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/test/java/ai/openclaw/app/node/DeviceHandlerTest.kt)
  • Shakker: Current-main blame on the DeviceHandler permission payload points to a recent bulk Android handler commit, but the shallow/grafted history makes the original line provenance less precise. (role: recent Android handler contributor; confidence: low; commits: c032f9809d78; files: apps/android/app/src/main/java/ai/openclaw/app/node/DeviceHandler.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.

@NianJiuZst
NianJiuZst marked this pull request as ready for review July 2, 2026 18:54
@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 app: ios App: ios gateway Gateway runtime channel: feishu Channel integration: feishu size: XL and removed size: S labels Jul 2, 2026
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Land-ready validation on exact candidate behavior:

  • Reworked the regression test into a complete contacts/calendar permission matrix: read-only denied, write-only denied, read+write granted.
  • ANDROID_HOME="$HOME/Library/Android/sdk" ./gradlew :app:ktlintTestSourceSetCheck :app:testPlayDebugUnitTest :app:testThirdPartyDebugUnitTest --tests ai.openclaw.app.node.DeviceHandlerTest — pass.
  • ANDROID_HOME="$HOME/Library/Android/sdk" ./gradlew :app:assemblePlayDebug — pass.
  • Fresh Codex autoreview — clean; no accepted/actionable findings.

Real Android/Gateway proof (API 36.1 emulator, actual device.permissions node invocation through a local authenticated Gateway):

APK / OS grants contacts calendar
v2026.6.11 baseline; read only granted granted
candidate; read only denied denied
candidate; read + write granted granted

This exercises the shipped failure and the corrected partial/full-grant states through the real node transport, not a mocked payload. Screenshots would only show the permission setup summary; the Gateway response is the authoritative changed output, so no visual artifact was added.

@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 c20171d into openclaw:main Jul 2, 2026
126 of 139 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
…#99204)

* fix: require Android contact and calendar write permissions

* test(android): cover partial permission grants

---------

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 app: ios App: ios channel: feishu Channel integration: feishu docs Improvements or additions to documentation gateway Gateway runtime 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: XL 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