Skip to content
Merged
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 @@ -44,4 +44,7 @@ interface AutofillServiceFeature {
@Toggle.DefaultValue(false)
@InternalAlwaysEnabled
fun canAutofillInsideDDG(): Toggle

@Toggle.DefaultValue(true)
fun canProcessSystemFillRequests(): Toggle
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class RealAutofillService : AutofillService() {

autofillJob += coroutineScope.launch(dispatcherProvider.io()) {
runCatching {
if (autofillServiceFeature.self().isEnabled().not()) {
if (isAutofillServiceEnabled().not()) {
callback.onSuccess(null)
return@launch
}
Expand Down Expand Up @@ -169,6 +169,10 @@ class RealAutofillService : AutofillService() {
Timber.v("DDGAutofillService onDisconnected")
}

private fun isAutofillServiceEnabled(): Boolean {
return autofillServiceFeature.self().isEnabled() && autofillServiceFeature.canProcessSystemFillRequests().isEnabled()
}

companion object {
private val DDG_PACKAGE_IDS = setOf(
"com.duckduckgo.mobile.android",
Expand Down
Loading