feat: add POST_NOTIFICATIONS permission and runtime request#195
Merged
ErikBjare merged 2 commits intoJul 24, 2026
Merged
Conversation
Adds the POST_NOTIFICATIONS manifest permission required on Android 13+ (API 33) for the foreground service notification to surface in the notification drawer. Without this declaration and the accompanying runtime grant, the OS silently suppresses the notification channel. MainActivity now requests the permission at launch (after onboarding) using the ActivityResultContracts API. The request is a no-op on Android < 13 and on devices where the permission is already granted.
This was referenced Jul 23, 2026
Greptile SummaryAdds Android 13 notification permission handling.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains in the fix for repeated notification permission requests. Important Files Changed
Reviews (2): Last reviewed commit: "fix: avoid repeated notification permiss..." | Re-trigger Greptile |
Contributor
Author
|
@greptileai review |
Contributor
Author
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes part of #189.
What
POST_NOTIFICATIONStoAndroidManifest.xmlMainActivityusingActivityResultContracts.RequestPermission()Why
On Android 13+ (API 33), the OS requires both a manifest declaration and a runtime grant for
POST_NOTIFICATIONSbefore it will surface any notification — including the foreground service notification fromBackgroundService. Without this, the notification channel exists but the notification is silently suppressed, which is why users (and the emulator recording) see no notification in the drawer.The runtime request fires once at launch (after onboarding), is guarded by
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU, and is skipped if the permission is already granted. It's a no-op on Android < 13.Effect
Once granted, the "ActivityWatch Server / Server running in background" foreground notification will appear in the notification drawer while the app is backgrounded — which also makes it demonstrable for the Play Console
FOREGROUND_SERVICE_SPECIAL_USEvideo requirement.