Skip to content

Live notification tap opens that provider's usage - #170

Open
BenItBuhner wants to merge 1 commit into
alphafrom
fix/live-notification-deeplink
Open

BenItBuhner wants to merge 1 commit into
alphafrom
fix/live-notification-deeplink

Conversation

@BenItBuhner

Copy link
Copy Markdown
Owner

Cause

NowBarManager built the live notification's tap intent with no provider extra, no data URI and a fixed request code (8614), so a tap landed on whichever provider tab was last selected. Reset alerts had the same problem.

Fix

  • Each provider's tap carries EXTRA_PROVIDER plus a codexmeter://usage/<id> URI and a per-provider request code (PendingIntent identity ignores extras).
  • MainActivity resolves the provider from the extra or URI on cold start (onCreate) and warm start (onNewIntent), then clears both so onResume can't re-route.
  • Reset alerts route the same way; the Claude saved-reset alert opens Claude Code.
  • New pure-Java NotificationRoutes helper with self-tests (wired into run-tests.sh).

Testing

  • android/run-tests.sh passes.

The Now Bar live notification's contentIntent opened MainActivity with no
provider extra, no data URI and a fixed request code (8614), so a tap landed
on whichever provider tab was last selected. Each provider's tap now carries
EXTRA_PROVIDER plus a codexmeter://usage/<id> URI and a per-provider request
code (PendingIntent identity ignores extras). MainActivity resolves the
provider from the extra or URI on cold start (onCreate) and warm start
(onNewIntent), then clears both so onResume can't re-route. Reset alerts
route the same way (Claude saved-reset opens Claude Code).

Adds NotificationRoutes (pure Java) with self-tests.
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.

1 participant