mirror of
https://github.com/bitwarden/mobile
synced 2026-01-01 08:03:37 +00:00
[EC-325] Settings option to allow screen capture on Android (#1914)
* settings option to allow screen capture on Android * Improved code on Screen Capture and added prompt to the user to allow screen capture * EC-325 Removed async on OnCreate of MainActivity given that's not necessary anymore Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
This commit is contained in:
committed by
GitHub
parent
cb0c52fb26
commit
cf222bd0c3
@@ -948,5 +948,21 @@ namespace Bit.Droid.Services
|
||||
{
|
||||
// for any Android-specific cleanup required after switching accounts
|
||||
}
|
||||
|
||||
public async Task SetScreenCaptureAllowedAsync()
|
||||
{
|
||||
if (CoreHelpers.ForceScreenCaptureEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var activity = CrossCurrentActivity.Current?.Activity;
|
||||
if (await _stateService.GetScreenCaptureAllowedAsync())
|
||||
{
|
||||
activity.RunOnUiThread(() => activity.Window.ClearFlags(WindowManagerFlags.Secure));
|
||||
return;
|
||||
}
|
||||
activity.RunOnUiThread(() => activity.Window.AddFlags(WindowManagerFlags.Secure));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user