fix save popup in QuickUnlock
This commit is contained in:
@@ -135,6 +135,8 @@ android:paddingRight="16dp"
|
|||||||
android:ems="4"
|
android:ems="4"
|
||||||
android:layout_below="@id/QuickUnlock_label"
|
android:layout_below="@id/QuickUnlock_label"
|
||||||
android:id="@+id/QuickUnlock_password"
|
android:id="@+id/QuickUnlock_password"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true" />
|
android:focusableInTouchMode="true" />
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Android.Content;
|
using Android.Content;
|
||||||
using Android.Service.Autofill;
|
using Android.Service.Autofill;
|
||||||
using Android.Util;
|
using Android.Util;
|
||||||
@@ -46,50 +45,5 @@ namespace keepass2android.services.AutofillBase
|
|||||||
presentation.SetImageViewResource(Resource.Id.icon, drawableId);
|
presentation.SetImageViewResource(Resource.Id.icon, drawableId);
|
||||||
return presentation;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ namespace keepass2android.services.AutofillBase
|
|||||||
|
|
||||||
AutofillFieldMetadataCollection autofillFields = parser.AutofillFields;
|
AutofillFieldMetadataCollection autofillFields = parser.AutofillFields;
|
||||||
|
|
||||||
bool responseAuth = true;
|
|
||||||
var autofillIds = autofillFields.GetAutofillIds();
|
var autofillIds = autofillFields.GetAutofillIds();
|
||||||
if (responseAuth && autofillIds.Length != 0 && CanAutofill(query))
|
if (autofillIds.Length != 0 && CanAutofill(query))
|
||||||
{
|
{
|
||||||
var responseBuilder = new FillResponse.Builder();
|
var responseBuilder = new FillResponse.Builder();
|
||||||
|
|
||||||
@@ -81,9 +81,7 @@ namespace keepass2android.services.AutofillBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var datasetAuth = true;
|
callback.OnSuccess(null);
|
||||||
var response = AutofillHelper.NewResponse(this, datasetAuth, autofillFields, null, IntentBuilder);
|
|
||||||
callback.OnSuccess(response);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user