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