mirror of
https://github.com/bitwarden/mobile
synced 2025-12-30 23:23:38 +00:00
Modified Permissions Flow (#1005)
Permissions flow for Android was causing the white screen on initial permission grant on occasion. Moved permission grant to pre-TOTP page load.
This commit is contained in:
21
src/App/Utilities/PermissionManager.cs
Normal file
21
src/App/Utilities/PermissionManager.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Essentials;
|
||||
using static Xamarin.Essentials.Permissions;
|
||||
|
||||
namespace Bit.App.Utilities
|
||||
{
|
||||
public static class PermissionManager
|
||||
{
|
||||
public static async Task<PermissionStatus> CheckAndRequestPermissionAsync<T>(T permission)
|
||||
where T : BasePermission
|
||||
{
|
||||
var status = await permission.CheckStatusAsync();
|
||||
if (status != PermissionStatus.Granted)
|
||||
{
|
||||
status = await permission.RequestAsync();
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user