fix to weird autofill behavior: now returning dataset directly, instead of responseBuilder with dataset, allowing to fill the result of the autofill activity immediately.

This commit is contained in:
Philipp Crocoll
2023-01-23 10:11:28 +01:00
parent 4b3f6657a8
commit 1c3f4106dd

View File

@@ -177,6 +177,12 @@ namespace keepass2android.services.AutofillBase
{
var intent = Intent;
AssistStructure structure = (AssistStructure)intent.GetParcelableExtra(AutofillManager.ExtraAssistStructure);
if (structure == null)
{
SetResult(Result.Canceled);
Finish();
return;
}
StructureParser parser = new StructureParser(this, structure);
parser.ParseForFill(isManual);
AutofillFieldMetadataCollection autofillFields = parser.AutofillFields;
@@ -186,6 +192,7 @@ namespace keepass2android.services.AutofillBase
ReplyIntent = new Intent();
SetDatasetIntent(AutofillHelper.NewDataset(this, autofillFields, partitionData, IntentBuilder, null /*TODO can we get the inlinePresentationSpec here?*/));
SetResult(Result.Ok, ReplyIntent);
}
@@ -239,10 +246,7 @@ namespace keepass2android.services.AutofillBase
Toast.MakeText(this, "Failed to build an autofill dataset.", ToastLength.Long).Show();
return;
}
var responseBuilder = new FillResponse.Builder();
responseBuilder.AddDataset(dataset);
ReplyIntent.PutExtra(AutofillManager.ExtraAuthenticationResult, responseBuilder.Build());
ReplyIntent.PutExtra(AutofillManager.ExtraAuthenticationResult, dataset);
}
}
}