In my test code, I used
notification.flags |= Notification.DEFAULT_SOUND;
notification.flags |= Notification.DEFAULT_LIGHTS;
This did not work, and according to the answer I got on another question I changed .flags to .defaults and it works.
notification.defaults |= Notification.DEFAULT_SOUND;
notification.defaults |= Notification.DEFAULT_LIGHTS;
In the documentation both fields: flags and defaults are the same.
When do I use which?
Can I set 2 flags of the same family?
The system must check those fields for different things. It checks “defaults” to see which features you want to be their defaults, and look for some other flags in “flags”. It’s all explained in the Dev Guide