1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-13 14:53:18 +00:00

externalsFileDir w/ FileProvider for temp store

This commit is contained in:
Kyle Spearrin
2019-06-25 10:30:16 -04:00
parent 8e04945d4e
commit e33b49e78c
3 changed files with 7 additions and 6 deletions

View File

@@ -17,6 +17,7 @@ using Bit.Core.Enums;
using Android.Nfc;
using Bit.App.Utilities;
using System.Threading.Tasks;
using Android.Support.V4.Content;
namespace Bit.Droid
{
@@ -202,9 +203,8 @@ namespace Bit.Droid
else
{
// camera
var root = new Java.IO.File(Android.OS.Environment.ExternalStorageDirectory, "bitwarden");
var file = new Java.IO.File(root, "temp_camera_photo.jpg");
uri = Android.Net.Uri.FromFile(file);
var file = new Java.IO.File(GetExternalFilesDir("temp"), "camera_photo.jpg");
uri = FileProvider.GetUriForFile(this, "com.x8bit.bitwarden.fileprovider", file);
fileName = $"photo_{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.jpg";
}