1
0
Fork 0

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

master
blallo 2020-06-30 00:01:00 +02:00
commit 66d1ac739c
10 changed files with 291 additions and 70 deletions

View File

@ -32,7 +32,7 @@ android {
testInstrumentationRunnerArguments clearPackageData: 'true'
resValue "bool", "IS_DEBUG", "false"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "false"
buildConfigField "String", "AMO_COLLECTION", "\"16f6e5d9a40448b8955db57ced6d75\""
buildConfigField "String", "AMO_COLLECTION", "\"3204bb44a6ef44d39ee34917f28055\""
def deepLinkSchemeValue = "fenix-dev"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
@ -53,7 +53,6 @@ android {
shrinkResources false
minifyEnabled false
applicationIdSuffix ".fenix.debug"
buildConfigField "String", "AMO_COLLECTION", "\"3204bb44a6ef44d39ee34917f28055\""
manifestPlaceholders.isRaptorEnabled = "true"
resValue "bool", "IS_DEBUG", "true"
pseudoLocalesEnabled true
@ -73,7 +72,6 @@ android {
fenixNightly releaseTemplate >> {
applicationIdSuffix ".fenix.nightly"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
buildConfigField "String", "AMO_COLLECTION", "\"3204bb44a6ef44d39ee34917f28055\""
def deepLinkSchemeValue = "fenix-nightly"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = ["deepLinkScheme": deepLinkSchemeValue]
@ -131,7 +129,6 @@ android {
applicationIdSuffix ".fennec_aurora"
def deepLinkSchemeValue = "fenix-nightly"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
buildConfigField "String", "AMO_COLLECTION", "\"3204bb44a6ef44d39ee34917f28055\""
manifestPlaceholders = [
// This release type is meant to replace Firefox (Release channel) and therefore needs to inherit
// its sharedUserId for all eternity. See:

View File

@ -1,6 +1,6 @@
/* 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/. */
/* 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
@ -8,7 +8,6 @@ import android.os.Build
import android.os.StrictMode
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import kotlin.collections.HashSet
/**
* Manages strict mode settings for the application.
@ -16,38 +15,39 @@ import kotlin.collections.HashSet
object StrictModeManager {
/***
* Enables strict mode for debug purposes. meant to be run only in the main process.
* @param setPenaltyDialog boolean value to decide setting the dialog box as a penalty.
*/
fun enableStrictMode(setPenaltyDialog: Boolean) {
if (Config.channel.isDebug) {
val threadPolicy = StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
if (setPenaltyDialog &&
!strictModeExceptionList.contains(Build.MANUFACTURER)) {
threadPolicy.penaltyDialog()
}
StrictMode.setThreadPolicy(threadPolicy.build())
var builder = StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.detectLeakedClosableObjects()
.detectLeakedRegistrationObjects()
.detectActivityLeaks()
.detectFileUriExposure()
.penaltyLog()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) builder =
builder.detectContentUriWithoutPermission()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
if (setPenaltyDialog) {
builder.permitNonSdkApiUsage()
} else {
builder.detectNonSdkApiUsage()
}
}
StrictMode.setVmPolicy(builder.build())
* Enables strict mode for debug purposes. meant to be run only in the main process.
* @param setPenaltyDialog boolean value to decide setting the dialog box as a penalty.
*/
fun enableStrictMode(setPenaltyDialog: Boolean) {
if (Config.channel.isDebug) {
val threadPolicy = StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
if (setPenaltyDialog && Build.MANUFACTURER !in strictModeExceptionList) {
threadPolicy.penaltyDialog()
}
StrictMode.setThreadPolicy(threadPolicy.build())
val builder = StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.detectLeakedClosableObjects()
.detectLeakedRegistrationObjects()
.detectActivityLeaks()
.detectFileUriExposure()
.penaltyLog()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
builder.detectContentUriWithoutPermission()
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
if (setPenaltyDialog) {
builder.permitNonSdkApiUsage()
} else {
builder.detectNonSdkApiUsage()
}
}
StrictMode.setVmPolicy(builder.build())
}
}
/**
* Revert strict mode to disable penalty dialog. Tied to fragment lifecycle since strict mode
@ -55,8 +55,7 @@ object StrictModeManager {
* specific fragment.
*/
fun changeStrictModePolicies(fragmentManager: FragmentManager) {
fragmentManager.registerFragmentLifecycleCallbacks(object :
FragmentManager.FragmentLifecycleCallbacks() {
fragmentManager.registerFragmentLifecycleCallbacks(object : FragmentManager.FragmentLifecycleCallbacks() {
override fun onFragmentResumed(fm: FragmentManager, f: Fragment) {
enableStrictMode(false)
fm.unregisterFragmentLifecycleCallbacks(this)
@ -64,6 +63,9 @@ object StrictModeManager {
}, false)
}
private const val MANUFACTURE_HUAWEI: String = "HUAWEI"
private const val MANUFACTURE_ONE_PLUS: String = "OnePlus"
/**
* There are certain manufacturers that have custom font classes for the OS systems.
* These classes violates the [StrictMode] policies on startup. As a workaround, we create
@ -71,11 +73,5 @@ object StrictModeManager {
* To add a new manufacturer to the list, log "Build.MANUFACTURER" from the device to get the
* exact name of the manufacturer.
*/
private val strictModeExceptionList = HashSet<String>().also {
it.add(MANUFACTURE_HUAWEI)
it.add(MANUFACTURE_ONE_PLUS)
}
private const val MANUFACTURE_HUAWEI: String = "HUAWEI"
private const val MANUFACTURE_ONE_PLUS: String = "OnePlus"
private val strictModeExceptionList = setOf(MANUFACTURE_HUAWEI, MANUFACTURE_ONE_PLUS)
}

View File

@ -1,6 +1,7 @@
/* 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.ext
import android.os.StrictMode

View File

@ -30,6 +30,7 @@ import androidx.constraintlayout.widget.ConstraintSet.TOP
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.content.ContextCompat
import androidx.core.view.doOnLayout
import androidx.core.view.isVisible
import androidx.core.view.updateLayoutParams
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
@ -223,22 +224,6 @@ class HomeFragment : Fragment() {
updateSessionControlView(view)
activity.themeManager.applyStatusBarTheme(activity)
view.consumeFrom(requireComponents.core.store, viewLifecycleOwner) {
val tabCount = if (currentMode.getCurrentMode() == Mode.Normal) {
it.normalTabs.size
} else {
it.privateTabs.size
}
view.tab_button.setCountWithAnimation(tabCount)
view.add_tabs_to_collections_button?.visibility = if (tabCount > 0) {
View.VISIBLE
} else {
View.GONE
}
}
return view
}
@ -403,6 +388,17 @@ class HomeFragment : Fragment() {
} else {
requireActivity().window.clearFlags(FLAG_SECURE)
}
consumeFrom(requireComponents.core.store) {
val tabCount = if (browsingModeManager.mode.isPrivate) {
it.privateTabs.size
} else {
it.normalTabs.size
}
view.tab_button?.setCountWithAnimation(tabCount)
view.add_tabs_to_collections_button?.isVisible = tabCount > 0
}
}
override fun onDestroyView() {

View File

@ -20,6 +20,11 @@
<!-- No Private Tabs Message Description -->
<string name="no_private_tabs_description">Тут будуць паказаны вашы прыватныя карткі.</string>
<!-- Message announced to the user when tab tray is selected with 1 tab -->
<string name="open_tab_tray_single">1 адкрытая картка. Націсніце, каб пераключыць карткі.</string>
<!-- Message announced to the user when tab tray is selected with 0 or 2+ tabs -->
<string name="open_tab_tray_plural">Адкрытых картак: %1$s. Націсніце, каб пераключыць карткі.</string>
<!-- Private Browsing -->
<!-- Title for private session option -->
<string name="private_browsing_title">Вы ў прыватным сеансе</string>
@ -324,9 +329,9 @@
<!-- Toolbar Preferences -->
<!-- Preference for using top toolbar -->
<string name="preference_top_toolbar">Зверху</string>
<string name="preference_top_toolbar">Уверсе</string>
<!-- Preference for using bottom toolbar -->
<string name="preference_bottom_toolbar">Знізу</string>
<string name="preference_bottom_toolbar">Унізе</string>
<!-- Theme Preferences -->
<!-- Preference for using light theme -->
@ -334,6 +339,8 @@
<!-- Preference for using dark theme -->
<string name="preference_dark_theme">Цёмная</string>
<!-- Preference for using using dark or light theme automatically set by battery -->
<string name="preference_auto_battery_theme">Паводле рэжыму эканоміі зараду</string>
<!-- Preference for using following device theme -->
<string name="preference_follow_device_theme">Тэма прылады</string>
@ -403,6 +410,8 @@
<string name="close_tab">Закрыць картку</string>
<!-- Content description (not visible, for screen readers etc.): Close tab <title> button. First parameter is tab title -->
<string name="close_tab_title">Закрыць картку %s</string>
<!-- Content description (not visible, for screen readers etc.): Opens the open tabs menu when pressed -->
<string name="open_tabs_menu">Меню адкрытых картак</string>
<!-- Open tabs menu item to close all tabs -->
<string name="tabs_menu_close_all_tabs">Закрыць усе карткі</string>
<!-- Open tabs menu item to share all tabs -->
@ -505,6 +514,8 @@
<string name="bookmark_created_snackbar">Закладка створана.</string>
<!-- Snackbar title shown after a bookmark has been created. -->
<string name="bookmark_saved_snackbar">Закладка захавана!</string>
<!-- Snackbar edit button shown after a bookmark has been created. -->
<string name="edit_bookmark_snackbar_action">ЗМЯНІЦЬ</string>
<!-- Bookmark overflow menu edit button -->
<string name="bookmark_menu_edit_button">Змяніць</string>
<!-- Bookmark overflow menu select button -->
@ -585,6 +596,8 @@
<string name="preference_phone_feature_notification">Абвестка</string>
<!-- Label that indicates that a permission must be asked always -->
<string name="preference_option_phone_feature_ask_to_allow">Запытваць дазвол</string>
<!-- Label that indicates that a permission must be allowed -->
<string name="preference_option_phone_feature_allowed">Дазволена</string>
<!--Label that indicates a permission is by the Android OS-->
<string name="phone_feature_blocked_by_android">Заблакавана Android</string>
<!-- Preference for showing a list of websites that the default configurations won't apply to them -->
@ -625,6 +638,12 @@
<string name="create_collection_deselect_all">Адмяніць выбар усіх</string>
<!-- Text to prompt users to select the tabs to save in the "select tabs" step of the collection creator -->
<string name="create_collection_save_to_collection_empty">Выберыце карткі для захавання</string>
<!-- Text to show users how many tabs they have selected in the "select tabs" step of the collection creator.
%d is a placeholder for the number of tabs selected. -->
<string name="create_collection_save_to_collection_tabs_selected">Выбрана картак: %d</string>
<!-- Text to show users they have one tab selected in the "select tabs" step of the collection creator.
%d is a placeholder for the number of tabs selected. -->
<string name="create_collection_save_to_collection_tab_selected">Выбрана картка: %d</string>
<!-- Text shown in snackbar when multiple tabs have been saved in a collection -->
<string name="create_collection_tabs_saved">Карткі захаваны!</string>
<!-- Text shown in snackbar when one tab has been saved in a collection -->
@ -667,6 +686,8 @@
<string name="sync_offline">Па-за сеткай</string>
<!-- An option to connect additional devices -->
<string name="sync_connect_device">Падключыць іншую прыладу</string>
<!-- The dialog text shown when additional devices are not available -->
<string name="sync_connect_device_dialog">Каб адправіць картку, увайдзіце ў Firefox прынамсі на адной іншай прыладзе.</string>
<!-- Confirmation dialog button -->
<string name="sync_confirmation_button">Зразумела</string>
@ -707,6 +728,8 @@
<!-- Text shown in snackbar when user closes all tabs -->
<string name="snackbar_tabs_closed">Карткі закрыты</string>
<!-- Text shown in snackbar when user adds a site to top sites -->
<string name="snackbar_added_to_top_sites">Дададзена да папулярных сайтаў</string>
<!-- Text shown in snackbar when user closes a private tab -->
<string name="snackbar_private_tab_closed">Прыватная картка закрыта</string>
<!-- Text shown in snackbar when user closes all private tabs -->
@ -746,11 +769,16 @@
<string name="preferences_delete_browsing_data_tabs_title_2">Адкрытыя карткі</string>
<!-- Subtitle for the tabs item in Delete browsing data, parameter will be replaced with the number of open tabs -->
<string name="preferences_delete_browsing_data_tabs_subtitle">Карткі: %d</string>
<!-- Title for the data and history items in Delete browsing data -->
<string name="preferences_delete_browsing_data_browsing_data_title">Гісторыя аглядання і дадзеныя сайтаў</string>
<!-- Subtitle for the data and history items in delete browsing data, parameter will be replaced with the
number of history items the user has -->
<string name="preferences_delete_browsing_data_browsing_data_subtitle">Адрасы: %d</string>
<!-- Title for history items in Delete browsing data -->
<string name="preferences_delete_browsing_data_browsing_history_title">Гісторыя</string>
<!-- Subtitle for the history items in delete browsing data, parameter will be replaced with the
number of history pages the user has -->
<string name="preferences_delete_browsing_data_browsing_history_subtitle">Старонак: %d</string>
<!-- Title for the cookies item in Delete browsing data -->
<string name="preferences_delete_browsing_data_cookies">Кукі</string>
<!-- Title for the site permissions item in Delete browsing data -->
@ -787,26 +815,56 @@
<string name="onboarding_header">Вітаем у %s!</string>
<!-- text for the Firefox Accounts section header -->
<string name="onboarding_fxa_section_header">Ужо маеце ўліковы запіс?</string>
<!-- text for the Firefox Preview feature section header
The first parameter is the name of the app (e.g. Firefox Preview) -->
<string name="onboarding_feature_section_header">Пазнаёмцеся з %s</string>
<!-- text for the "What's New" onboarding card header -->
<string name="onboarding_whats_new_header1">Паглядзіце, што новага</string>
<!-- text for the "what's new" onboarding card description
The first parameter is the short name of the app (e.g. Firefox) -->
<string name="onboarding_whats_new_description">Маеце пытанні па абноўленым выглядзе %s? Хочаце ведаць, што змянілася?</string>
<!-- text for underlined clickable link that is part of "what's new" onboarding card description that links to an FAQ -->
<string name="onboarding_whats_new_description_linktext">Адказы тут</string>
<!-- text for the firefox account onboarding card header
The first parameter is the name of the app (e.g. Firefox Preview) -->
<string name="onboarding_firefox_account_header">Атрымайце максімум ад %s.</string>
<!-- text for the button to manually sign into Firefox account. The word "Firefox" should not be translated -->
<string name="onboarding_firefox_account_sign_in">Увайсці ў Firefox</string>
<!-- text to display in the snackbar if automatic sign-in fails. user may try again -->
<string name="onboarding_firefox_account_automatic_signin_failed">Няўдача ўваходу</string>
<!-- text for the tracking protection onboarding card header -->
<string name="onboarding_tracking_protection_header_2">Аўтаматычная прыватнасць</string>
<!-- text for the tracking protection card description
The first parameter is the name of the app (e.g. Firefox Preview) -->
<string name="onboarding_tracking_protection_description_2">Налады прыватнасці і бяспекі блакуюць трэкеры, шкоднасныя праграмы і кампаніі, што ідуць за вамі.</string>
<!-- text for tracking protection radio button option for standard level of blocking -->
<string name="onboarding_tracking_protection_standard_button_2">Стандартная (прадвызначана)</string>
<!-- text for standard blocking option button description -->
<string name="onboarding_tracking_protection_standard_button_description_2">Блакуе менш трэкераў. Старонкі загружаюцца нармальна.</string>
<!-- text for tracking protection radio button option for strict level of blocking -->
<string name="onboarding_tracking_protection_strict_button">Строгая (рэкамендуецца)</string>
<!-- text for tracking protection radio button option for strict level of blocking -->
<string name="onboarding_tracking_protection_strict_option">Строгая</string>
<!-- text for strict blocking option button description -->
<string name="onboarding_tracking_protection_strict_button_description_2">Блакуе больш трэкераў, рэкламы і выплыўных вокнаў. Старонкі загружаюцца хутчэй, але некаторыя функцыі могуць не працаваць.</string>
<!-- text for the toolbar position card header
In English this is an idiom for "choose a side as in an argument or fight"
but it is ok to make this more literally about "choosing a position in a physical space -->
<string name="onboarding_toolbar_position_header">Выберыце становішча</string>
<!-- text for the toolbar position card description -->
<string name="onboarding_toolbar_position_description">Паспрабуйце навігацыю адной рукой на паліцы прылад унізе або перамясціце яе ўверх.</string>
<!-- text for the private browsing onboarding card header -->
<string name="onboarding_private_browsing_header">Аглядайце прыватна</string>
<!-- text for the private browsing onbording card button, that launches settings -->
<string name="onboarding_private_browsing_button">Адкрыць налады</string>
<!-- text for the privacy notice onboarding card header -->
<string name="onboarding_privacy_notice_header">Ваша прыватнасць</string>
<!-- text for the privacy notice onboarding card description
The first parameter is the name of the app (e.g. Firefox Preview) -->
<string name="onboarding_privacy_notice_description">Мы распрацавалі %s, каб даць вам кантроль над тым, чым дзяліцца
ў Інтэрнэце і тым, чым вы падзеліцеся з намі.</string>
<!-- Text for the button to read the privacy notice -->
<string name="onboarding_privacy_notice_read_button">Паведамленне аб прыватнасці</string>
<!-- Content description (not visible, for screen readers etc.): Close onboarding screen -->
<string name="onboarding_close">Закрыць</string>
@ -866,12 +924,20 @@
<string name="preference_enhanced_tracking_protection_explanation_learn_more">Даведацца больш</string>
<!-- Preference for enhanced tracking protection for the standard protection settings -->
<string name="preference_enhanced_tracking_protection_standard_default_1">Стандартная (прадвызначана)</string>
<!-- Accessibility text for the Standard protection information icon -->
<string name="preference_enhanced_tracking_protection_standard_info_button">Што блакуецца стандартнай аховай ад сачэння</string>
<!-- Preference for enhanced tracking protection for the strict protection settings -->
<string name="preference_enhanced_tracking_protection_strict">Строгая</string>
<!-- Preference description for enhanced tracking protection for the strict protection settings -->
<string name="preference_enhanced_tracking_protection_strict_description_2">Блакуе больш трэкераў, рэкламы і выплыўных вокнаў. Старонкі загружаюцца хутчэй, але некаторыя функцыі могуць не працаваць.</string>
<!-- Accessibility text for the Strict protection information icon -->
<string name="preference_enhanced_tracking_protection_strict_info_button">Што блакуецца строгай аховай ад сачэння</string>
<!-- Preference for enhanced tracking protection for the custom protection settings -->
<string name="preference_enhanced_tracking_protection_custom">Адмыслова</string>
<!-- Preference description for enhanced tracking protection for the strict protection settings -->
<string name="preference_enhanced_tracking_protection_custom_description_2">Выберыце, якія трэкеры і скрыпты трэба заблакаваць.</string>
<!-- Accessibility text for the Strict protection information icon -->
<string name="preference_enhanced_tracking_protection_custom_info_button">Што блакуецца адмысловай аховай ад сачэння</string>
<!-- Header for categories that are being blocked by current Enhanced Tracking Protection settings -->
<!-- Preference for enhanced tracking protection for the custom protection settings for cookies-->
<string name="preference_enhanced_tracking_protection_custom_cookies">Кукі</string>
@ -889,6 +955,8 @@
<string name="preference_enhanced_tracking_protection_custom_tracking_content_1">Ва ўсіх картках</string>
<!-- Option for enhanced tracking protection for the custom protection settings for tracking content-->
<string name="preference_enhanced_tracking_protection_custom_tracking_content_2">Толькі ў прыватных картках</string>
<!-- Option for enhanced tracking protection for the custom protection settings for tracking content-->
<string name="preference_enhanced_tracking_protection_custom_tracking_content_3">Толькі ў адмысловых картках</string>
<!-- Preference for enhanced tracking protection for the custom protection settings -->
<string name="preference_enhanced_tracking_protection_custom_cryptominers">Майнеры крыптавалют</string>
<!-- Preference for enhanced tracking protection for the custom protection settings -->
@ -914,6 +982,8 @@
<string name="etp_back_button_content_description">Перайсці назад</string>
<!-- About page Your rights link text -->
<string name="about_your_rights">Вашы правы</string>
<!-- About page link text to open open source licenses screen -->
<string name="about_open_source_licenses">Выкарыстаныя бібліятэкі з адкрытым зыходным кодам</string>
<!-- About page link text to open what's new link -->
<string name="about_whats_new">Што новага ў %s</string>
@ -982,6 +1052,12 @@
<!-- Preference to access list of login exceptions that we never save logins for -->
<string name="preferences_passwords_exceptions">Выключэнні</string>
<!-- Hint for search box in logins list -->
<string name="preferences_passwords_saved_logins_search">Шукаць лагіны</string>
<!-- Option to sort logins list A-Z, alphabetically -->
<string name="preferences_passwords_saved_logins_alphabetically">Па алфавіце</string>
<!-- Option to sort logins list by most recently used -->
<string name="preferences_passwords_saved_logins_recently_used">Нядаўна выкарыстаныя</string>
<!-- The header for the site that a login is for -->
<string name="preferences_passwords_saved_logins_site">Сайт</string>
<!-- The header for the username for a login -->
@ -1035,6 +1111,8 @@
<!-- Text for the menu button to delete a search engine -->
<string name="search_engine_delete">Выдаліць</string>
<!-- Text for the button to create a custom search engine on the Add search engine screen -->
<string name="search_add_custom_engine_label_other">Іншы</string>
<!-- Placeholder text shown in the Search Engine Name TextField before a user enters text -->
<string name="search_add_custom_engine_name_hint">Назва</string>
<!-- Text for the button to learn more about adding a custom search engine -->
@ -1065,6 +1143,8 @@
<!-- Label that indicates a site is using a insecure connection -->
<string name="quick_settings_sheet_insecure_connection">Не бяспечнае злучэнне</string>
<!-- label shown when there are not site exceptions to show in the site exception settings -->
<string name="no_site_exceptions">Няма выняткаў для сайта</string>
<!-- Browser menu button that adds a top site to the home fragment -->
<string name="browser_menu_add_to_top_sites">Дадаць да папулярных сайтаў</string>
<!-- text shown before the issuer name to indicate who its verified by, parameter is the name of

View File

@ -94,7 +94,7 @@
<!-- Browser menu toggle that requests a desktop site -->
<string name="browser_menu_desktop_site">Sitio de escritorio</string>
<!-- Browser menu toggle that adds a shortcut to the site on the device home screen. -->
<string name="browser_menu_add_to_homescreen">Añadir a la pantalla de inicio</string>
<string name="browser_menu_add_to_homescreen">Añadir a pantalla de inicio</string>
<!-- Browser menu toggle that installs a Progressive Web App shortcut to the site on the device home screen. -->
<string name="browser_menu_install_on_homescreen">Instalar</string>
<!-- Menu option on the toolbar that takes you to synced tabs page-->
@ -884,8 +884,6 @@
<string name="preference_summary_delete_browsing_data_on_quit">Elimina automáticamente los datos de navegación cuando seleccionas &quot;Salir&quot; en el menú principal</string>
<!-- Summary for the Delete browsing data on quit preference. "Quit" translation should match delete_browsing_data_on_quit_action translation. -->
<string name="preference_summary_delete_browsing_data_on_quit_2">Elimina automáticamente los datos de navegación cuando seleccionas \&quot;Salir\&quot; en el menú principal</string>
<!-- Category for history items to delete on quit in delete browsing data on quit -->
<string name="preferences_delete_browsing_data_on_quit_browsing_history">Historial de navegación</string>
<!-- Action item in menu for the Delete browsing data on quit feature -->
<string name="delete_browsing_data_on_quit_action">Salir</string>
@ -1384,7 +1382,7 @@
<!-- Bookmark deletion confirmation -->
<string name="bookmark_deletion_confirmation">¿De verdad quieres eliminar este marcador?</string>
<!-- Browser menu button that adds a top site to the home fragment -->
<string name="browser_menu_add_to_top_sites">Añadir a sitios frecuentes</string>
<string name="browser_menu_add_to_top_sites">Añadir sitio frecuente</string>
<!-- text shown before the issuer name to indicate who its verified by, parameter is the name of
the certificate authority that verified the ticket-->
<string name="certificate_info_verified_by">Verificado por: %1$s</string>

View File

@ -0,0 +1,73 @@
/* 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
import android.os.StrictMode
import androidx.fragment.app.FragmentManager
import io.mockk.MockKAnnotations
import io.mockk.confirmVerified
import io.mockk.every
import io.mockk.impl.annotations.MockK
import io.mockk.mockk
import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.slot
import io.mockk.unmockkObject
import io.mockk.unmockkStatic
import io.mockk.verify
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
@RunWith(FenixRobolectricTestRunner::class)
class StrictModeManagerTest {
@MockK(relaxUnitFun = true) private lateinit var fragmentManager: FragmentManager
@Before
fun setup() {
MockKAnnotations.init(this)
mockkStatic(StrictMode::class)
mockkObject(Config)
}
@After
fun teardown() {
unmockkStatic(StrictMode::class)
unmockkObject(Config)
}
@Test
fun `test enableStrictMode in release`() {
every { Config.channel } returns ReleaseChannel.FenixProduction
StrictModeManager.enableStrictMode(false)
verify(exactly = 0) { StrictMode.setThreadPolicy(any()) }
verify(exactly = 0) { StrictMode.setVmPolicy(any()) }
}
@Test
fun `test enableStrictMode in debug`() {
every { Config.channel } returns ReleaseChannel.FenixDebug
StrictModeManager.enableStrictMode(false)
verify { StrictMode.setThreadPolicy(any()) }
verify { StrictMode.setVmPolicy(any()) }
}
@Test
fun `test changeStrictModePolicies`() {
val callbacks = slot<FragmentManager.FragmentLifecycleCallbacks>()
StrictModeManager.changeStrictModePolicies(fragmentManager)
verify { fragmentManager.registerFragmentLifecycleCallbacks(capture(callbacks), false) }
confirmVerified(fragmentManager)
callbacks.captured.onFragmentResumed(fragmentManager, mockk())
verify { fragmentManager.unregisterFragmentLifecycleCallbacks(callbacks.captured) }
}
}

View File

@ -0,0 +1,79 @@
/* 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.ext
import android.os.StrictMode
import io.mockk.Runs
import io.mockk.every
import io.mockk.just
import io.mockk.mockk
import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkObject
import io.mockk.unmockkStatic
import io.mockk.verify
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mozilla.fenix.Config
import org.mozilla.fenix.ReleaseChannel
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
@RunWith(FenixRobolectricTestRunner::class)
class StrictModeTest {
private lateinit var threadPolicy: StrictMode.ThreadPolicy
private lateinit var functionBlock: () -> String
@Before
fun setup() {
threadPolicy = StrictMode.ThreadPolicy.LAX
functionBlock = mockk()
mockkStatic(StrictMode::class)
mockkObject(Config)
every { StrictMode.setThreadPolicy(threadPolicy) } just Runs
every { functionBlock() } returns "Hello world"
}
@After
fun teardown() {
unmockkStatic(StrictMode::class)
unmockkObject(Config)
}
@Test
fun `runs function block in release`() {
every { Config.channel } returns ReleaseChannel.FenixProduction
assertEquals("Hello world", threadPolicy.resetPoliciesAfter(functionBlock))
verify(exactly = 0) { StrictMode.setThreadPolicy(any()) }
}
@Test
fun `runs function block in debug`() {
every { Config.channel } returns ReleaseChannel.FenixDebug
assertEquals("Hello world", threadPolicy.resetPoliciesAfter(functionBlock))
verify { StrictMode.setThreadPolicy(threadPolicy) }
}
@Test
fun `sets thread policy even if function throws`() {
every { Config.channel } returns ReleaseChannel.FenixDebug
every { functionBlock() } throws IllegalStateException()
var exception: IllegalStateException? = null
try {
threadPolicy.resetPoliciesAfter(functionBlock)
} catch (e: IllegalStateException) {
exception = e
}
verify { StrictMode.setThreadPolicy(threadPolicy) }
assertNotNull(exception)
}
}

View File

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

View File

@ -80,6 +80,7 @@ job-defaults:
- '--binary=org.mozilla.fenix.nightly'
- '--activity=org.mozilla.fenix.IntentReceiverActivity'
- '--download-symbols=ondemand'
- '--no-conditioned-profile'
fetches:
toolchain:
- linux64-minidump-stackwalk