Skip to content

Commit

Permalink
Ensure granted (xamarin#1658)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow authored and CartBlanche committed Sep 21, 2021
1 parent 04a6f38 commit ccb9847
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Xamarin.Essentials/MediaPicker/MediaPicker.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static async Task<FileResult> PlatformPickAsync(MediaPickerOptions options, bool
{
// 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>();

var intent = new Intent(Intent.ActionGetContent);
intent.SetType(photo ? FileSystem.MimeTypes.ImageAll : FileSystem.MimeTypes.VideoAll);
Expand Down

0 comments on commit ccb9847

Please sign in to comment.