A thing to note is that the permission request will only show up when the targetsdk is upped >23.
Old commit message that explains the change:
--
The approach was to make it so that any K9Activity can easily request
whatever permission in the future.
The Contacts permission is now requested in two locations:
1. When a list of Messages is displayed
2. When a new message is first started to be composed.
The permission request is displayed ONCE per onCreate(). Any more than this
and it got really annoying. A typical user who reads or writes emails
WILL see the request, trust me. Once they see the message 2x, they
also have the option to block the requests from appearing.
If they DECLINE the request (or decline + DENY any further attempts),
the app should continues to work, albeit without incorporating contact data
(thumbnails, autocomplete, etc.). Contacts may still be added to the
Contacts app, as this uses an Intent and does not require any permission.
Once the Read Contacts permission is enabled, the app immediately begins
to use it.
To add other permissions in the future (such as External Storage access),
the request can be made in a similar way and the permission request result
handled appropriately by just adding it to K9Activity (or overriding in
a particular Activity).
Resuming account setup activity when the account has been partially
constructed (the setup has not been finished) resulted in having unsaved
account with ID = -1 in the accounts list. The application would then on
resume proceed to messages list but there won't be any folders as the
setup has been aborted.
The fix clears the list of accounts on resume and create so that the
application properly reacts to the event of no setup accounts.
Fixes#3717.
When the same list is passed in again it will be reversed another time
and folders show up in the wrong order. This happens e.g. on orientation
changes.