forked from thunderbird/thunderbird-android
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Run-time permissions (for Contacts only, see below)
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). I did *not* implement this for external storage access, as 1. there is a PR waiting (thunderbird#3118) and 2. I think that using the Storage Access Framework is a much better way to approach that as suggested in Issue thunderbird#2844. I noticed there are 3 additional custom permissions in the manifest having to do with other apps controlling K9, but I don't think they're required by k9 itself. If so, they can be requested from any K9Activity.
- Loading branch information
Showing
6 changed files
with
187 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters