diff --git a/autofill/autofill-api/src/main/java/com/duckduckgo/autofill/api/AutofillFeature.kt b/autofill/autofill-api/src/main/java/com/duckduckgo/autofill/api/AutofillFeature.kt index c37e4a264cb0..2ac72749c2f5 100644 --- a/autofill/autofill-api/src/main/java/com/duckduckgo/autofill/api/AutofillFeature.kt +++ b/autofill/autofill-api/src/main/java/com/duckduckgo/autofill/api/AutofillFeature.kt @@ -33,11 +33,11 @@ interface AutofillFeature { /** * Kill switch for if we should inject Autofill javascript into the browser. * - * @return `true` when the remote config has the global "canIntegrateAutofillInWebView" autofill sub-feature flag enabled + * @return `true` when the remote config has the global "canIntegrateWebMessageBasedAutofillInWebView" autofill sub-feature flag enabled * If the remote feature is not present defaults to `true` */ @Toggle.DefaultValue(true) - fun canIntegrateAutofillInWebView(): Toggle + fun canIntegrateWebMessageBasedAutofillInWebView(): Toggle /** * @return `true` when the remote config has the global "canInjectCredentials" autofill sub-feature flag enabled diff --git a/autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/AutofillGlobalCapabilityChecker.kt b/autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/AutofillGlobalCapabilityChecker.kt index 644e10b2d405..7cc0d1e15b43 100644 --- a/autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/AutofillGlobalCapabilityChecker.kt +++ b/autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/AutofillGlobalCapabilityChecker.kt @@ -55,7 +55,7 @@ class AutofillGlobalCapabilityCheckerImpl @Inject constructor( override suspend fun isAutofillEnabledByConfiguration(url: String): Boolean { return withContext(dispatcherProvider.io()) { val enabledAtTopLevel = isInternalTester() || isGlobalFeatureEnabled() - val canIntegrateAutofill = autofillFeature.canIntegrateAutofillInWebView().isEnabled() + val canIntegrateAutofill = autofillFeature.canIntegrateWebMessageBasedAutofillInWebView().isEnabled() enabledAtTopLevel && canIntegrateAutofill && !isAnException(url) } } diff --git a/autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/InlineBrowserAutofill.kt b/autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/InlineBrowserAutofill.kt index 6fbbaa955ac3..e6a797b7aa79 100644 --- a/autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/InlineBrowserAutofill.kt +++ b/autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/InlineBrowserAutofill.kt @@ -118,8 +118,6 @@ class AutofillWebMessageAttacherImpl @Inject constructor( private val safeWebMessageHandler: SafeWebMessageHandler, ) : AutofillWebMessageAttacher { - @SuppressLint("AddWebMessageListenerUsage") - // suppress AddWebMessageListenerUsage, we don't have access to DuckDuckGoWebView here. override suspend fun addListener( webView: WebView, listener: AutofillWebMessageListener, diff --git a/autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/AutofillGlobalCapabilityCheckerImplGlobalFeatureTest.kt b/autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/AutofillGlobalCapabilityCheckerImplGlobalFeatureTest.kt index 20a4024798b6..b3686be55213 100644 --- a/autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/AutofillGlobalCapabilityCheckerImplGlobalFeatureTest.kt +++ b/autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/AutofillGlobalCapabilityCheckerImplGlobalFeatureTest.kt @@ -230,7 +230,7 @@ class AutofillGlobalCapabilityCheckerImplGlobalFeatureTest( private fun configureCanIntegrateAutofillSubfeature(isEnabled: Boolean) { val toggle: Toggle = mock() whenever(toggle.isEnabled()).thenReturn(isEnabled) - whenever(autofillFeature.canIntegrateAutofillInWebView()).thenReturn(toggle) + whenever(autofillFeature.canIntegrateWebMessageBasedAutofillInWebView()).thenReturn(toggle) } private fun configureIfUrlIsException(isException: Boolean) { diff --git a/autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/InlineBrowserAutofillTest.kt b/autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/InlineBrowserAutofillTest.kt index 4881053b0588..1b82496fa079 100644 --- a/autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/InlineBrowserAutofillTest.kt +++ b/autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/InlineBrowserAutofillTest.kt @@ -95,7 +95,7 @@ class InlineBrowserAutofillTest { canSaveCredentials: Boolean = true, canGeneratePassword: Boolean = true, canAccessCredentialManagement: Boolean = true, - canIntegrateAutofillInWebView: Boolean = true, + canIntegrateWebMessageBasedAutofillInWebView: Boolean = true, deviceWebViewSupportsAutofill: Boolean = true, ): InlineBrowserAutofill { val autofillFeature = FakeFeatureToggleFactory.create(AutofillFeature::class.java) @@ -104,10 +104,10 @@ class InlineBrowserAutofillTest { autofillFeature.canSaveCredentials().setRawStoredState(State(enable = canSaveCredentials)) autofillFeature.canGeneratePasswords().setRawStoredState(State(enable = canGeneratePassword)) autofillFeature.canAccessCredentialManagement().setRawStoredState(State(enable = canAccessCredentialManagement)) - autofillFeature.canIntegrateAutofillInWebView().setRawStoredState(State(enable = canIntegrateAutofillInWebView)) + autofillFeature.canIntegrateWebMessageBasedAutofillInWebView().setRawStoredState(State(enable = canIntegrateWebMessageBasedAutofillInWebView)) whenever(capabilityChecker.webViewSupportsAutofill()).thenReturn(deviceWebViewSupportsAutofill) - whenever(capabilityChecker.canInjectCredentialsToWebView(any())).thenReturn(canIntegrateAutofillInWebView) + whenever(capabilityChecker.canInjectCredentialsToWebView(any())).thenReturn(canInjectCredentials) return InlineBrowserAutofill( autofillCapabilityChecker = capabilityChecker, diff --git a/autofill/autofill-internal/src/main/java/com/duckduckgo/autofill/internal/AutofillInternalSettingsActivity.kt b/autofill/autofill-internal/src/main/java/com/duckduckgo/autofill/internal/AutofillInternalSettingsActivity.kt index 308f6531e0a5..2047dbff7c27 100644 --- a/autofill/autofill-internal/src/main/java/com/duckduckgo/autofill/internal/AutofillInternalSettingsActivity.kt +++ b/autofill/autofill-internal/src/main/java/com/duckduckgo/autofill/internal/AutofillInternalSettingsActivity.kt @@ -117,7 +117,7 @@ class AutofillInternalSettingsActivity : DuckDuckGoActivity() { val autofillEnabled = autofillFeature.self() val onByDefault = autofillFeature.onByDefault() val onForExistingUsers = autofillFeature.onForExistingUsers() - val canIntegrateAutofill = autofillFeature.canIntegrateAutofillInWebView() + val canIntegrateAutofill = autofillFeature.canIntegrateWebMessageBasedAutofillInWebView() val canSaveCredentials = autofillFeature.canSaveCredentials() val canInjectCredentials = autofillFeature.canInjectCredentials() val canGeneratePasswords = autofillFeature.canGeneratePasswords()