mirror of
https://github.com/bitwarden/android.git
synced 2025-01-12 11:17:30 +03:00
fixes for autofill service
This commit is contained in:
parent
9ab41c5de6
commit
3c58775ae2
3 changed files with 7 additions and 8 deletions
|
@ -165,7 +165,7 @@ namespace Bit.Droid.Autofill
|
||||||
{
|
{
|
||||||
var packageName = context.PackageName;
|
var packageName = context.PackageName;
|
||||||
var view = new RemoteViews(packageName, Resource.Layout.autofill_listitem);
|
var view = new RemoteViews(packageName, Resource.Layout.autofill_listitem);
|
||||||
view.SetTextViewText(Resource.Id.text, text);
|
view.SetTextViewText(Resource.Id.text1, text);
|
||||||
view.SetTextViewText(Resource.Id.text2, subtext);
|
view.SetTextViewText(Resource.Id.text2, subtext);
|
||||||
view.SetImageViewResource(Resource.Id.icon, iconId);
|
view.SetImageViewResource(Resource.Id.icon, iconId);
|
||||||
return view;
|
return view;
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Bit.Droid.Autofill
|
||||||
public class AutofillService : Android.Service.Autofill.AutofillService
|
public class AutofillService : Android.Service.Autofill.AutofillService
|
||||||
{
|
{
|
||||||
private ICipherService _cipherService;
|
private ICipherService _cipherService;
|
||||||
//private ILockService _lockService;
|
private ILockService _lockService;
|
||||||
|
|
||||||
public async override void OnFillRequest(FillRequest request, CancellationSignal cancellationSignal, FillCallback callback)
|
public async override void OnFillRequest(FillRequest request, CancellationSignal cancellationSignal, FillCallback callback)
|
||||||
{
|
{
|
||||||
|
@ -39,15 +39,13 @@ namespace Bit.Droid.Autofill
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if(_lockService == null)
|
if(_lockService == null)
|
||||||
{
|
{
|
||||||
_lockService = ServiceContainer.Resolve<ILockService>("lockService");
|
_lockService = ServiceContainer.Resolve<ILockService>("lockService");
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
List<FilledItem> items = null;
|
List<FilledItem> items = null;
|
||||||
var locked = true; // TODO
|
var locked = await _lockService.IsLockedAsync();
|
||||||
if(!locked)
|
if(!locked)
|
||||||
{
|
{
|
||||||
if(_cipherService == null)
|
if(_cipherService == null)
|
||||||
|
|
|
@ -417,8 +417,8 @@ namespace Bit.Droid.Services
|
||||||
activity.Finish();
|
activity.Finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var structure = activity.Intent
|
var structure = activity.Intent.GetParcelableExtra(
|
||||||
.GetParcelableExtra(AutofillManager.ExtraAssistStructure) as AssistStructure;
|
AutofillManager.ExtraAssistStructure) as AssistStructure;
|
||||||
if(structure == null)
|
if(structure == null)
|
||||||
{
|
{
|
||||||
activity.SetResult(Result.Canceled);
|
activity.SetResult(Result.Canceled);
|
||||||
|
@ -433,6 +433,7 @@ namespace Bit.Droid.Services
|
||||||
activity.Finish();
|
activity.Finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var task = CopyTotpAsync(cipher);
|
||||||
var dataset = AutofillHelpers.BuildDataset(activity, parser.FieldCollection, new FilledItem(cipher));
|
var dataset = AutofillHelpers.BuildDataset(activity, parser.FieldCollection, new FilledItem(cipher));
|
||||||
var replyIntent = new Intent();
|
var replyIntent = new Intent();
|
||||||
replyIntent.PutExtra(AutofillManager.ExtraAuthenticationResult, dataset);
|
replyIntent.PutExtra(AutofillManager.ExtraAuthenticationResult, dataset);
|
||||||
|
|
Loading…
Reference in a new issue