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

save info from service to add cipher page

This commit is contained in:
Kyle Spearrin
2017-11-17 14:38:56 -05:00
parent d1c7309b29
commit 184f13b148
9 changed files with 135 additions and 40 deletions

View File

@@ -23,6 +23,8 @@ using Android.Views.Autofill;
using Android.App.Assist;
using Bit.Android.Autofill;
using System.Collections.Generic;
using Bit.App.Models;
using Bit.App.Enums;
namespace Bit.Android
{
@@ -40,7 +42,6 @@ namespace Bit.Android
protected override void OnCreate(Bundle bundle)
{
var uri = Intent.GetStringExtra("uri");
if(!Resolver.IsSet)
{
MainApplication.SetIoc(Application);
@@ -78,8 +79,7 @@ namespace Bit.Android
_deviceActionService = Resolver.Resolve<IDeviceActionService>();
_settings = Resolver.Resolve<ISettings>();
LoadApplication(new App.App(
uri,
Intent.GetBooleanExtra("myVaultTile", false),
GetOptions(),
Resolver.Resolve<IAuthService>(),
Resolver.Resolve<IConnectivity>(),
Resolver.Resolve<IUserDialogs>(),
@@ -425,5 +425,24 @@ namespace Bit.Android
}
catch { }
}
private AppOptions GetOptions()
{
var options = new AppOptions
{
Uri = Intent.GetStringExtra("uri") ?? Intent.GetStringExtra("autofillFrameworkUri"),
MyVault = Intent.GetBooleanExtra("myVaultTile", false),
FromAutofillFramework = Intent.GetBooleanExtra("autofillFramework", false)
};
if(Intent.GetBooleanExtra("autofillFrameworkSave", false))
{
options.SaveType = (CipherType)Intent.GetIntExtra("autofillFrameworkType", 0);
options.SaveUsername = Intent.GetStringExtra("autofillFrameworkUsername");
options.SavePassword = Intent.GetStringExtra("autofillFrameworkPassword");
}
return options;
}
}
}