fix save popup in QuickUnlock

This commit is contained in:
Philipp Crocoll
2018-01-02 14:59:19 +01:00
parent 8287232866
commit a929db9939
3 changed files with 5 additions and 51 deletions

View File

@@ -135,6 +135,8 @@ android:paddingRight="16dp"
android:ems="4"
android:layout_below="@id/QuickUnlock_label"
android:id="@+id/QuickUnlock_password"
android:singleLine="true"
android:fontFamily="sans-serif"
android:textSize="20sp"
android:focusable="true"
android:focusableInTouchMode="true" />

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using Android.Content;
using Android.Service.Autofill;
using Android.Util;
@@ -46,50 +45,5 @@ namespace keepass2android.services.AutofillBase
presentation.SetImageViewResource(Resource.Id.icon, drawableId);
return presentation;
}
/// <summary>
/// Wraps autofill data in a Response object (essentially a series of Datasets) which can then
/// be sent back to the client View.
/// </summary>
/// <returns>The response.</returns>
/// <param name="context">Context.</param>
/// <param name="datasetAuth">If set to <c>true</c> dataset auth.</param>
/// <param name="autofillFields">Autofill fields.</param>
/// <param name="clientFormDataMap">Client form data map.</param>
/// <param name="intentBuilder"></param>
public static FillResponse NewResponse(Context context, bool datasetAuth, AutofillFieldMetadataCollection autofillFields, Dictionary<string, FilledAutofillFieldCollection> clientFormDataMap, IAutofillIntentBuilder intentBuilder)
{
var responseBuilder = new FillResponse.Builder();
if (clientFormDataMap != null)
{
var datasetNames = clientFormDataMap.Keys;
foreach (var datasetName in datasetNames)
{
var filledAutofillFieldCollection = clientFormDataMap[datasetName];
if (filledAutofillFieldCollection != null)
{
var dataset = NewDataset(context, autofillFields, filledAutofillFieldCollection, intentBuilder);
if (dataset != null)
{
responseBuilder.AddDataset(dataset);
}
}
}
}
if (autofillFields.SaveType != 0)
{
//TODO implement save
var autofillIds = autofillFields.GetAutofillIds();
responseBuilder.SetSaveInfo
(new SaveInfo.Builder(autofillFields.SaveType, autofillIds).Build());
return responseBuilder.Build();
}
else
{
CommonUtil.logd("These fields are not meant to be saved by autofill.");
return null;
}
}
}
}

View File

@@ -64,9 +64,9 @@ namespace keepass2android.services.AutofillBase
AutofillFieldMetadataCollection autofillFields = parser.AutofillFields;
bool responseAuth = true;
var autofillIds = autofillFields.GetAutofillIds();
if (responseAuth && autofillIds.Length != 0 && CanAutofill(query))
if (autofillIds.Length != 0 && CanAutofill(query))
{
var responseBuilder = new FillResponse.Builder();
@@ -81,9 +81,7 @@ namespace keepass2android.services.AutofillBase
}
else
{
var datasetAuth = true;
var response = AutofillHelper.NewResponse(this, datasetAuth, autofillFields, null, IntentBuilder);
callback.OnSuccess(response);
callback.OnSuccess(null);
}
}