Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Make sure to require permissions (#1651)
Browse files Browse the repository at this point in the history
If the permissions were denied, then throw.
Fixes  #1649
  • Loading branch information
mattleibow committed Jan 21, 2021
1 parent 2ea20b8 commit db10113
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Xamarin.Essentials/FilePicker/FilePicker.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static async Task<IEnumerable<FileResult>> PlatformPickAsync(PickOptions options
{
// we only need the permission when accessing the file, but it's more natural
// to ask the user first, then show the picker.
await Permissions.RequestAsync<Permissions.StorageRead>();
await Permissions.EnsureGrantedAsync<Permissions.StorageRead>();

// Essentials supports >= API 19 where this action is available
var action = Intent.ActionOpenDocument;
Expand Down

0 comments on commit db10113

Please sign in to comment.