mirror of
https://github.com/bitwarden/android.git
synced 2026-03-14 06:04:20 -05:00
PM-15514 add feature flag key for app review prompt (#4414)
This commit is contained in:
@@ -35,6 +35,7 @@ sealed class FlagKey<out T : Any> {
|
||||
VerifiedSsoDomainEndpoint,
|
||||
CredentialExchangeProtocolImport,
|
||||
CredentialExchangeProtocolExport,
|
||||
AppReviewPrompt,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -122,6 +123,15 @@ sealed class FlagKey<out T : Any> {
|
||||
override val isRemotelyConfigured: Boolean = true
|
||||
}
|
||||
|
||||
/**
|
||||
* Data object holding the feature flag key for the App Review Prompt feature.
|
||||
*/
|
||||
data object AppReviewPrompt : FlagKey<Boolean>() {
|
||||
override val keyName: String = "app-review-prompt"
|
||||
override val defaultValue: Boolean = false
|
||||
override val isRemotelyConfigured: Boolean = true
|
||||
}
|
||||
|
||||
//region Dummy keys for testing
|
||||
/**
|
||||
* Data object holding the key for a [Boolean] flag to be used in tests.
|
||||
|
||||
@@ -31,6 +31,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
|
||||
FlagKey.VerifiedSsoDomainEndpoint,
|
||||
FlagKey.CredentialExchangeProtocolImport,
|
||||
FlagKey.CredentialExchangeProtocolExport,
|
||||
FlagKey.AppReviewPrompt,
|
||||
-> BooleanFlagItem(
|
||||
label = flagKey.getDisplayLabel(),
|
||||
key = flagKey as FlagKey<Boolean>,
|
||||
@@ -77,4 +78,5 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
|
||||
FlagKey.VerifiedSsoDomainEndpoint -> stringResource(R.string.verified_sso_domain_verified)
|
||||
FlagKey.CredentialExchangeProtocolImport -> stringResource(R.string.cxp_import)
|
||||
FlagKey.CredentialExchangeProtocolExport -> stringResource(R.string.cxp_export)
|
||||
FlagKey.AppReviewPrompt -> stringResource(R.string.app_review_prompt)
|
||||
}
|
||||
|
||||
@@ -20,5 +20,6 @@
|
||||
<string name="restart_onboarding_details">This will reset the onboarding status for the current user, if available. After clicking the button you will immediately be redirected to the onboarding flow. Onboarding flag must be enabled.</string>
|
||||
<string name="restart_onboarding_carousel">Show Onboarding Carousel</string>
|
||||
<string name="restart_onboarding_carousel_details">This will force the change to app state which will cause the first time carousel to show. The carousel will continue to show for any \"new\" account until a login is completed. May need to exit debug menu manually.</string>
|
||||
<string name="app_review_prompt">App Review Prompt</string>
|
||||
<!-- /Debug Menu -->
|
||||
</resources>
|
||||
|
||||
@@ -35,4 +35,9 @@ class FlagKeyTest {
|
||||
fun `SshKeyCipherItems default value should be false`() {
|
||||
assertFalse(FlagKey.SshKeyCipherItems.defaultValue)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `AppReviewPrompt default value should be false`() {
|
||||
assertFalse(FlagKey.AppReviewPrompt.defaultValue)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ private val DEFAULT_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
||||
FlagKey.VerifiedSsoDomainEndpoint to true,
|
||||
FlagKey.CredentialExchangeProtocolImport to true,
|
||||
FlagKey.CredentialExchangeProtocolExport to true,
|
||||
FlagKey.AppReviewPrompt to true,
|
||||
)
|
||||
|
||||
private val UPDATED_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
||||
@@ -128,6 +129,7 @@ private val UPDATED_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
||||
FlagKey.VerifiedSsoDomainEndpoint to false,
|
||||
FlagKey.CredentialExchangeProtocolImport to false,
|
||||
FlagKey.CredentialExchangeProtocolExport to false,
|
||||
FlagKey.AppReviewPrompt to false,
|
||||
)
|
||||
|
||||
private val DEFAULT_STATE = DebugMenuState(
|
||||
|
||||
Reference in New Issue
Block a user