fix to autofill: continue if dataset has no name
This commit is contained in:
		@@ -132,13 +132,14 @@ namespace keepass2android.services.AutofillBase
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                    if (query.IncompatiblePackageAndDomain == false)
 | 
					                    if (query.IncompatiblePackageAndDomain == false)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
 | 
					                        Kp2aLog.Log("AF: (query.IncompatiblePackageAndDomain == false)");
 | 
				
			||||||
                        //domain and package are compatible. Use Domain if available and package otherwise. Can fill without warning.
 | 
					                        //domain and package are compatible. Use Domain if available and package otherwise. Can fill without warning.
 | 
				
			||||||
                        foreach (var entryDataset in BuildEntryDatasets(query.DomainOrPackage, query.WebDomain,
 | 
					                        foreach (var entryDataset in BuildEntryDatasets(query.DomainOrPackage, query.WebDomain,
 | 
				
			||||||
                            query.PackageName,
 | 
					                            query.PackageName,
 | 
				
			||||||
                            autofillIds, parser, DisplayWarning.None).Where(ds => ds != null)
 | 
					                            autofillIds, parser, DisplayWarning.None).Where(ds => ds != null)
 | 
				
			||||||
                        )
 | 
					                        )
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
 | 
					                            Kp2aLog.Log("AF: Got EntryDataset " + (entryDataset == null));
 | 
				
			||||||
                            responseBuilder.AddDataset(entryDataset);
 | 
					                            responseBuilder.AddDataset(entryDataset);
 | 
				
			||||||
                            hasEntryDataset = true;
 | 
					                            hasEntryDataset = true;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
@@ -192,7 +193,9 @@ namespace keepass2android.services.AutofillBase
 | 
				
			|||||||
            DisplayWarning warning)
 | 
					            DisplayWarning warning)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            List<Dataset> result = new List<Dataset>();
 | 
					            List<Dataset> result = new List<Dataset>();
 | 
				
			||||||
 | 
					            Kp2aLog.Log("AF: BuildEntryDatasets");
 | 
				
			||||||
            var suggestedEntries = GetSuggestedEntries(query).ToDictionary(e => e.DatasetName, e => e);
 | 
					            var suggestedEntries = GetSuggestedEntries(query).ToDictionary(e => e.DatasetName, e => e);
 | 
				
			||||||
 | 
					            Kp2aLog.Log("AF: BuildEntryDatasets found " + suggestedEntries.Count + " entries");
 | 
				
			||||||
            foreach (var filledAutofillFieldCollection in suggestedEntries.Values)
 | 
					            foreach (var filledAutofillFieldCollection in suggestedEntries.Values)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -205,6 +208,8 @@ namespace keepass2android.services.AutofillBase
 | 
				
			|||||||
                    FilledAutofillFieldCollection partitionData =
 | 
					                    FilledAutofillFieldCollection partitionData =
 | 
				
			||||||
                        AutofillHintsHelper.FilterForPartition(filledAutofillFieldCollection, parser.AutofillFields.FocusedAutofillCanonicalHints);
 | 
					                        AutofillHintsHelper.FilterForPartition(filledAutofillFieldCollection, parser.AutofillFields.FocusedAutofillCanonicalHints);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    Kp2aLog.Log("AF: Add dataset");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    result.Add(AutofillHelper.NewDataset(this, parser.AutofillFields, partitionData, IntentBuilder));
 | 
					                    result.Add(AutofillHelper.NewDataset(this, parser.AutofillFields, partitionData, IntentBuilder));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
@@ -214,7 +219,10 @@ namespace keepass2android.services.AutofillBase
 | 
				
			|||||||
                        IntentBuilder.GetAuthIntentSenderForWarning(this, query, queryDomain, queryPackage, warning);
 | 
					                        IntentBuilder.GetAuthIntentSenderForWarning(this, query, queryDomain, queryPackage, warning);
 | 
				
			||||||
                    var datasetName = filledAutofillFieldCollection.DatasetName;
 | 
					                    var datasetName = filledAutofillFieldCollection.DatasetName;
 | 
				
			||||||
                    if (datasetName == null)
 | 
					                    if (datasetName == null)
 | 
				
			||||||
                        return null;
 | 
					                    {
 | 
				
			||||||
 | 
					                        Kp2aLog.Log("AF: dataset name is null");
 | 
				
			||||||
 | 
					                        continue;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    RemoteViews presentation =
 | 
					                    RemoteViews presentation =
 | 
				
			||||||
                        AutofillHelper.NewRemoteViews(PackageName, datasetName, AppNames.LauncherIcon);
 | 
					                        AutofillHelper.NewRemoteViews(PackageName, datasetName, AppNames.LauncherIcon);
 | 
				
			||||||
@@ -226,7 +234,7 @@ namespace keepass2android.services.AutofillBase
 | 
				
			|||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        datasetBuilder.SetValue(autofillId, AutofillValue.ForText("PLACEHOLDER"));
 | 
					                        datasetBuilder.SetValue(autofillId, AutofillValue.ForText("PLACEHOLDER"));
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					                    Kp2aLog.Log("AF: Add auth dataset");
 | 
				
			||||||
                    result.Add(datasetBuilder.Build());
 | 
					                    result.Add(datasetBuilder.Build());
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user