Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Commit

Permalink
Closes #2543: fixed bug where TV Guide onboarding is shown
Browse files Browse the repository at this point in the history
Previously, onboarding was shown in any EN locales.  It should only be shown in EN-US
  • Loading branch information
Michelle Wong authored and liuche committed Jul 13, 2019
1 parent 3d4819a commit c9dd1b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/org/mozilla/tv/firefox/utils/Settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.mozilla.tv.firefox.R
import org.mozilla.tv.firefox.channels.ChannelConfig
import org.mozilla.tv.firefox.channels.ChannelOnboardingActivity
import org.mozilla.tv.firefox.components.locale.LocaleManager
import org.mozilla.tv.firefox.ext.languageAndMaybeCountryMatch

/**
* A simple wrapper for SharedPreferences that makes reading preference a little bit easier.
Expand Down Expand Up @@ -51,10 +52,11 @@ class Settings private constructor(context: Context) {

fun shouldShowTVOnboarding(localeManager: LocaleManager, context: Context): Boolean {
val channelConfig = ChannelConfig.getTvGuideConfig(context)
val currentLocale = localeManager.getCurrentLocale(context)

return !preferences.getBoolean(ChannelOnboardingActivity.TV_ONBOARDING_SHOWN_PREF, false) &&
channelConfig.isEnabledInCurrentExperiment &&
localeManager.currentLanguageIsEnglish(context)
currentLocale.languageAndMaybeCountryMatch(channelConfig.enabledInLocales)
}

fun shouldAutocompleteFromShippedDomainList() = true
Expand Down

0 comments on commit c9dd1b4

Please sign in to comment.