Bug 1848188 - Remove Nimbus flag for Juno Onboarding

fenix/119.0
Gabriel Luong 10 months ago committed by mergify[bot]
parent c244185103
commit c98daeece8

@ -47,9 +47,6 @@ juno-onboarding:
cards:
type: json
description: Collection of user facing onboarding cards.
enabled:
type: boolean
description: "if true, juno onboarding is shown to the user."
messaging:
description: "The in-app messaging system.\n"
hasExposure: true

@ -5,10 +5,6 @@ features:
description: A feature that shows juno onboarding flow.
variables:
enabled:
description: if true, juno onboarding is shown to the user.
type: Boolean
default: false
cards:
description: Collection of user facing onboarding cards.
type: Map<String, OnboardingCardData>
@ -51,14 +47,6 @@ features:
primary-button-label: juno_onboarding_enable_notifications_positive_button
secondary-button-label: juno_onboarding_enable_notifications_negative_button
defaults:
- channel: developer
value:
enabled: false
- channel: nightly
value:
enabled: true
objects:
OnboardingCardData:

@ -308,6 +308,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
if (savedInstanceState == null) {
navigateToHome()
}
if (!shouldStartOnHome() && shouldNavigateToBrowserOnColdStart(savedInstanceState)) {
navigateToBrowserOnColdStart()
} else {
@ -317,6 +318,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
if (settings().showHomeOnboardingDialog && components.fenixOnboarding.userHasBeenOnboarded()) {
navHost.navController.navigate(NavGraphDirections.actionGlobalHomeOnboardingDialog())
}
showNotificationPermissionPromptIfRequired()
}
@ -413,10 +415,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
* Show the pre permission dialog to the user once if the notification are not enabled.
*/
private fun showNotificationPermissionPromptIfRequired() {
if (settings().junoOnboardingEnabled) {
return
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
!NotificationManagerCompat.from(applicationContext).areNotificationsEnabledSafe() &&
settings().numberOfAppLaunches <= 1

@ -1659,21 +1659,17 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = false,
)
/**
* Indicates if juno onboarding feature is enabled.
*/
val junoOnboardingEnabled: Boolean
get() = FxNimbus.features.junoOnboarding.value().enabled
/**
* Returns whether juno onboarding should be shown to the user.
*
* @param hasUserBeenOnboarded Boolean to indicate whether the user has been onboarded.
* @param isLauncherIntent Boolean to indicate whether the app was launched on tapping on the
* app icon.
*/
fun shouldShowJunoOnboarding(hasUserBeenOnboarded: Boolean, isLauncherIntent: Boolean): Boolean {
return if (!hasUserBeenOnboarded && isLauncherIntent) {
FxNimbus.features.junoOnboarding.recordExposure()
junoOnboardingEnabled
true
} else {
false
}

@ -827,22 +827,8 @@ class SettingsTest {
}
@Test
fun `GIVEN junoOnboarding is disabled THEN shouldShowJunoOnboarding returns false`() {
fun `GIVEN hasUserBeenOnboarded is false and isLauncherIntent is false THEN shouldShowJunoOnboarding returns false`() {
val settings = spyk(settings)
every { settings.junoOnboardingEnabled } returns false
val actual = settings.shouldShowJunoOnboarding(
hasUserBeenOnboarded = false,
isLauncherIntent = true,
)
assertFalse(actual)
}
@Test
fun `GIVEN junoOnboarding is enabled, hasUserBeenOnboarded is false and isLauncherIntent is false THEN shouldShowJunoOnboarding returns false`() {
val settings = spyk(settings)
every { settings.junoOnboardingEnabled } returns true
val actual = settings.shouldShowJunoOnboarding(
hasUserBeenOnboarded = false,
@ -853,9 +839,8 @@ class SettingsTest {
}
@Test
fun `GIVEN junoOnboarding is enabled and hasUserBeenOnboarded is true THEN shouldShowJunoOnboarding returns false`() {
fun `GIVEN hasUserBeenOnboarded is true THEN shouldShowJunoOnboarding returns false`() {
val settings = spyk(settings)
every { settings.junoOnboardingEnabled } returns true
val actual = settings.shouldShowJunoOnboarding(
hasUserBeenOnboarded = true,
@ -866,9 +851,8 @@ class SettingsTest {
}
@Test
fun `GIVEN junoOnboarding is enabled, hasUserBeenOnboarded is false and isLauncherIntent is true THEN shouldShowJunoOnboarding returns true`() {
fun `GIVEN hasUserBeenOnboarded is false and isLauncherIntent is true THEN shouldShowJunoOnboarding returns true`() {
val settings = spyk(settings)
every { settings.junoOnboardingEnabled } returns true
val actual = settings.shouldShowJunoOnboarding(
hasUserBeenOnboarded = false,

Loading…
Cancel
Save