Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7aa922c9 authored by Tony's avatar Tony
Browse files

Make sure notification listener stays unbound on reboot when badging disabled

We were requesting unbind in onCreate(), but the NotificationListenerService
documentation for requestUnbind() clearly states "The service should wait for the
{@link #onListenerConnected()} event before performing this operation. I know it's
tempting, but you must wait." I was tempted, and I did not wait. :(

The fact that the notification listener was binding even though the setting was off
was not only inefficient, but also had at least one user-visible bug: because
secure settings are set per user, the global badging setting actually only applies
canShowBadge = false for user 0; other users such as work profile still show badges.

Repro steps:
1. Have a work profile
2. Get a notification on work profile app and normal app
3. Turn off global badging setting ("Allow notification dots" from home settings)
4. Reboot the device

In this case, we get onCreate, call requestUnbind() which is ignored since we aren't
bound, then get onBind() and onListenerConnected() etc. Thus the work profile app has
a notification dot and other apps don't.

Bug: 71545493
Change-Id: I7f7dc219b25c28257f8b98fba7e362b99d3cba45
parent de967a23
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment