Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for confirm password fields #1363

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ object AutofillHelper {
struct.passwordId?.let { passwordId ->
builder.setValue(passwordId, AutofillValue.forText(entryInfo.password))
}
struct.confirmPasswordId?.let { confirmPasswordId ->
builder.setValue(confirmPasswordId, AutofillValue.forText(entryInfo.password))
}

if (entryInfo.expires) {
val year = entryInfo.expiryTime.getYearInt()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ class KeeAutofillService : AutofillService() {
}
types = types or SaveInfo.SAVE_DATA_TYPE_PASSWORD
requiredIds.add(passwordInfo)
parseResult.confirmPasswordId?.let { confirmPasswordId ->
requiredIds.add(confirmPasswordId)
}
}
// or a credit card form
if (requiredIds.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ class StructureParser(private val structure: AssistStructure) {
for (i in 0 until node.childCount) {
if (parseViewNode(node.getChildAt(i)))
returnValue = true
if (domainNotEmpty && returnValue)
return true
}
}
return returnValue
Expand Down Expand Up @@ -428,6 +426,15 @@ class StructureParser(private val structure: AssistStructure) {
}

var passwordId: AutofillId? = null
set(value) {
if (field == null) {
field = value
} else {
confirmPasswordId = value
}
}

var confirmPasswordId: AutofillId? = null
set(value) {
if (field == null)
field = value
Expand Down Expand Up @@ -483,6 +490,9 @@ class StructureParser(private val structure: AssistStructure) {
passwordId?.let {
all.add(it)
}
confirmPasswordId?.let {
all.add(it)
}
creditCardHolderId?.let {
all.add(it)
}
Expand Down