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

Change autofill subfeature names in prep for releasing #3053

Merged
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 @@ -30,23 +30,23 @@ interface AutofillFeature {
fun self(): Toggle

/**
* @return `true` when the remote config has the global "injectCredentials" autofill sub-feature flag enabled
* @return `true` when the remote config has the global "canInjectCredentials" autofill sub-feature flag enabled
* If the remote feature is not present defaults to `false`
*/
@Toggle.DefaultValue(false)
fun injectCredentials(): Toggle
fun canInjectCredentials(): Toggle

/**
* @return `true` when the remote config has the global "saveCredentials" autofill sub-feature flag enabled
* @return `true` when the remote config has the global "canSaveCredentials" autofill sub-feature flag enabled
* If the remote feature is not present defaults to `false`
*/
@Toggle.DefaultValue(false)
fun saveCredentials(): Toggle
fun canSaveCredentials(): Toggle

/**
* @return `true` when the remote config has the global "accessCredentialManagement" autofill sub-feature flag enabled
* @return `true` when the remote config has the global "canAccessCredentialManagement" autofill sub-feature flag enabled
* If the remote feature is not present defaults to `false`
*/
@Toggle.DefaultValue(false)
fun accessCredentialManagement(): Toggle
fun canAccessCredentialManagement(): Toggle
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AutofillCapabilityCheckerImpl @Inject constructor(

if (isInternalTester()) return@withContext true

return@withContext autofillFeature.injectCredentials().isEnabled()
return@withContext autofillFeature.canInjectCredentials().isEnabled()
}

override suspend fun canSaveCredentialsFromWebView(url: String): Boolean = withContext(dispatcherProvider.io()) {
Expand All @@ -50,7 +50,7 @@ class AutofillCapabilityCheckerImpl @Inject constructor(

if (isInternalTester()) return@withContext true

return@withContext autofillFeature.saveCredentials().isEnabled()
return@withContext autofillFeature.canSaveCredentials().isEnabled()
}

/**
Expand All @@ -62,7 +62,7 @@ class AutofillCapabilityCheckerImpl @Inject constructor(
override suspend fun canAccessCredentialManagementScreen(): Boolean = withContext(dispatcherProvider.io()) {
if (isInternalTester()) return@withContext true
if (!isGlobalFeatureEnabled()) return@withContext false
return@withContext autofillFeature.accessCredentialManagement().isEnabled()
return@withContext autofillFeature.canAccessCredentialManagement().isEnabled()
}

private suspend fun isInternalTester(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
"reason": "site breakage"
}
],
"state": "enabled"
"state": "enabled",
"hash": "0"
},
"clickToPlay": {
"exceptions": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import com.duckduckgo.privacy.config.store.features.useragent.UserAgentDao
)
@Database(
exportSchema = true,
version = 11,
version = 12,
entities = [
TrackerAllowlistEntity::class,
UnprotectedTemporaryEntity::class,
Expand Down Expand Up @@ -92,4 +92,10 @@ val MIGRATION_10_11 = object : Migration(10, 11) {
}
}

val ALL_MIGRATIONS = arrayOf(MIGRATION_2_3, MIGRATION_3_4, MIGRATION_10_11)
val MIGRATION_11_12 = object : Migration(11, 12) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("DELETE FROM privacy_config")
}
}

val ALL_MIGRATIONS = arrayOf(MIGRATION_2_3, MIGRATION_3_4, MIGRATION_10_11, MIGRATION_11_12)