What are the best approaches for testing notifications in Android apps under different conditions?

In my experience, building test hooks or debug flags into the app helps a lot.

For example, I expose a debug menu in dev builds that lets me manually fire the same events that would normally trigger a notification (like app open count or background services).

This way, I can run manual or automated tests to verify notification delivery and content across edge cases without needing the actual user behavior to occur.