When/If you merge this, I've found a potential ANR on your MainActivity when you create the Settings object.
Doing this at MainActivity::onCreate can cause Android apps to freeze on startup:
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
this.settings = new Settings(sharedPref);
The IO performed by PreferenceManager.getDefaultSharedPreferences(this) leads to common ANR reports in my experience, I believe your NotificationService makes another call when the service is created, this can lead to race conditions that trigger the ANR.
It's better to do that in a background thread and start accessing preferences once available. Perhaps you've not seen this reports yet, but they certainly popped up a lot for us after several thousand instances in the wild.
Again, if you merge this let me know what you think, I'd be happy to do this fix for you.
When/If you merge this, I've found a potential ANR on your MainActivity when you create the
Settings
object.Doing this at
MainActivity::onCreate
can cause Android apps to freeze on startup:The IO performed by
PreferenceManager.getDefaultSharedPreferences(this)
leads to common ANR reports in my experience, I believe yourNotificationService
makes another call when the service is created, this can lead to race conditions that trigger the ANR.It's better to do that in a background thread and start accessing preferences once available. Perhaps you've not seen this reports yet, but they certainly popped up a lot for us after several thousand instances in the wild.
Again, if you merge this let me know what you think, I'd be happy to do this fix for you.