Skip to content

fix(android): preserve notification forwarding consent - #129715

Merged
steipete merged 1 commit into
mainfrom
codex/android-notification-consent
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/android-notification-consent

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Problem

Android onboarding treated Notification Listener access as consent to forward notifications. If someone had explicitly disabled Forward Notifications, completing onboarding with listener access still granted silently re-enabled forwarding and could send notification titles and message content to the Gateway.

The Android documentation defines these as separate choices: forwarding is off by default, and listener access is a prerequisite rather than an opt-in.

Fix

Preserve the existing forwarding preference when onboarding applies permissions, and additionally require actual notification-listener access. This keeps an explicit opt-out disabled, preserves an existing opt-in while access is granted, and disables forwarding when listener access is revoked.

The change modifies one existing production line: +1/-1, net zero. It adds no permissions, configuration, helper, fallback, or testing seam.

Evidence

An Android 36 Google Play debug build exercised the real NotificationManager listener grant, the production onboarding Permissions screen, Continue action, and the persisted app preference:

  • Unmodified baseline: listener granted + forwarding explicitly disabled -> completing onboarding incorrectly persisted forwarding enabled.
  • Fixed: listener granted + forwarding disabled -> forwarding remains disabled.
  • Fixed: listener granted + forwarding enabled -> forwarding remains enabled.
  • Fixed: actual listener access revoked + forwarding previously enabled -> forwarding is disabled.

Each fixed on-device scenario passed through the real application UI and actual Android notification-listener authorization. No user notifications were read and only the task app's own listener authorization was changed.

Validation

  • Google Play flavor: OnboardingFlowLogicTest 63/63, SecurePrefsNotificationForwardingTest 7/7, and DeviceNotificationListenerServiceTest 8/8.
  • Third-party flavor: the same 78/78 owner, preference, and listener-service tests.
  • Total: 156/156 focused tests passed.
  • All four hosted Android lint modules passed: app, benchmark, Wear, and wear-shared.
  • Independent authenticated code review reported no actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: XS maintainer Maintainer-authored PR labels Aug 26, 2026
@steipete
steipete marked this pull request as ready for review August 26, 2026 00:43
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 9:31 PM ET / August 26, 2026, 01:31 UTC.

ClawSweeper review

What this changes

The PR changes Android onboarding so notification forwarding remains enabled only when the user had already opted in and Android notification-listener access is currently granted.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for maintainer handling. Current main still overwrites the forwarding preference from listener access alone; this focused repair preserves the documented separate consent choice and gates it on current listener access.

Priority: P1
Reviewed head: 4a5a76e130e3b650ac60c03063237a7d9c32c609

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, source-aligned repair with green Android validation and no actionable patch defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports real-device before/after listener-access and persisted-preference checks.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports real-device before/after listener-access and persisted-preference checks.
Evidence reviewed 6 items Current-main defect: Current main persists listener access itself as the forwarding setting, so listener access can overwrite a prior explicit opt-out.
Owner-boundary repair: The proposed conjunction preserves the existing forwarding preference while requiring the listener grant at the onboarding persistence boundary.
Caller and persistence path: The Permissions screen invokes the apply callback on Continue, the view model delegates the setting, and SecurePrefs writes the boolean preference.
Findings None None.
Security None None.

Live Verification

Command: pnpm android:test

Result: FAIL (failed) — step 1 run pnpm android:test: previous terminal command was still running after 30 seconds: "pnpm android:test"

$ node --import tsx scripts/run-android-gradle.mts :app:testPlayDebugUnitTest :wear:testDebugUnitTest :wear-shared:testDebugUnitTest
Fetching distribution.
Downloading https://services.gradle.org/distributions/gradle-9.7.0-bin.zip
..............10%..............20%...............30%..............40%..............50%...............60%..............70%..............80%...............90%....
..........100%

Welcome to Gradle 9.7.0!

Here are the highlights of this release:
 - Isolated Projects graduates to incubating
 - Broader Configuration Cache compatibility
 - More source locations in problem reports

For more details see https://docs.gradle.org/9.7.0/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
│···············│ 0% CONFIGURING [16s]
› IDLE
› IDLE
› IDLE
› root project › Resolve dependencies of classpath › junit-bom-5.10.2.pom
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› root project › Resolve dependencies of classpath › apache-18.pom
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› root project › Resolve dependencies of classpath › jaxb-bom-ext-2.3.2.pom
› IDLE
› IDLE
› IDLE

Assertions:

  • FAIL expect_output: BUILD SUCCESSFUL

How this fits together

Android onboarding collects device permissions and persists selected capabilities through the app view model. The stored notification-forwarding preference controls whether the Android notification listener sends notification data to the Gateway.

flowchart LR
A[Onboarding permissions screen] --> B[Listener access check]
C[Stored forwarding preference] --> D[Onboarding apply decision]
B --> D
D --> E[Persisted forwarding setting]
E --> F[Notification listener]
F --> G[Gateway events]
Loading

Before merge

  • Resolve merge risk (P1) - An already-enabled user who completes onboarding while listener access is absent will have forwarding persistently disabled and must opt in again after restoring access; the PR describes this as intentional.
  • Complete next step (P2) - This is a correct focused repair, but the protected maintainer label keeps the intentional persisted-state transition for human merge handling.
Agent review details

Security

None.

PR surface

Other 0. Total 0 across 1 file.

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 1 1 1 0
Total 1 1 1 0

Review metrics

Metric Value Why it matters
Production versus test delta production +1/-1 (net 0); tests +0/-0 The patch replaces one persistence decision without adding configuration, dependencies, or a parallel state path.

Merge-risk options

Maintainer options:

  1. Accept access-gated forwarding state (recommended)
    Land the documented behavior that clears stored forwarding when onboarding observes listener access absent, while preserving an opt-in when access is granted.

Technical review

Best possible solution:

Retain separate forwarding consent and listener access, with onboarding persisting their conjunction as this PR does.

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

Yes—current main’s assignment at the onboarding apply boundary directly reproduces the overwrite whenever listener access is true and the stored forwarding preference is false.

Is this the best way to solve the issue?

Yes—the repair acts at the sole onboarding persistence decision, reuses the stored preference and existing Android listener-access fact, and matches the documented prerequisite relationship.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9c30c920feec.

Labels

Label justifications:

  • P1: This corrects a consent regression that can silently re-enable forwarding of Android notification content during onboarding.
  • merge-risk: 🚨 compatibility: The onboarding transition intentionally changes the persisted forwarding state for users whose listener access is absent.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports real-device before/after listener-access and persisted-preference checks.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current-main commit that introduced the overwritten preference assignment and the proposed focused repair. (role: recent onboarding contributor; confidence: high; commits: 85d5df1d87d1, 4a5a76e130e3; files: apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt)
  • obviyus: Ayaan Zaidi has the strongest historical contribution count on the onboarding file and authored its earlier redesign work. (role: major onboarding refactor author; confidence: medium; commits: aae75b5a5778; files: apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-26T00:49:12.516Z sha 4a5a76e :: needs maintainer review before merge. :: none

@steipete
steipete merged commit c841a99 into main Aug 26, 2026
127 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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.

1 participant