Attempt to fix edge case where actionable notifications aren't cleared correctly#6905
Attempt to fix edge case where actionable notifications aren't cleared correctly#6905jaydeethree wants to merge 6 commits into
Conversation
Android 16 added some more automatic notification groups ("We’re also force-grouping notifications that come from a single app"):
https://blog.google/products-and-platforms/platforms/android/android-16/
Those new groups are defined here:
https://cs.android.com/android/platform/superproject/+/android-latest-release:frameworks/base/services/core/java/com/android/server/notification/GroupHelper.java;drc=d5d4670d8a245da5468af767b17d1e57ed7c9278;l=2106
And the section names come from here:
https://cs.android.com/android/platform/superproject/+/android-latest-release:frameworks/base/services/core/java/com/android/server/notification/GroupHelper.java;drc=d5d4670d8a245da5468af767b17d1e57ed7c9278;l=195-199
Full disclosure: I used AI to help me debug this issue. While I am familiar with Java and Kotlin, I do not have experience with Android development.
There was a problem hiding this comment.
Hi @jaydeethree
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates notification-group cancellation logic to treat additional Android “auto” notification groups as non-custom, preventing unintended group cancellation behavior.
Changes:
- Expands the set of Android auto-group suffixes that should be ignored when determining whether a group is “custom”.
- Updates inline comment to reflect multiple Android auto groups.
TimoPtr
left a comment
There was a problem hiding this comment.
I also invite you to update the log
Timber.d("Notification is in a group ($groupKey), but it is in the auto group. Cancel notification")
to it is in an auto group.
|
Also update the title of the Pull request and did you manage to test if that fixed the issue properly? |
Done.
Done.
No - I don't have an Android development environment so I'm unfortunately not able to compile this into an APK for testing. |
As per our policy, you need to be able to test this change. We cannot merge this otherwise. I'll ask you to provide a video in the description of the PR to show the behavior before and after the changes. |
| "|g:ranker_group", | ||
| "|g:Aggregate_AlertingSection", | ||
| "|g:Aggregate_SilentSection", | ||
| ) |
There was a problem hiding this comment.
I see in the AOSP code that there is also PeopleSection is this something that is relevant for us?
Even more groups like PromotionsSection, SocialSection, NewsSection, RecsSection
Note that after building completes on GitHub, you can download an apk file to install a debug version side-by-side with the normal release to test your changes. Just make sure to enable persistent connection in settings to be able to receive notifications. Click on the 'Checks' tab below your PR title > click on 'Pull Request' on the left > scroll down and download the "APKs" artifact (you must be logged in to GitHub). |
Understood, and for what it's worth I agree with that policy :) I should have time to test this sometime in the next week, once I do that I'll post an update here. Thanks! |
Android 16 added some more automatic notification groups ("We’re also force-grouping notifications that come from a single app"):
https://blog.google/products-and-platforms/platforms/android/android-16/
Those new groups are defined here:
https://cs.android.com/android/platform/superproject/+/android-latest-release:frameworks/base/services/core/java/com/android/server/notification/GroupHelper.java;drc=d5d4670d8a245da5468af767b17d1e57ed7c9278;l=2106
And the section names come from here:
https://cs.android.com/android/platform/superproject/+/android-latest-release:frameworks/base/services/core/java/com/android/server/notification/GroupHelper.java;drc=d5d4670d8a245da5468af767b17d1e57ed7c9278;l=195-199
This change makes Home Assistant recognize these new automatic groups and treat them the same as the existing
ranker_group.Full disclosure: I used AI to help me debug this issue. While I am familiar with Java and Kotlin, I do not have experience with Android development.
Summary
Checklist
Screenshots
Link to pull request in documentation repositories
User Documentation: home-assistant/companion.home-assistant#
Developer Documentation: home-assistant/developers.home-assistant#
Any other notes