1
0
Fork 0

Copione merged onto master
continuous-integration/drone/push Build is passing Details

master
blallo 2020-08-05 00:00:30 +02:00
commit fc984b40f8
49 changed files with 477 additions and 325 deletions

View File

@ -0,0 +1,19 @@
---
name: "⌛ Performance issue"
about: Create a performance issue if the app is slow or it uses too much memory, disk space, battery, or network data
title: ""
labels: "eng:performance"
assignees: ''
---
## Steps to reproduce
### Expected behavior
### Actual behavior
### Device information
* Android device: ?
* Fenix version: ?

View File

@ -11,7 +11,6 @@ import mozilla.components.browser.storage.sync.PlacesHistoryStorage
import okhttp3.mockwebserver.MockWebServer
import org.junit.After
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
@ -165,7 +164,6 @@ class HistoryTest {
}
}
@Ignore("Failing test: https://github.com/mozilla-mobile/fenix/issues/12893")
@Test
fun deleteAllHistoryTest() {
val firstWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)

View File

@ -44,12 +44,6 @@ import org.mozilla.fenix.helpers.click
import org.mozilla.fenix.helpers.ext.waitNotNull
class BrowserRobot {
fun verifyBrowserScreen() {
onView(ViewMatchers.withResourceName("browserLayout"))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
}
fun verifyCurrentPrivateSession(context: Context) {
val session = context.components.core.sessionManager.selectedSession
assertTrue("Current session is private", session?.private!!)
@ -84,6 +78,10 @@ class BrowserRobot {
*/
fun verifyPageContent(expectedText: String) {
mDevice.waitNotNull(
Until.findObject(By.res("org.mozilla.fenix.debug:id/engineView")),
waitingTime
)
assertTrue(mDevice.findObject(UiSelector().text(expectedText)).waitForExists(waitingTime))
}
@ -145,7 +143,8 @@ class BrowserRobot {
fun verifyEnhancedTrackingProtectionSwitch() = assertEnhancedTrackingProtectionSwitch()
fun clickEnhancedTrackingProtectionSwitchOffOn() = onView(withResourceName("switch_widget")).click()
fun clickEnhancedTrackingProtectionSwitchOffOn() =
onView(withResourceName("switch_widget")).click()
fun verifyProtectionSettingsButton() = assertProtectionSettingsButton()
@ -191,7 +190,8 @@ class BrowserRobot {
fun clickEnhancedTrackingProtectionPanel() = enhancedTrackingProtectionPanel().click()
fun verifyEnhancedTrackingProtectionPanelNotVisible() = assertEnhancedTrackingProtectionPanelNotVisible()
fun verifyEnhancedTrackingProtectionPanelNotVisible() =
assertEnhancedTrackingProtectionPanelNotVisible()
fun clickContextOpenLinkInNewTab() {
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
@ -423,7 +423,8 @@ fun navURLBar() = onView(withId(R.id.mozac_browser_toolbar_url_view))
private fun assertNavURLBar() = navURLBar()
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
fun enhancedTrackingProtectionPanel() = onView(withId(R.id.mozac_browser_toolbar_tracking_protection_indicator))
fun enhancedTrackingProtectionPanel() =
onView(withId(R.id.mozac_browser_toolbar_tracking_protection_indicator))
private fun assertEnhancedTrackingProtectionPanelNotVisible() {
enhancedTrackingProtectionPanel()

View File

@ -15,6 +15,7 @@ import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withParent
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiSelector
import androidx.test.uiautomator.Until
import org.hamcrest.Matchers
import org.hamcrest.Matchers.allOf
@ -31,12 +32,10 @@ class HistoryRobot {
fun verifyHistoryMenuView() = assertHistoryMenuView()
fun verifyEmptyHistoryView() {
mDevice.waitNotNull(
Until.findObject(
By.text("No history here")
),
waitingTime
)
mDevice.findObject(
UiSelector().text("No history here")
).waitForExists(waitingTime)
assertEmptyHistoryView()
}

View File

@ -282,6 +282,9 @@
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />
<meta-data
android:name="firebase_analytics_collection_deactivated"
android:value="true" />
<!-- Removes the default Workmanager initialization so that we can use on-demand initializer. -->
<provider
android:name="androidx.work.impl.WorkManagerInitializer"

View File

@ -38,4 +38,14 @@ object FeatureFlags {
* Enables viewing tab history
*/
val tabHistory = Config.channel.isNightlyOrDebug
/**
* Enables the new search experience
*/
val newSearchExperience = Config.channel.isDebug
/**
* Enables wait til first contentful paint
*/
val waitUntilPaintToDraw = Config.channel.isDebug
}

View File

@ -12,8 +12,8 @@ import android.util.Log.INFO
import androidx.annotation.CallSuper
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.content.getSystemService
import androidx.work.Configuration.Provider
import androidx.work.Configuration.Builder
import androidx.work.Configuration.Provider
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
@ -93,7 +93,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
setupInMainProcessOnly()
}
protected fun initializeGlean() {
protected open fun initializeGlean() {
val telemetryEnabled = settings().isTelemetryEnabled
logger.debug("Initializing Glean (uploadEnabled=$telemetryEnabled, isFennec=${Config.channel.isFennec})")

View File

@ -144,9 +144,11 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
private val fullScreenFeature = ViewBoundFeatureWrapper<FullScreenFeature>()
private val swipeRefreshFeature = ViewBoundFeatureWrapper<SwipeRefreshFeature>()
private val webchannelIntegration = ViewBoundFeatureWrapper<FxaWebChannelFeature>()
private val sitePermissionWifiIntegration = ViewBoundFeatureWrapper<SitePermissionsWifiIntegration>()
private val sitePermissionWifiIntegration =
ViewBoundFeatureWrapper<SitePermissionsWifiIntegration>()
private val secureWindowFeature = ViewBoundFeatureWrapper<SecureWindowFeature>()
private var fullScreenMediaFeature = ViewBoundFeatureWrapper<MediaFullscreenOrientationFeature>()
private var fullScreenMediaFeature =
ViewBoundFeatureWrapper<MediaFullscreenOrientationFeature>()
private var pipFeature: PictureInPictureFeature? = null
var customTabSessionId: String? = null
@ -202,7 +204,8 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
engineView = WeakReference(engineView),
swipeRefresh = WeakReference(swipeRefresh),
viewLifecycleScope = WeakReference(viewLifecycleOwner.lifecycleScope),
arguments = requireArguments()
arguments = requireArguments(),
firstContentfulHappened = ::didFirstContentfulHappen
).apply {
beginAnimateInIfNecessary()
}
@ -412,8 +415,10 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
}
}
resumeDownloadDialogState(sessionManager.selectedSession?.id,
store, view, context, toolbarHeight)
resumeDownloadDialogState(
sessionManager.selectedSession?.id,
store, view, context, toolbarHeight
)
downloadsFeature.set(
downloadFeature,
@ -506,7 +511,11 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
onNeedToRequestPermissions = { permissions ->
requestPermissions(permissions, REQUEST_CODE_APP_PERMISSIONS)
},
onShouldShowRequestPermissionRationale = { shouldShowRequestPermissionRationale(it) }),
onShouldShowRequestPermissionRationale = {
shouldShowRequestPermissionRationale(
it
)
}),
owner = this,
view = view
)
@ -568,6 +577,21 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
.collect { tab -> pipModeChanged(tab) }
}
if (context.settings().waitToShowPageUntilFirstPaint) {
store.flowScoped(viewLifecycleOwner) { flow ->
flow.mapNotNull { state ->
state.findTabOrCustomTabOrSelectedTab(
customTabSessionId
)
}
.ifChanged { it.content.firstContentfulPaint }
.collect {
engineView?.asView()?.isVisible =
it.content.firstContentfulPaint || it.content.progress == 100
}
}
}
@Suppress("ConstantConditionIf")
if (FeatureFlags.pullToRefreshEnabled) {
val primaryTextColor =
@ -687,7 +711,12 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
val context = requireContext()
val behavior = when (context.settings().toolbarPosition) {
ToolbarPosition.BOTTOM -> EngineViewBottomBehavior(context, null)
ToolbarPosition.TOP -> SwipeRefreshScrollingViewBehavior(context, null, engineView, browserToolbarView)
ToolbarPosition.TOP -> SwipeRefreshScrollingViewBehavior(
context,
null,
engineView,
browserToolbarView
)
}
(swipeRefresh.layoutParams as CoordinatorLayout.LayoutParams).behavior = behavior
@ -751,12 +780,13 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
super.onStop()
initUIJob?.cancel()
requireComponents.core.store.state.findTabOrCustomTabOrSelectedTab(customTabSessionId)?.let { session ->
// If we didn't enter PiP, exit full screen on stop
if (!session.content.pictureInPictureEnabled && fullScreenFeature.onBackPressed()) {
fullScreenChanged(false)
requireComponents.core.store.state.findTabOrCustomTabOrSelectedTab(customTabSessionId)
?.let { session ->
// If we didn't enter PiP, exit full screen on stop
if (!session.content.pictureInPictureEnabled && fullScreenFeature.onBackPressed()) {
fullScreenChanged(false)
}
}
}
}
@CallSuper
@ -950,7 +980,10 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
.setAction(getString(R.string.edit_bookmark_snackbar_action)) {
nav(
R.id.browserFragment,
BrowserFragmentDirections.actionGlobalBookmarkEditFragment(guid, true)
BrowserFragmentDirections.actionGlobalBookmarkEditFragment(
guid,
true
)
)
}
.show()
@ -988,10 +1021,10 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
// Close find in page bar if opened
findInPageIntegration.onBackPressed()
FenixSnackbar.make(
view = requireView().browserLayout,
duration = Snackbar.LENGTH_SHORT,
isDisplayedWithBrowserToolbar = false
)
view = requireView().browserLayout,
duration = Snackbar.LENGTH_SHORT,
isDisplayedWithBrowserToolbar = false
)
.setText(getString(R.string.full_screen_notification))
.show()
activity?.enterToImmersiveMode()
@ -1014,6 +1047,12 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
}
}
private fun didFirstContentfulHappen() =
if (!requireContext().settings().waitToShowPageUntilFirstPaint) true else
context?.components?.core?.store?.state?.findTabOrCustomTabOrSelectedTab(
customTabSessionId
)?.content?.firstContentfulPaint ?: false
/*
* Dereference these views when the fragment view is destroyed to prevent memory leaks
*/

View File

@ -34,7 +34,8 @@ class BrowserAnimator(
private val engineView: WeakReference<EngineView>,
private val swipeRefresh: WeakReference<View>,
private val viewLifecycleScope: WeakReference<LifecycleCoroutineScope>,
private val arguments: Bundle
private val arguments: Bundle,
private val firstContentfulHappened: () -> Boolean
) {
private val unwrappedEngineView: EngineView?
@ -53,22 +54,9 @@ class BrowserAnimator(
}
doOnEnd {
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
unwrappedSwipeRefresh?.background = null
arguments.putBoolean(SHOULD_ANIMATE_FLAG, false)
}
interpolator = DecelerateInterpolator()
duration = ANIMATION_DURATION
}
private val browserFadeInValueAnimator = ValueAnimator.ofFloat(0f, END_ANIMATOR_VALUE).apply {
addUpdateListener {
unwrappedSwipeRefresh?.alpha = it.animatedFraction
}
doOnEnd {
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
if (firstContentfulHappened()) {
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
}
unwrappedSwipeRefresh?.background = null
arguments.putBoolean(SHOULD_ANIMATE_FLAG, false)
}
@ -93,20 +81,10 @@ class BrowserAnimator(
}
} else {
unwrappedSwipeRefresh?.alpha = 1f
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
unwrappedSwipeRefresh?.background = null
}
}
/**
* Triggers the *zoom out* browser animation to run.
*/
fun beginAnimateOut() {
viewLifecycleScope.get()?.launch(Dispatchers.Main) {
captureEngineViewAndDrawStatically {
unwrappedEngineView?.asView()?.visibility = View.GONE
browserZoomInValueAnimator.reverse()
if (firstContentfulHappened()) {
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
}
unwrappedSwipeRefresh?.background = null
}
}

View File

@ -24,7 +24,7 @@ class TrackingProtectionPolicyFactory(private val settings: Settings) {
@Suppress("ComplexMethod")
fun createTrackingProtectionPolicy(
normalMode: Boolean = settings.shouldUseTrackingProtection,
privateMode: Boolean = true
privateMode: Boolean = settings.shouldUseTrackingProtection
): TrackingProtectionPolicy {
val trackingProtectionPolicy =
when {

View File

@ -5,7 +5,9 @@
package org.mozilla.fenix.components.metrics
import android.app.Application
import android.content.Context.MODE_PRIVATE
import android.util.Log
import androidx.annotation.VisibleForTesting
import com.leanplum.Leanplum
import com.leanplum.LeanplumActivityHelper
import com.leanplum.annotations.Parser
@ -34,7 +36,9 @@ private val Event.name: String?
is Event.InteractWithSearchURLArea -> "E_Interact_With_Search_URL_Area"
is Event.CollectionSaved -> "E_Collection_Created"
is Event.CollectionTabRestored -> "E_Collection_Tab_Opened"
is Event.SyncAuthSignIn -> "E_Sign_In_FxA"
is Event.SyncAuthSignUp -> "E_FxA_New_Signup"
is Event.SyncAuthSignIn, Event.SyncAuthPaired, Event.SyncAuthOtherExternal -> "E_Sign_In_FxA"
is Event.SyncAuthFromShared -> "E_Sign_In_FxA_Fennec_to_Fenix"
is Event.SyncAuthSignOut -> "E_Sign_Out_FxA"
is Event.ClearedPrivateData -> "E_Cleared_Private_Data"
is Event.DismissedOnboarding -> "E_Dismissed_Onboarding"
@ -48,7 +52,10 @@ private val Event.name: String?
else -> null
}
class LeanplumMetricsService(private val application: Application) : MetricsService {
class LeanplumMetricsService(
private val application: Application,
private val deviceIdGenerator: () -> String = { randomUUID().toString() }
) : MetricsService {
val scope = CoroutineScope(Dispatchers.IO)
var leanplumJob: Job? = null
@ -72,13 +79,27 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ
override val type = MetricServiceType.Marketing
private val token = Token(LeanplumId, LeanplumToken)
private val preferences = application.getSharedPreferences(PREFERENCE_NAME, MODE_PRIVATE)
@VisibleForTesting
internal val deviceId by lazy {
var deviceId = preferences.getString(DEVICE_ID_KEY, null)
if (deviceId == null) {
deviceId = deviceIdGenerator.invoke()
preferences.edit().putString(DEVICE_ID_KEY, deviceId).apply()
}
deviceId
}
override fun start() {
if (!application.settings().isMarketingTelemetryEnabled) return
Leanplum.setIsTestModeEnabled(false)
Leanplum.setApplicationContext(application)
Leanplum.setDeviceId(randomUUID().toString())
Leanplum.setDeviceId(deviceId)
Parser.parseVariables(application)
leanplumJob = scope.launch {
@ -87,13 +108,13 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ
val currentLocale = applicationSetLocale ?: Locale.getDefault()
val languageCode =
currentLocale.iso3LanguageOrNull
?: currentLocale.language.let {
if (it.isNotBlank()) {
it
} else {
currentLocale.toString()
?: currentLocale.language.let {
if (it.isNotBlank()) {
it
} else {
currentLocale.toString()
}
}
}
if (!isLeanplumEnabled(languageCode)) {
Log.i(LOGTAG, "Leanplum is not available for this locale: $languageCode")
@ -122,18 +143,21 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ
}
}
Leanplum.start(application, hashMapOf(
"default_browser" to MozillaProductDetector.getMozillaBrowserDefault(application).orEmpty(),
"fennec_installed" to installedApps.contains(MozillaProducts.FIREFOX.productName),
"focus_installed" to installedApps.contains(MozillaProducts.FOCUS.productName),
"klar_installed" to installedApps.contains(MozillaProducts.KLAR.productName),
"fxa_signed_in" to application.settings().fxaSignedIn,
"fxa_has_synced_items" to application.settings().fxaHasSyncedItems,
"search_widget_installed" to application.settings().searchWidgetInstalled,
"tracking_protection_enabled" to application.settings().shouldUseTrackingProtection,
"tracking_protection_setting" to trackingProtection,
"fenix" to true
))
Leanplum.start(
application, hashMapOf(
"default_browser" to MozillaProductDetector.getMozillaBrowserDefault(application)
.orEmpty(),
"fennec_installed" to installedApps.contains(MozillaProducts.FIREFOX.productName),
"focus_installed" to installedApps.contains(MozillaProducts.FOCUS.productName),
"klar_installed" to installedApps.contains(MozillaProducts.KLAR.productName),
"fxa_signed_in" to application.settings().fxaSignedIn,
"fxa_has_synced_items" to application.settings().fxaHasSyncedItems,
"search_widget_installed" to application.settings().searchWidgetInstalled,
"tracking_protection_enabled" to application.settings().shouldUseTrackingProtection,
"tracking_protection_setting" to trackingProtection,
"fenix" to true
)
)
withContext(Main) {
LeanplumInternal.setCalledStart(true)
@ -182,7 +206,9 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ
get() =
try {
this.isO3Language
} catch (_: MissingResourceException) { null }
} catch (_: MissingResourceException) {
null
}
companion object {
private const val LOGTAG = "LeanplumMetricsService"
@ -193,6 +219,7 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ
private val LeanplumToken: String
// Debug builds have a null (nullable) LEANPLUM_TOKEN
get() = BuildConfig.LEANPLUM_TOKEN.orEmpty()
// Leanplum needs to be enabled for the following locales.
// Irrespective of the actual device location.
private val LEANPLUM_ENABLED_LOCALES = setOf(
@ -212,5 +239,8 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ
"ara", // Arabic
"jpn" // Japanese
)
private val PREFERENCE_NAME = "LEANPLUM_PREFERENCES"
private val DEVICE_ID_KEY = "LP_DEVICE_ID"
}
}

View File

@ -251,10 +251,10 @@ class BrowserToolbarView(
}
private fun ToolbarMenu.Item.performHapticIfNeeded(view: View) {
(this as? ToolbarMenu.Item.Reload)?.also { reload ->
if (reload.bypassCache) {
view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
}
if (this is ToolbarMenu.Item.Reload && this.bypassCache ||
this is ToolbarMenu.Item.Forward && this.viewHistory
) {
view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
}
}
}

View File

@ -673,9 +673,13 @@ class HomeFragment : Fragment() {
}
private fun navigateToSearch() {
val directions = HomeFragmentDirections.actionGlobalSearch(
sessionId = null
)
val directions = if (requireContext().settings().useNewSearchExperience) {
HomeFragmentDirections.actionGlobalSearchDialog()
} else {
HomeFragmentDirections.actionGlobalSearch(
sessionId = null
)
}
nav(R.id.homeFragment, directions, getToolbarNavOptions(requireContext()))
}

View File

@ -77,8 +77,7 @@ class OnboardingTrackingProtectionViewHolder(view: View) : RecyclerView.ViewHold
private fun updateTrackingProtectionSetting(enabled: Boolean) {
itemView.context.settings().shouldUseTrackingProtection = enabled
with(itemView.context.components) {
val policy = core.trackingProtectionPolicyFactory
.createTrackingProtectionPolicy(enabled)
val policy = core.trackingProtectionPolicyFactory.createTrackingProtectionPolicy()
useCases.settingsUseCases.updateTrackingProtection.invoke(policy)
useCases.sessionUseCases.reload.invoke()
}

View File

@ -0,0 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.searchdialog
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatDialogFragment
import org.mozilla.fenix.R
class SearchDialogFragment : AppCompatDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? = inflater.inflate(R.layout.fragment_search_dialog, container, false)
}

View File

@ -6,7 +6,10 @@ package org.mozilla.fenix.settings
import android.os.Bundle
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreference
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
/**
@ -21,5 +24,17 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.secret_settings_preferences, rootKey)
requirePreference<SwitchPreference>(R.string.pref_key_use_new_search_experience).apply {
isVisible = FeatureFlags.newSearchExperience
isChecked = context.settings().useNewSearchExperience
onPreferenceChangeListener = SharedPreferenceUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_wait_first_paint).apply {
isVisible = FeatureFlags.waitUntilPaintToDraw
isChecked = context.settings().waitToShowPageUntilFirstPaint
onPreferenceChangeListener = SharedPreferenceUpdater()
}
}
}

View File

@ -64,8 +64,7 @@ class TrackingProtectionFragment : PreferenceFragmentCompat() {
preference.context.settings().shouldUseTrackingProtection =
trackingProtectionOn
with(preference.context.components) {
val policy = core.trackingProtectionPolicyFactory
.createTrackingProtectionPolicy(trackingProtectionOn)
val policy = core.trackingProtectionPolicyFactory.createTrackingProtectionPolicy()
useCases.settingsUseCases.updateTrackingProtection(policy)
useCases.sessionUseCases.reload()
}

View File

@ -43,11 +43,6 @@ class ShareFragment : AppCompatDialogFragment() {
viewModel.loadDevicesAndApps()
}
override fun dismiss() {
consumePrompt { onDismiss() }
super.dismiss()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NO_TITLE, R.style.ShareDialogStyle)
@ -55,6 +50,7 @@ class ShareFragment : AppCompatDialogFragment() {
override fun onPause() {
super.onPause()
consumePrompt { onDismiss() }
dismiss()
}

View File

@ -0,0 +1,25 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.utils
import mozilla.components.support.ktx.android.content.PreferencesHolder
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
fun featureFlagPreference(key: String, default: Boolean, featureFlag: Boolean): ReadWriteProperty<PreferencesHolder, Boolean> =
FeatureFlagPreferencePreference(key, default, featureFlag)
private class FeatureFlagPreferencePreference(
private val key: String,
private val default: Boolean,
private val featureFlag: Boolean
) : ReadWriteProperty<PreferencesHolder, Boolean> {
override fun getValue(thisRef: PreferencesHolder, property: KProperty<*>): Boolean =
featureFlag && thisRef.preferences.getBoolean(key, default)
override fun setValue(thisRef: PreferencesHolder, property: KProperty<*>, value: Boolean) =
thisRef.preferences.edit().putBoolean(key, value).apply()
}

View File

@ -26,6 +26,7 @@ import mozilla.components.support.ktx.android.content.longPreference
import mozilla.components.support.ktx.android.content.stringPreference
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.Config
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.components.metrics.MozillaProductDetector
@ -96,6 +97,18 @@ class Settings(private val appContext: Context) : PreferencesHolder {
override val preferences: SharedPreferences =
appContext.getSharedPreferences(FENIX_PREFERENCES, MODE_PRIVATE)
var useNewSearchExperience by featureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_use_new_search_experience),
default = false,
featureFlag = FeatureFlags.newSearchExperience
)
var waitToShowPageUntilFirstPaint by featureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_wait_first_paint),
default = false,
featureFlag = FeatureFlags.waitUntilPaintToDraw
)
var forceEnableZoom by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_accessibility_force_enable_zoom),
default = false

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:text="Hello World"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -27,6 +27,10 @@
android:id="@+id/action_global_search"
app:destination="@id/searchFragment" />
<action
android:id="@+id/action_global_search_dialog"
app:destination="@id/searchDialogFragment" />
<action
android:id="@+id/action_global_shareFragment"
app:destination="@id/shareFragment" />
@ -137,6 +141,11 @@
app:nullable="true" />
</fragment>
<dialog
android:id="@+id/searchDialogFragment"
android:name="org.mozilla.fenix.searchdialog.SearchDialogFragment"
tools:layout="@layout/fragment_search_dialog" />
<fragment
android:id="@+id/searchFragment"
android:name="org.mozilla.fenix.search.SearchFragment"

View File

@ -25,6 +25,9 @@
<!-- Message announced to the user when tab tray is selected with 0 or 2+ tabs -->
<string name="open_tab_tray_plural">%1$s llingüetes abiertes. Toca pa cambiar a otra.</string>
<!-- Label of editable text in create collection dialog for naming a new collection -->
<string name="tab_tray_add_new_collection_name">Nome</string>
<!-- About content. The first parameter is the name of the application. (For example: Fenix) -->
<string name="about_content">%1$s ta producíu por Mozilla.</string>
@ -142,12 +145,12 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Escaniar</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Atayos</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Motor de gueta</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Axustes de los motores de gueta</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Y agora gueta con:</string>
<string name="search_engines_search_with">Y agora gueta con:</string>
<!-- Button in the search view that lets a user navigate to the site in their clipboard -->
<string name="awesomebar_clipboard_title">Rellenar col enllaz del cartafueyu</string>
<!-- Button in the search suggestions onboarding that allows search suggestions in private sessions -->
@ -251,8 +254,6 @@
<string name="developer_tools_category">Ferramientes pa desendolcadores</string>
<!-- Preference for developers -->
<string name="preferences_remote_debugging">Depuración remota per USB</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Amosar los atayos de gueta</string>
<!-- Preference title for switch preference to show search suggestions -->
<string name="preferences_show_search_suggestions">Amosar les suxerencies de gueta</string>
<!-- Preference title for switch preference to show voice search button -->
@ -558,7 +559,7 @@
<!-- Bookmark snackbar message on deletion
The first parameter is the host part of the URL of the bookmark deleted, if any -->
<string name="bookmark_deletion_snackbar_message">Desanicióse %1$s</string>
<!-- Bookmark snackbar message on deleting multiple bookmarks -->
<!-- Bookmark snackbar message on deleting multiple bookmarks not including folders-->
<string name="bookmark_deletion_multiple_snackbar_message_2">Desaniciáronse los marcadores</string>
<!-- Bookmark undo button for deletion snackbar action -->
<string name="bookmark_undo_deletion">DESFACER</string>
@ -734,6 +735,10 @@
<string name="qr_scanner_dialog_negative">ÑEGAR</string>
<!-- Tab collection deletion prompt dialog message. Placeholder will be replaced with the collection name -->
<string name="tab_collection_dialog_message">¿De xuru que quies desaniciar %1$s?</string>
<!-- Collection and tab deletion prompt dialog message. This will show when the last tab from a collection is deleted -->
<string name="delete_tab_and_collection_dialog_message">Desaniciar esta llingüeta va desaniciar tola coleición. Pues crear coleiciones nueves en cualesquier momentu.</string>
<!-- Collection and tab deletion prompt dialog title. Placeholder will be replaced with the collection name. This will show when the last tab from a collection is deleted -->
<string name="delete_tab_and_collection_dialog_title">¿Desaniciar %1$s?</string>
<!-- Tab collection deletion prompt dialog option to delete the collection -->
<string name="tab_collection_dialog_positive">Desaniciar</string>
<!-- Tab collection deletion prompt dialog option to cancel deleting the collection -->
@ -1319,9 +1324,6 @@
<!-- The error message in edit login view when a duplicate username exists. -->
<string name="saved_login_duplicate">Yá esiste un aniciu de sesión con esi nome d\'usuariu</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Coneuta con una cuenta de Firefox.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Volvi autenticate, por favor.</string>
<!-- Text displayed when user has disabled tab syncing in Firefox Sync Account -->

View File

@ -34,8 +34,18 @@
<string name="tab_tray_add_new_collection_name">Název</string>
<!-- Label of button in save to collection dialog for selecting a current collection -->
<string name="tab_tray_select_collection">Vybrat sbírku</string>
<!-- Content description for close button while in multiselect mode in tab tray -->
<string name="tab_tray_close_multiselect_content_description">Opustit režim výběru</string>
<!-- Content description for save to collection button while in multiselect mode in tab tray -->
<string name="tab_tray_collection_button_multiselect_content_description">Uložit vybrané panely do sbírky</string>
<!-- Content description for checkmark while tab is selected while in multiselect mode in tab tray. The first parameter is the title of the tab selected -->
<string name="tab_tray_item_selected_multiselect_content_description">Panel %1$s byl vybrán</string>
<!-- Content description when tab is unselected while in multiselect mode in tab tray. The first parameter is the title of the tab unselected -->
<string name="tab_tray_item_unselected_multiselect_content_description">Výběr panelu %1$s zrušen</string>
<!-- Content description announcement when exiting multiselect mode in tab tray -->
<string name="tab_tray_exit_multiselect_content_description">Režim výběru ukončen</string>
<!-- Content description announcement when entering multiselect mode in tab tray -->
<string name="tab_tray_enter_multiselect_content_description">Vstoupili jste do režimu výběru panelů pro jejich uložení do sbírky</string>
<!-- Content description on checkmark while tab is selected in multiselect mode in tab tray -->
<string name="tab_tray_multiselect_selected_content_description">Vybráno</string>
@ -1268,6 +1278,8 @@
<string name="preferences_passwords_exceptions_description_empty">Tady se zobrazí přihlašovací údaje, které se nebudou ukládat.</string>
<!-- Description of list of login exceptions that we never save logins for -->
<string name="preferences_passwords_exceptions_description">Pro následující servery se nebudou přihlašovací údaje ukládat.</string>
<!-- Text on button to remove all saved login exceptions -->
<string name="preferences_passwords_exceptions_remove_all">Odebrat všechny výjimky</string>
<!-- Hint for search box in logins list -->
<string name="preferences_passwords_saved_logins_search">Hledat přihlašovací údaje</string>
<!-- Option to sort logins list A-Z, alphabetically -->

View File

@ -175,8 +175,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Scannen</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Suchmaschine</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Suchmaschine</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Suchmaschinen-Einstellungen</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1490,9 +1490,7 @@
<string name="saved_login_duplicate">Es existieren bereits Zugangsdaten mit diesem Benutzernamen</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Mit einem Firefox-Konto verbinden.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Weiteres Gerät verbinden.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Bitte erneut authentifizieren.</string>
@ -1513,13 +1511,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">Ok, verstanden</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Suchmaschinen</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Suchen mit</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Einmalig suchen mit:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Kürzel für die Suche anzeigen</string>
</resources>

View File

@ -171,8 +171,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Scannowaś</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Pytnica</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Pytnica</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Nastajenja pytnicow</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1461,9 +1461,7 @@
<string name="saved_login_duplicate">Pśizjawjenje z tym wužywaŕskim mjenim južo esistěrujo</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Z kontom Firefox zwězaś.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Z drugim rědom zwězaś.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Pšosym awtentificěrujśo znowego.</string>
@ -1485,13 +1483,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">W pórěźe, som zrozměł</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Skrotconki</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Pytaś z</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Něnto pytaś z:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Pytańske skrotconki pokazaś</string>
</resources>

View File

@ -1212,6 +1212,9 @@
<!-- Voice search prompt description displayed after the user presses the voice search button -->
<string name="voice_search_explainer">Μιλήστε τώρα</string>
<!-- The error message in edit login view when a duplicate username exists. -->
<string name="saved_login_duplicate">Υπάρχει ήδη σύνδεση με αυτό το όνομα χρήστη</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Συνδεθείτε με ένα λογαριασμό Firefox.</string>

View File

@ -173,8 +173,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Escanear</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Buscador</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Motor de búsqueda</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Configuración del buscador</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1477,9 +1477,7 @@
<string name="saved_login_duplicate">Ya existe un inicio de sesión con ese nombre de usuario</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Conectate con una cuenta de Firefox.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Conectar otro dispositivo.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Volver a autenticar.</string>
@ -1501,13 +1499,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">Listo, lo entendí.</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Atajos</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Buscar con</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Esta vez buscar con:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Mostrar atajos de teclado para búsquedas</string>
</resources>

View File

@ -170,8 +170,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Skeniraj</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Tražilica</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Tražilica</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Traži postavke tražilice</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1472,9 +1472,7 @@
<string name="saved_login_duplicate">Prijava s tim korisničkim imenom već postoji</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Poveži s Firefox računom.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Poveži drugi uređaj.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Ponovite autorizaciju.</string>
@ -1496,13 +1494,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">U redu, shvaćam</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Prečaci</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Traži pomoću</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Ovaj put traži pomoću:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Prikaži prečace za pretraživanje</string>
</resources>

View File

@ -171,8 +171,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Skenować</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Pytawa</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Pytawa</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Nastajenja pytawy</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1460,9 +1460,7 @@
<string name="saved_login_duplicate">Přizjewjenje z tym wužiwarskim mjenom hižo eksistuje.</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Z kontom Firefox zwjazać.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Z druhim gratom zwjazać.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Prošu awtentifikujće znowa.</string>
@ -1483,13 +1481,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">W porjadku, sym zrozumił</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Skrótšenki</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Pytać z</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Nětko pytać z:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Pytanske skrótšenki pokazać</string>
</resources>

View File

@ -169,8 +169,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">סריקה</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">מנוע חיפוש</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">מנוע חיפוש</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">הגדרות מנוע חיפוש</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1436,9 +1436,7 @@
<string name="saved_login_duplicate">כבר קיימת כניסה עם שם משתמש זה</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">נא להתחבר עם חשבון Firefox.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">נא לחבר מכשיר נוסף.</string>
<!-- Text displayed when user has disabled tab syncing in Firefox Sync Account -->
<string name="synced_tabs_enable_tab_syncing">נא להפעיל סנכרון לשוניות.</string>
@ -1455,13 +1453,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">בסדר, הבנתי</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">קיצורי דרך</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">חיפוש באמצעות</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">הפעם, לחפש באמצעות:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">הצגת קיצורי דרך לחיפוש</string>
</resources>

View File

@ -173,8 +173,8 @@ Tiktiwin tigejdanin yuzzlen ur nṣeḥḥi ara
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Snirem</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Amsedday n unadi</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Amsedday unadi</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Iɣewwaṛen n umsedday n unadi</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1471,9 +1471,7 @@ Tiktiwin tigejdanin yuzzlen ur nṣeḥḥi ara
<string name="saved_login_duplicate">Anekcam s yisem-agi n useqdac yella yakan</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Qqen s umiḍan Firefox.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Qqen ibenk-nniḍen.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Ma ulac aɣilif, ales asesteb.</string>
@ -1495,13 +1493,4 @@ Tiktiwin tigejdanin yuzzlen ur nṣeḥḥi ara
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">IH, awi-t-id</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Inegzumen</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Nadi s</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Tikkelt-agi, nadi s:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Sken anadi n yinegzumen</string>
</resources>

View File

@ -180,8 +180,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">스캔</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">검색 엔진</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">검색 엔진</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">검색 엔진 설정</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -289,7 +289,7 @@
<!-- Preference for data collection -->
<string name="preferences_data_collection">데이터 수집</string>
<!-- Preference linking to the privacy notice -->
<string name="preferences_privacy_link">개인정보 보호정책</string>
<string name="preferences_privacy_link">개인정보처리방침</string>
<!-- Preference category for developer tools -->
<string name="developer_tools_category">개발자 도구</string>
<!-- Preference for developers -->
@ -1083,7 +1083,7 @@
    </string>
<!-- Text for the button to read the privacy notice -->
<string name="onboarding_privacy_notice_read_button">개인정보 보호정책 읽기</string>
<string name="onboarding_privacy_notice_read_button">개인정보처리방침 읽기</string>
<!-- Content description (not visible, for screen readers etc.): Close onboarding screen -->
<string name="onboarding_close">닫기</string>
@ -1237,7 +1237,7 @@
<!-- About page link text to list of past crashes (like about:crashes on desktop) -->
<string name="about_crashes">충돌</string>
<!-- About page link text to open privacy notice link -->
<string name="about_privacy_notice">개인정보 보호정책</string>
<string name="about_privacy_notice">개인정보처리방침</string>
<!-- About page link text to open know your rights link -->
<string name="about_know_your_rights">권리 읽기</string>
@ -1507,9 +1507,7 @@
<string name="saved_login_duplicate">해당 사용자 이름을 가진 로그인이 이미 존재합니다</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Firefox 계정으로 연결하세요.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">다른 기기를 연결하세요.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">다시 인증하세요.</string>
@ -1531,14 +1529,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">확인</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">바로 가기</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">검색</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">이번만 검색:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">검색 바로 가기 표시</string>
</resources>

View File

@ -174,8 +174,8 @@
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Skann</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Søkemotor</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Søkemotor</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Innstillinger for søkemotor</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1481,9 +1481,7 @@
<string name="saved_login_duplicate">En innlogging med det brukernavnet eksisterer allerede</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Koble til en Firefox-konto.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Koble til en annen enhet.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Autentiser på nytt.</string>
@ -1504,13 +1502,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">OK, jeg skjønner</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Snarveier</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Søk med</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Denne gangen, søk med:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Vis søkesnarveier</string>
</resources>

View File

@ -27,6 +27,9 @@
<!-- Message announced to the user when tab tray is selected with 0 or 2+ tabs -->
<string name="open_tab_tray_plural">%1$s open tabbladen. Tik om tussen tabbladen te wisselen.</string>
<!-- Tab tray multi select title in app bar. The first parameter is the number of tabs selected -->
<string name="tab_tray_multi_select_title">%1$d geselecteerd</string>
<!-- About content. The first parameter is the name of the application. (For example: Fenix) -->
<string name="about_content">%1$s is gemaakt door Mozilla.</string>

View File

@ -173,8 +173,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Skann</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Søkjemotor</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Søkjemotor</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Innstillingar for søkjemotor</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1472,9 +1472,7 @@
<string name="saved_login_duplicate">Ei innlogging med dette brukarnamnet finst allereie</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Kople til med ein Firefox Account.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Kople til ei anna eining.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Godkjenn på nytt.</string>
@ -1495,13 +1493,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">OK, eg forstår det</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Snarvegar</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Søk med</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Denne gong, søk med:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Vis søkjesnarvegar</string>
</resources>

View File

@ -172,8 +172,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Digitalizar</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Motor de pesquisa</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Motor de pesquisa</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Definições do motor de pesquisa</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1466,9 +1466,7 @@
<string name="saved_login_duplicate">Já existe uma credencial com este nome.</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Associar uma conta Firefox.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Associar outro dispositivo.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Por favor, autentique-se novamente.</string>
@ -1489,13 +1487,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">OK, percebi</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Atalhos</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Pesquisar com</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Desta vez, pesquisar com:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Mostrar atalhos de pesquisa</string>
</resources>

View File

@ -25,6 +25,29 @@
<!-- Message announced to the user when tab tray is selected with 0 or 2+ tabs -->
<string name="open_tab_tray_plural">%1$s отворених језичака. Додирните за пребацивање језичака.</string>
<!-- Tab tray multi select title in app bar. The first parameter is the number of tabs selected -->
<string name="tab_tray_multi_select_title">%1$d изабран</string>
<!-- Label of button in create collection dialog for creating a new collection -->
<string name="tab_tray_add_new_collection">Додај нову збирку</string>
<!-- Label of editable text in create collection dialog for naming a new collection -->
<string name="tab_tray_add_new_collection_name">Назив</string>
<!-- Label of button in save to collection dialog for selecting a current collection -->
<string name="tab_tray_select_collection">Изабери збирку</string>
<!-- Content description for close button while in multiselect mode in tab tray -->
<string name="tab_tray_close_multiselect_content_description">Изађите из режима вишеструког избора</string>
<!-- Content description for save to collection button while in multiselect mode in tab tray -->
<string name="tab_tray_collection_button_multiselect_content_description">Сачувајте одабране језичке у збирку</string>
<!-- Content description for checkmark while tab is selected while in multiselect mode in tab tray. The first parameter is the title of the tab selected -->
<string name="tab_tray_item_selected_multiselect_content_description">Изабран је %1$s</string>
<!-- Content description when tab is unselected while in multiselect mode in tab tray. The first parameter is the title of the tab unselected -->
<string name="tab_tray_item_unselected_multiselect_content_description">Избор %1$s је отказан</string>
<!-- Content description announcement when exiting multiselect mode in tab tray -->
<string name="tab_tray_exit_multiselect_content_description">Изашли сте из режима вишеструког избора</string>
<!-- Content description announcement when entering multiselect mode in tab tray -->
<string name="tab_tray_enter_multiselect_content_description">Ушли сте у режим вишеструког избора, одаберите језичке за чување у збирци</string>
<!-- Content description on checkmark while tab is selected in multiselect mode in tab tray -->
<string name="tab_tray_multiselect_selected_content_description">Изабрано</string>
<!-- About content. The first parameter is the name of the application. (For example: Fenix) -->
<string name="about_content">%1$s производи Mozilla.</string>
@ -146,8 +169,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Скенирај</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Претраживач</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Претраживач</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Подешавања претраживача</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -508,6 +531,9 @@
<!-- Postfix for private WebApp titles, placeholder is replaced with app name -->
<string name="pwa_site_controls_title_private">%1$s (приватни режим)</string>
<!-- Button in the current tab tray header in multiselect mode. Saved the selected tabs to a collection when pressed. -->
<string name="tab_tray_save_to_collection">Сачувај</string>
<!-- History -->
<!-- Text for the button to clear all history -->
<string name="history_delete_all">Обриши историјат</string>
@ -1436,9 +1462,7 @@
<string name="saved_login_duplicate">Пријава са овим корисничким именом већ постоји</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Повежите са Firefox налогом.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Повежите други уређај.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Поново потврдите идентитет.</string>
@ -1460,13 +1484,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">Важи, разумем</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Пречице</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Претражи са</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Овај пут потражи користећи:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Пречице за претрагу</string>
</resources>

View File

@ -173,8 +173,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Skanna</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Sökmotor</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Sökmotor</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Inställningar för sökmotor</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1473,9 +1473,7 @@
<string name="saved_login_duplicate">En inloggning med det användarnamnet finns redan</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Anslut med ett Firefox-konto.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Anslut en annan enhet.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Bekräfta igen.</string>
@ -1496,14 +1494,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">Ok, jag förstår</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Genvägar</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Sök med</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Denna gång, sök med:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Visa sökgenvägar</string>
</resources>

View File

@ -172,8 +172,8 @@
<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Сканувати</string>
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_engines_shortcut_button">Засіб пошуку</string>
<!-- Button in the search view that lets a user change their search engine -->
<string name="search_engine_button">Засіб пошуку</string>
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
<string name="search_shortcuts_engine_settings">Налаштування пошукових засобів</string>
<!-- Header displayed when selecting a shortcut search engine -->
@ -1474,9 +1474,7 @@
<string name="saved_login_duplicate">Запис з таким іменем користувача вже існує</string>
<!-- Synced Tabs -->
<!-- Text displayed when user is not logged into a Firefox Account -->
<string name="synced_tabs_connect_to_sync_account">Під’єднатися до облікового запису Firefox.</string>
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<!-- Text displayed to ask user to connect another device as no devices found with account -->
<string name="synced_tabs_connect_another_device">Під’єднати інший пристрій.</string>
<!-- Text displayed asking user to re-authenticate -->
<string name="synced_tabs_reauth">Повторіть автентифікацію.</string>
@ -1497,14 +1495,4 @@
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">Гаразд, зрозуміло</string>
<!-- DEPRECATED STRINGS -->
<!-- Button in the search view that lets a user search by using a shortcut -->
<string name="search_shortcuts_button">Ярлики</string>
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with">Шукати з</string>
<!-- Header displayed when selecting a shortcut search engine -->
<string name="search_shortcuts_search_with_2">Цього разу шукати з:</string>
<!-- Preference title for switch preference to show search shortcuts -->
<string name="preferences_show_search_shortcuts">Посилання на пошукові засоби</string>
</resources>

View File

@ -173,7 +173,9 @@
<string name="pref_key_migrating_from_firefox_nightly_tip" translatable="false">pref_key_migrating_from_firefox_nightly_tip</string>
<string name="pref_key_migrating_from_fenix_tip" translatable="false">pref_key_migrating_from_fenix_tip</string>
<string name="pref_key_enable_new_tab_tray" translatable="false">pref_key_new_tab_tray</string>
<string name="pref_key_use_new_search_experience" translatable="false">pref_key_use_new_search_experience</string>
<string name="pref_key_wait_first_paint" translatable="false">pref_key_wait_first_paint</string>
<string name="pref_key_debug_settings" translatable="false">pref_key_debug_settings</string>

View File

@ -32,7 +32,10 @@
<!-- Label for the secret settings preference -->
<string name="preferences_debug_settings">Secret Settings</string>
<string name="preferences_debug_settings_enable_tab_tray">Use New Tab Tray</string>
<!-- Label for the new search experience preference -->
<string name="preferences_debug_settings_use_new_search_experience">Use New Search Experience</string>
<!-- Label for the wait until first paint preference -->
<string name="preferences_debug_settings_wait_first_paint">Wait Until First Paint To Show Page Content</string>
<!-- Content description (not visible, for screen readers etc.) used to announce [LinkTextView]. -->
<string name="link_text_view_type_announcement" translatable="false">link</string>

View File

@ -3,4 +3,15 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"/>
xmlns:app="http://schemas.android.com/apk/res-auto">
<SwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_use_new_search_experience"
android:title="@string/preferences_debug_settings_use_new_search_experience"
app:iconSpaceReserved="false" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_wait_first_paint"
android:title="@string/preferences_debug_settings_wait_first_paint"
app:iconSpaceReserved="false" />
</PreferenceScreen>

View File

@ -198,6 +198,18 @@ class TrackingProtectionPolicyFactoryTest {
// `normalMode = true, privateMode = true` can never be shown to the user
}
@Test
fun `factory should follow global ETP settings by default`() {
var useETPFactory = TrackingProtectionPolicyFactory(mockSettings(useTrackingProtection = true))
var policy = useETPFactory.createTrackingProtectionPolicy()
assertTrue(policy.useForPrivateSessions)
assertTrue(policy.useForRegularSessions)
useETPFactory = TrackingProtectionPolicyFactory(mockSettings(useTrackingProtection = false))
policy = useETPFactory.createTrackingProtectionPolicy()
assertEquals(policy, EngineSession.TrackingProtectionPolicy.none())
}
@Test
fun `custom tabs should respect their privacy rules`() {
val allSettings = listOf(
@ -315,10 +327,12 @@ class TrackingProtectionPolicyFactoryTest {
private fun mockSettings(
useStrict: Boolean = false,
useCustom: Boolean = false
useCustom: Boolean = false,
useTrackingProtection: Boolean = false
): Settings = mockk {
every { useStrictTrackingProtection } returns useStrict
every { useCustomTrackingProtection } returns useCustom
every { shouldUseTrackingProtection } returns useTrackingProtection
}
@Suppress("LongParameterList")

View File

@ -0,0 +1,42 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.components.metrics
import android.content.Context.MODE_PRIVATE
import mozilla.components.support.test.robolectric.testContext
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
import org.junit.runner.RunWith
import org.mozilla.fenix.ext.application
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
@RunWith(FenixRobolectricTestRunner::class)
class LeanplumMetricsServiceTest {
@Test
fun `deviceId is only generated on first run`() {
var callCount = 0
val idGenerator = {
callCount++
"TEST_DEVICE_ID"
}
val sharedPreferences = testContext.application.getSharedPreferences(
"LEANPLUM_PREFERENCES",
MODE_PRIVATE
)
assertNull(sharedPreferences.getString("LP_DEVICE_ID", null))
val leanplumMetricService = LeanplumMetricsService(testContext.application, idGenerator)
assertEquals("TEST_DEVICE_ID", leanplumMetricService.deviceId)
val leanplumMetricService2 = LeanplumMetricsService(testContext.application, idGenerator)
assertEquals("TEST_DEVICE_ID", leanplumMetricService2.deviceId)
assertEquals(1, callCount)
assertEquals("TEST_DEVICE_ID", sharedPreferences.getString("LP_DEVICE_ID", ""))
}
}

View File

@ -4,7 +4,6 @@
package org.mozilla.fenix.helpers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.mozilla.fenix.FenixApplication
import org.mozilla.fenix.components.TestComponents
@ -17,8 +16,9 @@ class FenixRobolectricTestApplication : FenixApplication() {
override val components = TestComponents(this)
override fun initializeGlean() = Unit
override fun setupInAllProcesses() = Unit
@ExperimentalCoroutinesApi
override fun setupInMainProcessOnly() = Unit
}

View File

@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
object AndroidComponents {
const val VERSION = "53.0.20200803131508"
const val VERSION = "53.0.20200804130112"
}

View File

@ -215,12 +215,22 @@ Here is the list of current Events sent, which can be found here in the code bas
<td>`E_Collection_Tab_Opened`</td>
<td>The user opened a tab from a previously created collection</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/4626#issuecomment-519691332">#4626</a></td>
</tr>
</tr>
<tr>
<td>`E_FxA_New_Signup`</td>
<td>The user completed the signup process to new FxA account</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/4626#issuecomment-519691332">#4626</a></td>
</tr>
<tr>
<td>`E_Sign_In_FxA`</td>
<td>The user successfully signed in to FxA</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/4626#issuecomment-519691332">#4626</a></td>
</tr>
</tr>
<tr>
<td>`E_Sign_In_FxA_Fennec_to_Fenix`</td>
<td>The user successfully signed in to FxA using previously signed in Fennec account</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/4626#issuecomment-519691332">#4626</a></td>
</tr>
<tr>
<td>`E_Sign_Out_FxA`</td>
<td>The user successfully signed out of FxA</td>

View File

@ -21,6 +21,12 @@ def target_tasks_default(full_task_graph, parameters, graph_config):
# TODO Use shipping-phase once we retire github-releases
def filter(task, parameters):
# Mark-as-shipped is always red on github-release and it confuses people.
# This task cannot be green if we kick off a release through github-releases, so
# let's exlude that task there.
if task.kind == "mark-as-shipped" and parameters["tasks_for"] == "github-release":
return False
return task.attributes.get("release-type", "") == parameters["release_type"]
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)]