From 56f78cb30c0127111308ff46010c92d5c8b7ac1f Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Tue, 29 Sep 2020 14:12:20 -0700 Subject: [PATCH 01/24] No issue: elaborate on Components class doc. This is to clarify a misunderstanding I found in PR review. --- .../main/java/org/mozilla/fenix/components/Components.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/Components.kt b/app/src/main/java/org/mozilla/fenix/components/Components.kt index 83ac7fa94..92b9d97d0 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Components.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Components.kt @@ -31,7 +31,11 @@ import java.util.concurrent.TimeUnit private const val DAY_IN_MINUTES = 24 * 60L /** - * Provides access to all components. + * Provides access to all components. This class is an implementation of the Service Locator + * pattern, which helps us manage the dependencies in our app. + * + * Note: these aren't just "components" from "android-components": they're any "component" that + * can be considered a building block of our app. */ @Mockable class Components(private val context: Context) { From cd6ab4511942ce1f8ce094c1ab617e182763ae42 Mon Sep 17 00:00:00 2001 From: Ben Hearsum Date: Wed, 30 Sep 2020 09:28:40 -0400 Subject: [PATCH 02/24] Block github tagging on push-apk (#15546) Currently, push-apk fails to verify its chain of trust if github tagging is done before it runs. Until this is fixed, we need to make sure tagging is blocked on pushing. --- taskcluster/ci/github-release/kind.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/taskcluster/ci/github-release/kind.yml b/taskcluster/ci/github-release/kind.yml index 8d7df3941..262061c66 100644 --- a/taskcluster/ci/github-release/kind.yml +++ b/taskcluster/ci/github-release/kind.yml @@ -10,6 +10,9 @@ transforms: - taskgraph.transforms.task:transforms kind-dependencies: + # To work around a race condition where if this runs before + # push-apk, push-apk fails to verify chain of trust + - push-apk - signing primary-dependency: signing From 19b377c0214099b04de3f9e5939893124722851e Mon Sep 17 00:00:00 2001 From: mcarare Date: Wed, 30 Sep 2020 17:59:51 +0300 Subject: [PATCH 03/24] For #15535: hasOpenTabs now considers the selected tab mode in tray tab. --- .../java/org/mozilla/fenix/tabtray/TabTrayView.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt index 5ef4429f3..924496c43 100644 --- a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt +++ b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt @@ -213,9 +213,15 @@ class TabTrayView( tabTrayItemMenu = TabTrayItemMenu( - view.context, - { tabs.isNotEmpty() && view.tab_layout.selectedTabPosition == 0 }, - { tabs.isNotEmpty() }) { + context = view.context, + shouldShowSaveToCollection = { tabs.isNotEmpty() && view.tab_layout.selectedTabPosition == 0 }, + hasOpenTabs = { + if (isPrivateModeSelected) { + view.context.components.core.store.state.privateTabs.isNotEmpty() + } else { + view.context.components.core.store.state.normalTabs.isNotEmpty() + } + }) { when (it) { is TabTrayItemMenu.Item.ShareAllTabs -> interactor.onShareTabsClicked( isPrivateModeSelected From ff930175def58303c4a4cb9c1b06cbb191d2b603 Mon Sep 17 00:00:00 2001 From: Stefan Arentz Date: Wed, 30 Sep 2020 13:05:28 -0400 Subject: [PATCH 04/24] For #15537 - Be more verbose about leanplum identifiers (#15538) --- .../fenix/components/metrics/LeanplumMetricsService.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt index 3012e1aa1..fab3b956c 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt @@ -105,6 +105,8 @@ class LeanplumMetricsService( if (!application.settings().isMarketingTelemetryEnabled) return + Log.i(LOGTAG, "Starting Leanplum with device id: $deviceId") + Leanplum.setIsTestModeEnabled(false) Leanplum.setApplicationContext(application) Leanplum.setDeviceId(deviceId) @@ -171,6 +173,8 @@ class LeanplumMetricsService( LeanplumInternal.setCalledStart(true) LeanplumInternal.setHasStarted(true) LeanplumInternal.setStartedInBackground(true) + Log.i(LOGTAG, "Started Leanplum with deviceId ${Leanplum.getDeviceId()}" + + " and userId ${Leanplum.getUserId()}") } } } @@ -185,6 +189,9 @@ class LeanplumMetricsService( // We compare the local Leanplum device ID against the "uid" query parameter and only // accept deep links where both values match. val uid = deepLink.getQueryParameter("uid") + if (uid != deviceId) { + Log.i(LOGTAG, "Rejecting Leanplum deep link because uid $uid does not match $deviceId") + } return uid == deviceId } From 4a06e40e70c37df4157efc7f90afb682dbd3bb54 Mon Sep 17 00:00:00 2001 From: Christian Sadilek Date: Wed, 30 Sep 2020 14:19:23 -0400 Subject: [PATCH 05/24] Closes #15555: Intermittent failures in SettingsFragmentTest --- .../fenix/settings/SettingsFragmentTest.kt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/src/test/java/org/mozilla/fenix/settings/SettingsFragmentTest.kt b/app/src/test/java/org/mozilla/fenix/settings/SettingsFragmentTest.kt index 8a6d2ad64..2c2acaf6b 100644 --- a/app/src/test/java/org/mozilla/fenix/settings/SettingsFragmentTest.kt +++ b/app/src/test/java/org/mozilla/fenix/settings/SettingsFragmentTest.kt @@ -8,20 +8,41 @@ import androidx.fragment.app.FragmentActivity import androidx.preference.Preference import io.mockk.every import io.mockk.mockk +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.test.TestCoroutineDispatcher +import mozilla.components.support.test.robolectric.testContext +import mozilla.components.support.test.rule.MainCoroutineRule import org.junit.Assert.assertFalse import org.junit.Assert.assertNotNull import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mozilla.fenix.R +import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.getPreferenceKey import org.mozilla.fenix.helpers.FenixRobolectricTestRunner import org.mozilla.fenix.utils.Settings import org.robolectric.Robolectric +import java.io.IOException +@ExperimentalCoroutinesApi @RunWith(FenixRobolectricTestRunner::class) class SettingsFragmentTest { + private val testDispatcher = TestCoroutineDispatcher() + + @get:Rule + val coroutinesTestRule = MainCoroutineRule(testDispatcher) + + @Before + fun setup() { + // Mock client for fetching account avatar + val client = testContext.components.core.client + every { client.fetch(any()) } throws IOException("test") + } + @Test fun `Add-on collection override pref is visible if debug menu active`() { val settingsFragment = SettingsFragment() @@ -31,6 +52,8 @@ class SettingsFragmentTest { .add(settingsFragment, "test") .commitNow() + testDispatcher.advanceUntilIdle() + val preferenceAmoCollectionOverride = settingsFragment.findPreference( settingsFragment.getPreferenceKey(R.string.pref_key_override_amo_collection) ) @@ -54,6 +77,8 @@ class SettingsFragmentTest { .add(settingsFragment, "test") .commitNow() + testDispatcher.advanceUntilIdle() + val preferenceAmoCollectionOverride = settingsFragment.findPreference( settingsFragment.getPreferenceKey(R.string.pref_key_override_amo_collection) ) From 67310061a35f104569cac24506dcb5da9464695a Mon Sep 17 00:00:00 2001 From: mcarare Date: Wed, 30 Sep 2020 15:36:31 +0300 Subject: [PATCH 06/24] For #15559: Allow tabs to stretch in landscape mode for tablets. This overrides the default tabMaxWidth of 264dp to allow for tabGravity="fill". --- app/src/main/res/layout/component_tabstray.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/component_tabstray.xml b/app/src/main/res/layout/component_tabstray.xml index baeb90297..eaf5d2e8a 100644 --- a/app/src/main/res/layout/component_tabstray.xml +++ b/app/src/main/res/layout/component_tabstray.xml @@ -112,6 +112,7 @@ android:id="@+id/tab_layout" android:layout_width="0dp" android:layout_height="80dp" + app:tabMaxWidth="0dp" android:background="@color/foundation_normal_theme" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" From ced92d69d17d0e8d962f1234f5964c54d226a4bd Mon Sep 17 00:00:00 2001 From: Christian Sadilek Date: Wed, 30 Sep 2020 17:01:56 -0400 Subject: [PATCH 07/24] Issue #15555: Set channel to Nightly explicitly for SettingsFragmentTest --- .../java/org/mozilla/fenix/settings/SettingsFragmentTest.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/test/java/org/mozilla/fenix/settings/SettingsFragmentTest.kt b/app/src/test/java/org/mozilla/fenix/settings/SettingsFragmentTest.kt index 2c2acaf6b..fb6500a76 100644 --- a/app/src/test/java/org/mozilla/fenix/settings/SettingsFragmentTest.kt +++ b/app/src/test/java/org/mozilla/fenix/settings/SettingsFragmentTest.kt @@ -8,6 +8,7 @@ import androidx.fragment.app.FragmentActivity import androidx.preference.Preference import io.mockk.every import io.mockk.mockk +import io.mockk.mockkObject import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.TestCoroutineDispatcher import mozilla.components.support.test.robolectric.testContext @@ -19,7 +20,9 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith +import org.mozilla.fenix.Config import org.mozilla.fenix.R +import org.mozilla.fenix.ReleaseChannel import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.getPreferenceKey import org.mozilla.fenix.helpers.FenixRobolectricTestRunner @@ -41,6 +44,9 @@ class SettingsFragmentTest { // Mock client for fetching account avatar val client = testContext.components.core.client every { client.fetch(any()) } throws IOException("test") + + mockkObject(Config) + every { Config.channel } returns ReleaseChannel.Nightly } @Test From 51dab196c45263e8b435f20af05329d4799bc9f4 Mon Sep 17 00:00:00 2001 From: Grisha Kruglov Date: Wed, 30 Sep 2020 14:46:14 -0700 Subject: [PATCH 08/24] Closes #15443: Use fragment's lifecycleScope for AlertDialog actions --- .../main/java/org/mozilla/fenix/home/HomeFragment.kt | 3 ++- .../fenix/library/bookmarks/BookmarkFragment.kt | 3 ++- .../library/bookmarks/edit/EditBookmarkFragment.kt | 3 ++- .../mozilla/fenix/library/history/HistoryFragment.kt | 3 ++- .../settings/account/AccountSettingsFragment.kt | 3 ++- .../deletebrowsingdata/DeleteBrowsingDataFragment.kt | 2 +- .../controller/SavedLoginsStorageController.kt | 12 ++++++------ .../settings/logins/fragment/EditLoginFragment.kt | 2 +- .../settings/logins/fragment/LoginDetailFragment.kt | 2 +- .../settings/logins/fragment/SavedLoginsFragment.kt | 2 +- .../SitePermissionsDetailsExceptionsFragment.kt | 3 ++- .../mozilla/fenix/tabtray/TabTrayDialogFragment.kt | 2 +- .../logins/SavedLoginsStorageControllerTest.kt | 2 +- 13 files changed, 24 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt index 97fb25474..250eaa7da 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt @@ -622,7 +622,8 @@ class HomeFragment : Fragment() { dialog.cancel() } setPositiveButton(R.string.tab_collection_dialog_positive) { dialog: DialogInterface, _ -> - viewLifecycleOwner.lifecycleScope.launch(IO) { + // Use fragment's lifecycle; the view may be gone by the time dialog is interacted with. + lifecycleScope.launch(IO) { context.components.core.tabCollectionStorage.removeCollection(tabCollection) context.components.analytics.metrics.track(Event.CollectionRemoved) }.invokeOnCompletion { diff --git a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt index 18c19943e..f976a39fa 100644 --- a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt @@ -365,7 +365,8 @@ class BookmarkFragment : LibraryPageFragment(), UserInteractionHan pendingBookmarkDeletionJob = getDeleteOperation(Event.RemoveBookmarkFolder) dialog.dismiss() val snackbarMessage = getRemoveBookmarksSnackBarMessage(selected, containsFolders = true) - viewLifecycleOwner.lifecycleScope.allowUndo( + // Use fragment's lifecycle; the view may be gone by the time dialog is interacted with. + lifecycleScope.allowUndo( requireView(), snackbarMessage, getString(R.string.bookmark_undo_deletion), diff --git a/app/src/main/java/org/mozilla/fenix/library/bookmarks/edit/EditBookmarkFragment.kt b/app/src/main/java/org/mozilla/fenix/library/bookmarks/edit/EditBookmarkFragment.kt index c7de31c64..db2e3f71b 100644 --- a/app/src/main/java/org/mozilla/fenix/library/bookmarks/edit/EditBookmarkFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/library/bookmarks/edit/EditBookmarkFragment.kt @@ -182,7 +182,8 @@ class EditBookmarkFragment : Fragment(R.layout.fragment_edit_bookmark) { dialog.cancel() } setPositiveButton(R.string.tab_collection_dialog_positive) { dialog: DialogInterface, _ -> - viewLifecycleOwner.lifecycleScope.launch(IO) { + // Use fragment's lifecycle; the view may be gone by the time dialog is interacted with. + lifecycleScope.launch(IO) { requireComponents.core.bookmarksStorage.deleteNode(args.guidToEdit) requireComponents.analytics.metrics.track(Event.RemoveBookmark) diff --git a/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt b/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt index f4714615a..a158eecc9 100644 --- a/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt @@ -267,7 +267,8 @@ class HistoryFragment : LibraryPageFragment(), UserInteractionHandl } setPositiveButton(R.string.delete_browsing_data_prompt_allow) { dialog: DialogInterface, _ -> historyStore.dispatch(HistoryFragmentAction.EnterDeletionMode) - viewLifecycleOwner.lifecycleScope.launch(IO) { + // Use fragment's lifecycle; the view may be gone by the time dialog is interacted with. + lifecycleScope.launch(IO) { requireComponents.analytics.metrics.track(Event.HistoryAllItemsRemoved) requireComponents.core.store.dispatch(RecentlyClosedAction.RemoveAllClosedTabAction) requireComponents.core.historyStorage.deleteEverything() diff --git a/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt index 8ccc5ff87..45e73998d 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt @@ -233,7 +233,8 @@ class AccountSettingsFragment : PreferenceFragmentCompat() { setNegativeButton(getString(R.string.logins_warning_dialog_later)) { _: DialogInterface, _ -> SyncEnginesStorage(context).setStatus(SyncEngine.Passwords, newValue) - viewLifecycleOwner.lifecycleScope.launch { + // Use fragment's lifecycle; the view may be gone by the time dialog is interacted with. + lifecycleScope.launch { context.components.backgroundServices.accountManager.syncNow(SyncReason.EngineChange) } } diff --git a/app/src/main/java/org/mozilla/fenix/settings/deletebrowsingdata/DeleteBrowsingDataFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/deletebrowsingdata/DeleteBrowsingDataFragment.kt index 77f867494..95732ce21 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/deletebrowsingdata/DeleteBrowsingDataFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/deletebrowsingdata/DeleteBrowsingDataFragment.kt @@ -142,7 +142,7 @@ class DeleteBrowsingDataFragment : Fragment(R.layout.fragment_delete_browsing_da private fun deleteSelected() { startDeletion() - viewLifecycleOwner.lifecycleScope.launch(IO) { + lifecycleScope.launch(IO) { getCheckboxes().mapIndexed { i, v -> if (v.isChecked) { when (i) { diff --git a/app/src/main/java/org/mozilla/fenix/settings/logins/controller/SavedLoginsStorageController.kt b/app/src/main/java/org/mozilla/fenix/settings/logins/controller/SavedLoginsStorageController.kt index bd1bbe96a..5257c73f8 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/logins/controller/SavedLoginsStorageController.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/logins/controller/SavedLoginsStorageController.kt @@ -30,7 +30,7 @@ import org.mozilla.fenix.settings.logins.mapToSavedLogin */ open class SavedLoginsStorageController( private val passwordsStorage: SyncableLoginsStorage, - private val viewLifecycleScope: CoroutineScope, + private val lifecycleScope: CoroutineScope, private val navController: NavController, private val loginsFragmentStore: LoginsFragmentStore, private val ioDispatcher: CoroutineDispatcher = Dispatchers.IO @@ -40,7 +40,7 @@ open class SavedLoginsStorageController( fun delete(loginId: String) { var deleteLoginJob: Deferred? = null - val deleteJob = viewLifecycleScope.launch(ioDispatcher) { + val deleteJob = lifecycleScope.launch(ioDispatcher) { deleteLoginJob = async { passwordsStorage.delete(loginId) } @@ -58,7 +58,7 @@ open class SavedLoginsStorageController( fun save(loginId: String, usernameText: String, passwordText: String) { var saveLoginJob: Deferred? = null - viewLifecycleScope.launch(ioDispatcher) { + lifecycleScope.launch(ioDispatcher) { saveLoginJob = async { // must retrieve from storage to get the httpsRealm and formActionOrigin val oldLogin = passwordsStorage.get(loginId) @@ -124,7 +124,7 @@ open class SavedLoginsStorageController( fun findPotentialDuplicates(loginId: String) { var deferredLogin: Deferred>? = null - val fetchLoginJob = viewLifecycleScope.launch(ioDispatcher) { + val fetchLoginJob = lifecycleScope.launch(ioDispatcher) { deferredLogin = async { val login = getLogin(loginId) passwordsStorage.getPotentialDupesIgnoringUsername(login!!) @@ -150,7 +150,7 @@ open class SavedLoginsStorageController( fun fetchLoginDetails(loginId: String) { var deferredLogin: Deferred>? = null - val fetchLoginJob = viewLifecycleScope.launch(ioDispatcher) { + val fetchLoginJob = lifecycleScope.launch(ioDispatcher) { deferredLogin = async { passwordsStorage.list() } @@ -178,7 +178,7 @@ open class SavedLoginsStorageController( fun handleLoadAndMapLogins() { var deferredLogins: Deferred>? = null - val fetchLoginsJob = viewLifecycleScope.launch(ioDispatcher) { + val fetchLoginsJob = lifecycleScope.launch(ioDispatcher) { deferredLogins = async { passwordsStorage.list() } diff --git a/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/EditLoginFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/EditLoginFragment.kt index 62a624169..fccf33aa9 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/EditLoginFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/EditLoginFragment.kt @@ -76,7 +76,7 @@ class EditLoginFragment : Fragment(R.layout.fragment_edit_login) { interactor = EditLoginInteractor( SavedLoginsStorageController( passwordsStorage = requireContext().components.core.passwordsStorage, - viewLifecycleScope = viewLifecycleOwner.lifecycleScope, + lifecycleScope = lifecycleScope, navController = findNavController(), loginsFragmentStore = loginsFragmentStore ) diff --git a/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/LoginDetailFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/LoginDetailFragment.kt index 7120c0fe0..63fe12c87 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/LoginDetailFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/LoginDetailFragment.kt @@ -86,7 +86,7 @@ class LoginDetailFragment : Fragment(R.layout.fragment_login_detail) { interactor = LoginDetailInteractor( SavedLoginsStorageController( passwordsStorage = requireContext().components.core.passwordsStorage, - viewLifecycleScope = viewLifecycleOwner.lifecycleScope, + lifecycleScope = lifecycleScope, navController = findNavController(), loginsFragmentStore = savedLoginsStore ) diff --git a/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsFragment.kt index dc50cc445..130e856a6 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsFragment.kt @@ -92,7 +92,7 @@ class SavedLoginsFragment : Fragment() { savedLoginsStorageController = SavedLoginsStorageController( passwordsStorage = requireContext().components.core.passwordsStorage, - viewLifecycleScope = viewLifecycleOwner.lifecycleScope, + lifecycleScope = viewLifecycleOwner.lifecycleScope, navController = findNavController(), loginsFragmentStore = savedLoginsStore ) diff --git a/app/src/main/java/org/mozilla/fenix/settings/sitepermissions/SitePermissionsDetailsExceptionsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/sitepermissions/SitePermissionsDetailsExceptionsFragment.kt index 9ad2a5f1a..8e68407b2 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/sitepermissions/SitePermissionsDetailsExceptionsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/sitepermissions/SitePermissionsDetailsExceptionsFragment.kt @@ -92,7 +92,8 @@ class SitePermissionsDetailsExceptionsFragment : PreferenceFragmentCompat() { } private fun clearSitePermissions() { - viewLifecycleOwner.lifecycleScope.launch(IO) { + // Use fragment's lifecycle; the view may be gone by the time dialog is interacted with. + lifecycleScope.launch(IO) { requireContext().components.core.permissionStorage.deleteSitePermissions(sitePermissions) withContext(Main) { requireView().findNavController().popBackStack() diff --git a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt index 858be4e76..624b10e4c 100644 --- a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt @@ -417,7 +417,7 @@ class TabTrayDialogFragment : AppCompatDialogFragment(), UserInteractionHandler AlertDialog.Builder(it).setTitle(R.string.tab_tray_add_new_collection) .setView(customLayout).setPositiveButton(android.R.string.ok) { dialog, _ -> - viewLifecycleOwner.lifecycleScope.launch(Dispatchers.IO) { + lifecycleScope.launch(Dispatchers.IO) { tabCollectionStorage.createCollection( collectionNameEditText.text.toString(), sessionList diff --git a/app/src/test/java/org/mozilla/fenix/settings/logins/SavedLoginsStorageControllerTest.kt b/app/src/test/java/org/mozilla/fenix/settings/logins/SavedLoginsStorageControllerTest.kt index d29acb3ed..e06dc6641 100644 --- a/app/src/test/java/org/mozilla/fenix/settings/logins/SavedLoginsStorageControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/settings/logins/SavedLoginsStorageControllerTest.kt @@ -54,7 +54,7 @@ class SavedLoginsStorageControllerTest { controller = SavedLoginsStorageController( passwordsStorage = passwordsStorage, - viewLifecycleScope = scope, + lifecycleScope = scope, navController = navController, loginsFragmentStore = loginsFragmentStore, ioDispatcher = ioDispatcher From 97adee3bd982be85749bc8524c812579c9e4300f Mon Sep 17 00:00:00 2001 From: Mozilla L10n Automation Bot Date: Thu, 1 Oct 2020 00:01:45 +0000 Subject: [PATCH 09/24] Import l10n. --- app/src/main/res/values-an/strings.xml | 13 + app/src/main/res/values-ast/strings.xml | 13 + app/src/main/res/values-be/strings.xml | 12 + app/src/main/res/values-bg/strings.xml | 753 ++++++++++++++++++++- app/src/main/res/values-co/strings.xml | 4 +- app/src/main/res/values-cs/strings.xml | 2 +- app/src/main/res/values-da/strings.xml | 41 ++ app/src/main/res/values-el/strings.xml | 7 + app/src/main/res/values-nn-rNO/strings.xml | 5 + app/src/main/res/values-oc/strings.xml | 16 + app/src/main/res/values-rm/strings.xml | 15 + app/src/main/res/values-tg/strings.xml | 85 +++ 12 files changed, 938 insertions(+), 28 deletions(-) diff --git a/app/src/main/res/values-an/strings.xml b/app/src/main/res/values-an/strings.xml index f3e5ff308..a8ccecc84 100644 --- a/app/src/main/res/values-an/strings.xml +++ b/app/src/main/res/values-an/strings.xml @@ -143,6 +143,8 @@ Instalar Pestanyas sincronizadas + + Resincronizar Mirar en a pachina @@ -466,6 +468,11 @@ Desplazar pa amagar la barra de ferramientas + + Eslizar la barra de ferramientas enta los costaus pa cambiar de pestanya + + Eslizar la barra de ferramientas enta alto pa ubrir las pestanyas + Sesions @@ -1351,8 +1358,12 @@ Puesto copiau a lo portafuellas Copiar clau + + Borrar la clau Copiar nombre d’usuario + + Borrar lo nombre d\'usuario Copiar puesto @@ -1523,6 +1534,8 @@ S’ha arribau a lo limite de puestos principals. + + Pa anyadir un nuevo puesto principal, has de borrar-ne belatro. Toca y mantiene pretau lo puesto y tría borrar. Vale, entendiu diff --git a/app/src/main/res/values-ast/strings.xml b/app/src/main/res/values-ast/strings.xml index 3a411efed..a3ad01a5b 100644 --- a/app/src/main/res/values-ast/strings.xml +++ b/app/src/main/res/values-ast/strings.xml @@ -405,6 +405,8 @@ Comparte los datos tocante a les carauterístiques qu\'uses en %1$s con Leanplum, el nuesu fornidor de marketing móvil. Esperimentos + + Permite que Mozilla instale y recueya datos pa carauterístiques esperimentales Informador de casques @@ -1079,6 +1081,8 @@ Aniciu de sesión cola cámara Usar una direición de corréu + + Crea una pa sincronizar Firefox ente preseos.]]> Firefox va dexar de sincronizase cola to cuenta mas nun va desaniciar nengún datu d\'esti preséu. @@ -1187,6 +1191,12 @@ The first parameter is the app name --> %s | Biblioteques OSS + + Redireiciones de rastrexadores + + + Llimpia les cookies creaes poles redireiciones a sitios web conocíos que rastrexen. + Sofitu @@ -1465,6 +1475,9 @@ Aniciar sesión pa sincronizar + + Nun hai llingüetes abiertes + Algamóse la llende de sitios destacaos diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml index cb9a9128d..5581b385f 100644 --- a/app/src/main/res/values-be/strings.xml +++ b/app/src/main/res/values-be/strings.xml @@ -423,6 +423,9 @@ Служба месцазнаходжання Mozilla + + Справаздача аб здароўі %s + Уключыць сінхранізацыю @@ -469,6 +472,9 @@ Пасуньце ўбок панэль інструментаў, каб пераключыць карткі + + Пасуньце ўверх панэль інструментаў, каб адкрыць карткі + Сеансы @@ -1142,6 +1148,8 @@ Увайдзіце з дапамогай камеры Выкарыстаць электронную пошту + + Стварыце яго, каб сінхранізаваць Firefox паміж прыладамі.]]> Firefox спыніць сінхранізацыю з вашым уліковым запісам, але не выдаліць дадзеныя аглядання на гэтай прыладзе. @@ -1424,6 +1432,8 @@ Падрабязней + + Інфармацыя аб дададзенай пошукавай сістэме Спасылка на падрабязныя звесткі @@ -1545,6 +1555,8 @@ Дасягнуты ліміт папулярных сайтаў + + Каб дадаць новы топ-сайт, выдаліце якісь іншы. Націсніце на сайт і ўтрымлівайце, пасля абярыце "Выдаліць". OK, зразумела diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 97698b01e..66808702e 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -21,12 +21,44 @@ Поверителните раздели ще бъдат показани тук. + + 1 отворен раздел. Докоснете за превключване на раздели. + + %1$s отворени раздели. Докоснете за превключване между тях. + + %1$d избрани + + Създаване на списък + + Име + + Избор на списък + + Изход от режим на множествен избор + + Запазване на избраните раздели в списък + + + Отментат %1$s + + Неотментат %1$s + + Излизане от режим на множествен избор + + Режим на множествен избор, изберете раздели за добавяне към списък + + + Избран + %1$s е произведен от Mozilla. Вие сте в поверителен прозорец + + %1$s изчиства историята на търсенето и разглеждането, когато ги затворите или излезете от приложението. Въпреки че това не ви прави анонимни за уеб сайтовете или доставчиците на интернет услуги, улеснява запазването на анонимността на действия ви в мрежата, от останалите ползващи същото устройство. Разпространени легенди относно поверителното разглеждане Изтриване на сесията @@ -48,6 +80,26 @@ Не сега + + + Може да настроите Firefox автоматично да отваря препратки в приложения + + Към настройки + + Прекратяване + + + Към настройки + + Прекратяване + + + Настройте отворените раздели да бъдат автоматично затваряни ако не са преглеждани през последния ден, седмица или месец. + + Настройки + + Прекратяване + Нов раздел @@ -98,7 +150,7 @@ Нов раздел - Добавяне в списък + Добавяне към списък Споделяне @@ -140,14 +192,12 @@ Сканиране - - Преки пътища + + Търсеща машина Настройки на търсачките - - Търсене с - Този път търсете с: + Този път търсете с: Използване на препратка от буфера @@ -202,7 +252,7 @@ Банкови карти и адреси - Задаване като стандартен четец + Четец по подразбиране Разширени @@ -216,13 +266,19 @@ Поверително разглеждане - Отваряне препратките в поверителен раздел + Отваряне препратки в поверителен раздел Снимки на екрана в поверителен режим + + Ако е включено, поверителните раздели ще са видими от отворените приложения Добавяне на икона за поверителен режим Достъпност + + Личен сървър за Firefox Account + + Личен сървър за Sync Сметка @@ -231,8 +287,12 @@ Лента с инструменти Тема + + Начален екран + + Жестове - Персонализиране + Външен вид Синхронизирайте отметки, пароли и други с вашия Firefox Account @@ -251,27 +311,36 @@ Развойни инструменти Отдалечено отстраняване на дефекти през USB - - Преки пътища за търсене + + Показване на търсещи машини Показване на предложения Показване на гласово търсене - Показване в поверителен режим + В поверителен режим също - Показване на предложения от буфера + Предложения от буфера - Търсене на историята на разглеждане + В история на разглеждане - Търсене в отметките + В отметките + + В синхронизираните раздели Настройки на сметката + + Автоматично довършване на адреси Отваряне на препратки в приложения + + Външно приложение за изтегляния Добавки + + Известия + Синхронизиране @@ -347,8 +416,12 @@ Споделя данни за използването, производителността, хардуера, настройките на четеца с Mozilla, за да ни помогне да направим %1$s по-добър Маркетингови данни + + Споделя данни за използваните от вас възможности на %1$s чрез Leanplum, нашият партньор за мобилен маркетинг. Експерименти + + Позволява на Mozilla да инсталира експериментални възможности и да събира данни за тях Доклади за срив @@ -374,7 +447,7 @@ firefox.com/pair]]> - Отваряне на камерата + Отваряне на камера Отказ @@ -391,10 +464,14 @@ Тъмна - Зададена от приложението за пестене на батерия + Зададена от приложение за пестене на батерия Следва темата на устройството + + + Издърпайте за презареждане + Сесии @@ -427,6 +504,32 @@ Затваряне + + Последно затворени раздели + + Цялата история + + %d раздела + + %d раздел + + + Няма затворени раздели + + + + Затваряне на раздели + + Ръчно + + След един ден + + След една седмица + + След един месец + Отворени раздели @@ -443,9 +546,13 @@ Отворени раздели - Добавяне в списък + Добавяне към списък Споделяне на всички раздели + + Последно затворени раздели + + Настройки на раздели Затваряне на всички раздели @@ -481,17 +588,242 @@ Заглавна пиктограма на текущото меню на сесия + + Добавяне към списък + + Изтриване на списък + + Преименуване на списък + + Отваряне на раздели + + Премахване + + Премахване от историята + + %1$s (поверителен режим) + + Запазване + + + + Изчистване на история + + Сигурни ли сте, че желаете да изтриете историята на разглеждане? + + Историята е изчистена + + Изтрито %1$s + + Изчистване + + Копиране + + Споделяне + + Отваряне в раздел + + Отваряне в поверителен раздел + + Изтриване + + %1$d избрани + + Изтриване на %1$d записа + + + Последните 24 часа + + Последните 7 дни + + Последните 30 дни + + + По-стари + + Липсва история + + + + Няма изтегляния + + %1$d избрани + + + + Извинете. %1$s не можа да зареди страницата. + + Oпитайте да възстановите или затворите раздела. + + Изпращане на доклад за срива до Mozilla + + Затваряне на раздел + + Възстановяване на раздел + + + Настройки на сесия + + + Споделяне на сесия + + + + Меню отметки + + Промяна на отметка + + Избор на папка + + Наистина ли искате да изтриете папката? + + %s ще изтрие избраните елементи. + + Изтрита %1$s + + Добавяне на папка + + Отметката е създадена. + + Отметката е запазена! + + ПРОМЕНЯНЕ + + Променяне + + Избиране + + Копиране + + Споделяне + + Отваряне в нов раздел + + Отваряне в поверителен раздел + + Изтриване + + Запазване + + %1$d избрани + + Промяна на отметка + + Промяна на папка + + Влезте, за да видите синхронизираните отметки + + URL + + ПАПКА + + ИМЕ + + Добавяне на папка + + Избиране на папка + + Заглавието е задължително + + Неправилен адрес + + + Липсват отметки + + Изтрита %1$s + + Отметките са изтрити + + Изтриване на избраните папки + + ОТМЕНЯНЕ + + + + Права + + Към настройките Списък с бързи настройки + + Препоръчително + + Управление на права на страница + + Изчистване на правата + + + Изчистване на правото + + Изчистване на правата на всички страници + + Автоматично възпроизвеждане + + Камера + + Микрофон + + Местоположение + + Известие + + Винаги да пита + + Забраняване + + Разрешаване + + Забранено от Android + + Изключения + + + Включено + + Изключено + + Разрешаване на звук и видео + + + Включено + + Изключено + + + + Списъци Меню Списъци + + Съберете важните за вас неща.\nГрупирайте търсения, страници и раздели за бърз достъп по-късно. + + Избиране на раздели + + Създаване на списък Избиране на всички + + Отменяне всички + + Изберете раздели за запазване + + %d раздела избрани + + %d раздел избран Разделите са запазени! + + Колекция запазена! Разделът е запазен! @@ -499,14 +831,112 @@ Запазване + + Преглед + + + Списък %d + + + + Изпращане и споделяне + + Споделяне Споделяне + + Споделяне на препратка + + Всички действия + + Последно използвани + + Вписване в Sync + + Изпращане до всички устройства + + Повторно свързване със Sync + + Без мрежа + + Добавяне на устройство + + За да изпращате раздели е необходимо да бъдете вписани във Firefox на поне едно устройство. + + + Разбрах + + Невъзможно е споделяне с това приложение + + Изпращане към устройство + + Няма свързани устройства + + Повече за изпращане на раздели… + + Добавяне на устройство… + + + + Поверителна сесия + + Изчистване на поверителни раздели + + Затваряне на поверителни раздели + + Отваряне + + Изчистване и отваряне Разрешете %1$s да отвори %2$s + + Изтриване на %1$s? + + Изтриване + + Отказ + + + Режим на цял екран + + Адресът е копиран + + + Отворени раздели + + %d раздела + + %d адреса + + История + + %d страници + + Бисквитки + + Изход + + + Отказ + + Изтриване + + + Преминете към новият Nightly + + + Firefox Nightly е преместен + + + + Здравейте от %s! Запознайте се с %s @@ -517,17 +947,21 @@ Имате въпроси относно новия дизайн на %s? Искате ли да разберете какви са промените? Получете отговори тук - - Извлечете максимума от %s - + + Синхронизирайте отметки, пароли и други чрез вашата сметка във Firefox. + + Научете повече + + Вписване… + + Вписване във Firefox Автоматична поверителност Настройките за поверителност и сигурност спират проследяващ и злонамерен код, както и компании, които ви преследват. - Стандартна (по подразбиране) + Стандартна (подразбиране) Спира малко проследявания. Страниците зареждат нормално. @@ -536,42 +970,311 @@ Строга Спира повече проследявания, реклами и изскачащи прозорци. Страниците зареждат по-бързо, но може да не работят. + + Изберете страна + + Изпробвайте работа с една ръка, с лента инструменти отдолу, или я преместете отгоре. + + Разглеждайте поверително + + За да отворите поверителен раздел: докоснете иконата %s. + + За да се отваря поверителен раздел всеки път: променете настройките за поверително разглеждане. + + Отваряне на настройки + + Поверителност + + Проектирали сме %s така, че да ви предоставя контрол върху това, което споделяте както онлайн, така и с нас. + + + Бележка за поверителността Затваряне + + Започнете да разглеждате + Изберете тема + + Запазете батерия и зрението си с избиране на тъмна тема. + + Автоматичнa + + Приспособява се към настройките на устройството + + Тъмна тема + + Светла тема + + + Разделите са изпратени! + + Разделът е изпратен! + + НОВ ОПИТ + + Сканиране на код + + + Отказ + + + + Настройки на защитата + + Подобрена защита от проследяване - Преглеждайте без да бъдете следени + Разглеждайте без да сте следени - Пазете вашите данни само ваши. %s ви предпазва от много от най-разпространените проследявания, които следват вашите действия онлайн. + Пазете вашите данни лични. %s ви предпазва от най-разпространените проследявания, които дебнат действията ви онлайн. Научете повече + + Стандартна (подразбиране) + + Спира малко проследявания. Страниците зареждат нормално. + + Строга + + Спира повече проследявания, реклами и изскачащи прозорци. Страниците зареждат по-бързо, но може да не работят. + + По избор + + Изберете какво проследяване и кои скриптове да спрете. + + + Бисквитки + + Проследяване в различни сайтове и социални медии + + Бисквитки от непосетени страници + + Всички бисквитки от трети страни (може наруши работата на страници) + + Всички бисквитки (ще наруши работата на страници) + + Проследяващо съдържание + + Във всички раздели + + Само в поверителни раздели + + Добиване на криптовалути + + Снемане на цифров отпечатък + + Разрешено + + Проследяване от социални мрежи + + Ограничава възможността социалните мрежи да проследяват вашата активност в Мрежата. + + Бисквитки за следене в различни сайтове + + Спира бисквитки, които компаниите за реклама и анализ използват за събиране на ваши данни от посещения в множество страници. + + Добиване на криптовалути + + Предотвратява зловредни скриптове, придобиващи достъп до устройството ви, с цел добив на цифрова валута. + + Снемане на цифров отпечатък + + Предотвратява събирането на уникални данни за обратно установяване, които могат да бъдат използвани за проследяване. + + Проследяващо съдържание + + Спира зареждането на външни реклами, видео и друго съдържание, съдържащо проследяващ код. Може да засегне някои страници. + + Всеки път, когато щитът е лилав, %s е спрял проследяване на сайт. Докоснете за повече информация. + + Защитите са ВКЛЮЧЕНИ за този сайт + + Защитите са ИЗКЛЮЧЕНИ за този сайт + + Подобрената защита от проследяване е изключена за тези сайтове Връщане назад + + %s | библиотеки с отворен код + + + Поддръжка + + Политика на поверителност + + Знайте правата си + + Лицензна информация + + Използвани библиотеки + + Меню за отстраняване на грешки: %1$d оставащи натискания до включване + Меню за отстраняване на грешки включено + + + 1 раздел + + %d раздела + + + + Копиране + + Поставяне и посещаване + + Поставяне + + Адресът е копиран в системния буфер + + + Добавяне към началния екран + + Отказ + + Добавяне + + Към страницата + + Име на пряк път + + + Регистрации и пароли + + Запазване на регистрации и пароли + + Питане за запазване + + Никога + + Автоматично попълване + + Синхронизиране на регистрации + + Включено + + Изключено + + Повторно свързване + + Вписване в Sync + + Запазени регистрации + + Тук се показват нещата, които запазвате или синхронизирате във %s. Научете повече за Sync. + + Изключения + + Тук се показват регистрации и пароли, които не са запазени. + + Търсене на регистрация + + Азбучен ред + + Последно използвани + + Страница + + Потребителско име + + Парола + + Въведете отново своя PIN + + Отключете, за да видите запазените регистрации + + Връзката е незащитена. Въведените тук данни за вход могат да бъдат компрометирани. Научете повече Меню за сортиране на регистрации + + Добавяне на търсеща машина + + Промяна на търсеща машина Добавяне Запазване + + Променяне + + Премахване + + + Друга + + Име + + Низ за търсене, който да се използва + + Заменете заявката с „%s“. Пример:\nhttps://www.google.com/search?q=%s Научете повече + + Данни за търсещата машина на потребителя Препратка научете повече + + Въведете име на търсещата машина + + Търсеща машина с име „%s“ вече съществува. + + + Уверете се, че низът за търсене съвпада с примера + + Грешка при свързване с „%s“ + + %s е създадена + + %s е запазена + + %s е изтрита + + + Добре дошли в един чисто нов %s + + + + Добавете друго на устройство. + + Няма отворени раздели във Firefox на други ваши устройства. + + Вижте разделите от други ваши устройства. + + Вписване в Sync + + + Няма отворени раздели + + + Добре, разбрах + + + Премахване + + + Извлечете максимума от %s + diff --git a/app/src/main/res/values-co/strings.xml b/app/src/main/res/values-co/strings.xml index a981b1d43..99e890dae 100644 --- a/app/src/main/res/values-co/strings.xml +++ b/app/src/main/res/values-co/strings.xml @@ -1175,7 +1175,7 @@ Impiegà piuttostu un messaghju elettronicu - Createne unu per sincrunizà i vostri apparechji.]]> + Createne unu per sincrunizà Firefox trà i vostri apparechji.]]> Firefox ùn si sincruniserà più cù u vostru contu, ma ùn squasserà alcunu datu di navigazione nant’à st’apparechju. @@ -1284,7 +1284,7 @@ %s | Bibliuteche di fonte aperta - Frattighjatori da ridirezzione + Perseguitatori da ridirezzione Squasseghja i canistrelli definiti da ridirezzione ver di siti web cunnisciuti per u spiunagiu. diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 214ad30f4..b7655f1f0 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -100,7 +100,7 @@ Zobrazit možnosti - Zavřít + Ne, děkuji diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 75b8283a9..b05773c6e 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -144,6 +144,8 @@ Installer Synkroniserede faneblade + + Synkroniser igen Find på siden @@ -265,6 +267,8 @@ Åbn links i et privat faneblad Tillad skærmbilleder i privat browsing + + Hvis du tillader det, vil private faneblade også være synlige, når flere apps er åbne Tilføj genvej til privat browsing @@ -285,6 +289,8 @@ Tema Startside + + Bevægelser Tilpas @@ -319,8 +325,12 @@ Søg i browserhistorik Søg i bogmærker + + Søg i synkroniserede faneblade Kontoindstillinger + + Autofuldfør adresser Åbn links i apps @@ -456,6 +466,16 @@ Samme som enhedens tema + + + Træk for at genindlæse + + Scroll for at skjule værktøjslinje + + Stryg værktøjslinje sidelæns for at skifte faneblade + + Stryg værktøjslinje op for at åbne faneblade + Sessioner @@ -1040,6 +1060,10 @@ Begynd at synkronisere bogmærker, adgangskoder m.m. med din Firefox-konto. Læs mere + + Du er logget ind som %s i en anden version af Firefox på denne enhed. Vil du logge ind med denne konto? Ja, log mig ind @@ -1129,6 +1153,8 @@ Log in med dit kamera Brug mail i stedet + + Opret en for at synkronisere Firefox mellem enheder.]]> Firefox vil ikke længere synkronisere med din konto, men sletter ikke dine browserdata på denne enhed. @@ -1236,6 +1262,12 @@ The first parameter is the app name --> %s | OSS-biblioteker + + Sporing via omdirigeringer + + + Rydder cookies, der sættes af omdirigeringer til websteder, der er kendt for at spore deres brugere. + Hjælp @@ -1280,6 +1312,9 @@ Genvejsnavn + + Du kan nemt føje dette websted til din enheds startskærm for at have hurtig adgang til det og browse hurtigere med en app-lignende oplevelse. + Logins og adgangskoder @@ -1348,8 +1383,12 @@ Websted er kopieret til udklipsholder Kopier adgangskode + + Ryd adgangskode Kopier brugernavn + + Ryd brugernavn Kopier websted @@ -1523,6 +1562,8 @@ Grænsen for Mest besøgte websider er nået + + Fjern en webside for at erstatte den med en ny. Tryk og hold på websiden, og vælg så Fjern. Ok, forstået diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 99de91e5d..1b3a5f556 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -41,12 +41,19 @@ Αποθήκευση επιλεγμένων καρτελών στη συλλογή + + Επιλέχθηκε το "%1$s" + + Αποεπιλέχθηκε το "%1$s" Τέλος λειτουργίας πολλαπλής επιλογής Σε λειτουργία πολλαπλών επιλογών, επιλέξτε καρτέλες για αποθήκευση σε συλλογή + + Επιλέχθηκε + Το %1$s αναπτύσσεται από τη Mozilla. diff --git a/app/src/main/res/values-nn-rNO/strings.xml b/app/src/main/res/values-nn-rNO/strings.xml index 482e58a99..90a5c1126 100644 --- a/app/src/main/res/values-nn-rNO/strings.xml +++ b/app/src/main/res/values-nn-rNO/strings.xml @@ -1287,6 +1287,11 @@ The first parameter is the app name --> %s | OSS-bibliotek + + Omdirigeringssporarar + + Fjernar infokapslar stilte inn av omdirigeringar til kjende sporingsnettstadar. + Brukarstøtte diff --git a/app/src/main/res/values-oc/strings.xml b/app/src/main/res/values-oc/strings.xml index 6696940e1..b4c1555b5 100644 --- a/app/src/main/res/values-oc/strings.xml +++ b/app/src/main/res/values-oc/strings.xml @@ -77,6 +77,9 @@ Pas ara + + + Podètz configurar Firefox per dobrir automaticament los ligams dins las aplicacions. Anar als paramètres @@ -321,6 +324,8 @@ Recercar dins l’istoric de navegacion Cercar dins los marcapaginas + + Cercar dins los onglets sincronizats Paramètres del compte @@ -470,6 +475,11 @@ Desfilar per amagar la barra d’aisinas + + Cambiar d’onglet en lisant la barra d’aisinas cap las costats + + Dobrir los ligams en lisant la barra d’aisina amont + Sessions @@ -811,6 +821,8 @@ Colleccions Menú de colleccion + + Amassatz çò important per vos\nGropatz las recèrcas, los sites e onglets similars per i tornar mai tard. Seleccionar d’onglets @@ -940,6 +952,8 @@ REFUSAR Volètz vertadièrament suprimir %1$s ? + + La supression d’aqueste onglet suprimirà tota la collecion. Podètz crear colleccions novèlas quand volgatz. Suprimir %1$s ? @@ -992,6 +1006,8 @@ Suprimir las donadas de navegacion en quitant Suprimís automaticament las donadas de navegacion quand seleccionatz « Quitar » al menú principal + + Suprimís automaticament las donadas de navegacion quand seleccionatz « Quitar » al menú principal Sortir diff --git a/app/src/main/res/values-rm/strings.xml b/app/src/main/res/values-rm/strings.xml index e9b9e06a2..92ab7cfa7 100644 --- a/app/src/main/res/values-rm/strings.xml +++ b/app/src/main/res/values-rm/strings.xml @@ -1272,6 +1272,12 @@ The first parameter is the app name --> %s | Bibliotecas open source + + Fastizaders da renviament + + + Stizza cookies definids cun agid da renviaments a websites enconuschentas per fastizar. + Agid @@ -1317,6 +1323,9 @@ Num da la scursanida + + Ti pos agiuntar a moda simpla questa website al visur da partenza da tes apparat per avair access direct e navigar pli svelt, sco sch\'i fiss ina app. + Infurmaziuns d\'annunzia e pleds-clav @@ -1387,8 +1396,12 @@ Copià la pagina en l\'archiv provisoric Copiar il pled-clav + + Stizzar il pled-clav Copiar il num d\'utilisader + + Stizzar il num d\'utilisader Copiar la pagina @@ -1565,6 +1578,8 @@ Cuntanschì la limita da paginas preferidas + + Per pudair agiuntar ina nova pagina preferida stos ti l\'emprim allontanar in\'autra. Tegna smatgà la pagina e tscherna «Allontanar». OK, chapì diff --git a/app/src/main/res/values-tg/strings.xml b/app/src/main/res/values-tg/strings.xml index ffeb619d1..77fa83df4 100644 --- a/app/src/main/res/values-tg/strings.xml +++ b/app/src/main/res/values-tg/strings.xml @@ -246,8 +246,14 @@ Баррасии махфӣ Кушодани пайвандҳо дар варақаи махфӣ + + Илова кардани миёнбури тамошои махфӣ Қобилияти дастрасӣ + + Сервери ҳисоби фармоишии Firefox + + Сервери ҳамоҳангсозии фармоишӣ Ҳисоб @@ -276,6 +282,8 @@ Огоҳиномаи махфият Абзорҳои барномасозӣ + + Ислоҳкунии дурдасти хатоҳо тавассути USB Намоиш додани низомҳои ҷустуҷӯӣ @@ -696,6 +704,8 @@ Огоҳинома + + Дархости иҷозат Бояд манъ карда шавад @@ -721,6 +731,30 @@ Маҷмӯаҳо Менюи маҷмӯаҳо + + Варақаҳоро интихоб намоед + + Интихоб кардани маҷмӯа + + Номи маҷмӯа + + Илова кардани маҷмӯаи нав + + Ҳамаро интихоб кардан + + Варақаҳоро барои нигоҳ доштан интихоб намоед + + %d варақа интихоб карда шуд + + %d варақа интихоб карда шуд + + Варақаҳо нигоҳ дошта шудад! + + Маҷмӯа нигоҳ дошта шуд! + + Варақа нигоҳ дошта шуд! Пӯшидан @@ -753,9 +787,16 @@ Барои ҳамоҳангсозӣ аз нав пайваст шавед Офлайн + + Пайваст кардани дастгоҳи дигар Фаҳмо + + Фиристодан ба дастгоҳ + + Ягон дастгоҳ пайваст нашуд + Ҷаласаи баррасии махфӣ @@ -835,6 +876,9 @@ Нест кардани маълумоти баррасӣ ҳангоми баромад + + Баромадан + Бекор кардан @@ -844,14 +888,29 @@ Хуш омадед ба %s! + + Бо %s шинос шавед + + Бинед, ки чӣ нав аст Маълумоти бештар + + Ҳа, маро ворид кунед + + Ворид шуда истодааст… + + Ба Firefox ворид шавед Ҳамоҳангсозӣ фаъол аст Воридшавӣ иҷро нашуд Махфияти худкор + + Стандартӣ (пешфарз) + + Реҷаи тамошои махфӣ Кушодани танзимот @@ -884,6 +943,8 @@ Ирсол ғайриимкон аст АЗ НАВ КӮШИШ КАРДАН + + Ворид шудан ба воситаи камера Қатъ кардани пайваст @@ -926,6 +987,10 @@ Хонандаи изи ангушт Муҳтавои пайгирикунанда + + Муҳофизат барои ин сомона фаъол аст + + Муҳофизат барои ин сомона ғайрифаъол аст Ҳуқуқҳои шумо @@ -1054,6 +1119,9 @@ Ном (А-Я) + + Истифодашудаи охирин + Илова кардани низоми ҷустуҷӯӣ @@ -1076,6 +1144,8 @@ Пайванди «Маълумоти бештар» + + Сатри ҷустуҷӯро ворид кунед %s эҷод карда шуд @@ -1083,6 +1153,8 @@ %s нест карда шуд + + %s нав шуда истодааст... Оғоз кардани %s @@ -1103,10 +1175,21 @@ Пайвасти боэътимод Пайвасти беэътимод + + Шумо мутмаин ҳастед, ки мехоҳед ҳамаи иҷозатҳоро дар ҳамаи сомонаҳо тоза намоед? + + Шумо мутмаин ҳастед, ки мехоҳед ҳамаи иҷозатҳоро барои сомонаи ҷорӣ тоза намоед? + + Шумо мутмаин ҳастед, ки мехоҳед ин иҷозатҳоро барои сомонаи ҷорӣ тоза намоед? Мақолаҳои беҳтарин + + Шумо мутмаин ҳастед, ки мехоҳед ин хатбаракро нест намоед? Илова кардан ба сомонаҳои беҳтарин + + Тасдиқ аз ҷониби: %1$s Нест кардан @@ -1142,6 +1225,8 @@ Лутфан, санҷиши ҳаққониятро аз нав такрор кунед Лутфан ҳамоҳангсозии варақаҳоро фаъол кунед. + + Барои ҳамоҳангсозӣ ворид шавед Ягон варақаи кушодашуда нест From e74a12b4420cbc375f45039e6bbf36b8a72b945f Mon Sep 17 00:00:00 2001 From: Jocelyne <38375996+joc-a@users.noreply.github.com> Date: Thu, 1 Oct 2020 23:10:33 +0300 Subject: [PATCH 10/24] For #15471: Show Delete button in red in multi-select overflow menu (#15576) --- .../mozilla/fenix/library/bookmarks/BookmarkFragment.kt | 7 +++++++ .../org/mozilla/fenix/library/history/HistoryFragment.kt | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt index f976a39fa..974551b44 100644 --- a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt @@ -6,6 +6,7 @@ package org.mozilla.fenix.library.bookmarks import android.content.DialogInterface import android.os.Bundle +import android.text.SpannableString import android.view.LayoutInflater import android.view.Menu import android.view.MenuInflater @@ -49,6 +50,7 @@ import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.minus import org.mozilla.fenix.ext.nav import org.mozilla.fenix.ext.requireComponents +import org.mozilla.fenix.ext.setTextColor import org.mozilla.fenix.ext.toShortUrl import org.mozilla.fenix.library.LibraryPageFragment import org.mozilla.fenix.utils.allowUndo @@ -185,6 +187,11 @@ class BookmarkFragment : LibraryPageFragment(), UserInteractionHan inflater.inflate(R.menu.bookmarks_select_multi_not_item, menu) } else { inflater.inflate(R.menu.bookmarks_select_multi, menu) + + menu.findItem(R.id.delete_bookmarks_multi_select).title = + SpannableString(getString(R.string.bookmark_menu_delete_button)).apply { + setTextColor(requireContext(), R.attr.destructive) + } } } } diff --git a/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt b/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt index a158eecc9..ee4f50180 100644 --- a/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt @@ -8,6 +8,7 @@ import android.content.ClipboardManager import android.content.Context.CLIPBOARD_SERVICE import android.content.DialogInterface import android.os.Bundle +import android.text.SpannableString import android.view.LayoutInflater import android.view.Menu import android.view.MenuInflater @@ -42,6 +43,7 @@ import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.nav import org.mozilla.fenix.ext.requireComponents +import org.mozilla.fenix.ext.setTextColor import org.mozilla.fenix.ext.showToolbar import org.mozilla.fenix.ext.toShortUrl import org.mozilla.fenix.library.LibraryPageFragment @@ -166,7 +168,13 @@ class HistoryFragment : LibraryPageFragment(), UserInteractionHandl } inflater.inflate(menuRes, menu) + menu.findItem(R.id.share_history_multi_select)?.isVisible = true + + menu.findItem(R.id.delete_history_multi_select)?.title = + SpannableString(getString(R.string.bookmark_menu_delete_button)).apply { + setTextColor(requireContext(), R.attr.destructive) + } } override fun onOptionsItemSelected(item: MenuItem): Boolean = when (item.itemId) { From a173749ad8ae65a705ed091ea6931d09890fa330 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Tue, 29 Sep 2020 14:18:18 -0700 Subject: [PATCH 11/24] No issue: document list_compatible_dependency_versions script in README. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2dfe98c8f..ddd5bbf62 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,10 @@ Once these flags are set, your Fenix builds will include any local modifications See a [demo of auto-publication workflow in action](https://www.youtube.com/watch?v=qZKlBzVvQGc). +In order to build successfully, you need to check out a commit in the dependency repository that has no breaking changes. The two best ways to do this are: +- Run the `/tools/list_compatible_dependency_versions.py` script to output a compatible commit +- Check out the latest commit from master in this repository and the dependency repository. However, this may fail if there were breaking changes added recently to the dependency. + ### GeckoView Specify a relative path to your local `mozilla-central` checkout via `dependencySubstitutions.geckoviewTopsrcdir`, and optional a path to m-c object directory via `dependencySubstitutions.geckoviewTopobjdir`. @@ -213,6 +217,8 @@ and optional a path to m-c object directory via `dependencySubstitutions.geckovi If these are configured, local builds of GeckoView will be used instead of what's configured in Dependencies.kt. For more details, see https://firefox-source-docs.mozilla.org/mobile/android/geckoview/contributor/geckoview-quick-start.html#include-geckoview-as-a-dependency +See notes on building successfully in the `android-components` auto-publication section. + ## License From a19a63db196f6d0e7b178a82d002b057bcde793b Mon Sep 17 00:00:00 2001 From: MickeyMoz Date: Thu, 1 Oct 2020 20:41:07 +0000 Subject: [PATCH 12/24] Update Android Components version to 62.0.20201001194334. --- buildSrc/src/main/java/AndroidComponents.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/AndroidComponents.kt b/buildSrc/src/main/java/AndroidComponents.kt index 0d7401dd0..ca387e10a 100644 --- a/buildSrc/src/main/java/AndroidComponents.kt +++ b/buildSrc/src/main/java/AndroidComponents.kt @@ -3,5 +3,5 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ object AndroidComponents { - const val VERSION = "61.0.20200925190057" + const val VERSION = "62.0.20201001194334" } From 41a92a8d8b316446e21a2fc8a6eadec43e6f4799 Mon Sep 17 00:00:00 2001 From: Jeff Boek Date: Thu, 1 Oct 2020 12:04:22 -0700 Subject: [PATCH 13/24] For #15593 - Reverts back to simple UUID creation without Fenix side caching --- .../org/mozilla/fenix/components/Analytics.kt | 9 +--- .../mozilla/fenix/components/Components.kt | 2 +- .../metrics/LeanplumMetricsService.kt | 33 ++---------- .../fenix/components/TestComponents.kt | 2 +- .../metrics/LeanplumMetricsServiceTest.kt | 51 ------------------- 5 files changed, 7 insertions(+), 90 deletions(-) delete mode 100644 app/src/test/java/org/mozilla/fenix/components/metrics/LeanplumMetricsServiceTest.kt diff --git a/app/src/main/java/org/mozilla/fenix/components/Analytics.kt b/app/src/main/java/org/mozilla/fenix/components/Analytics.kt index 9f9bd201b..120a27ac1 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Analytics.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Analytics.kt @@ -18,7 +18,6 @@ import org.mozilla.fenix.Config import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R import org.mozilla.fenix.ReleaseChannel -import org.mozilla.fenix.StrictModeManager import org.mozilla.fenix.components.metrics.AdjustMetricsService import org.mozilla.fenix.components.metrics.GleanMetricsService import org.mozilla.fenix.components.metrics.LeanplumMetricsService @@ -35,8 +34,7 @@ import org.mozilla.geckoview.BuildConfig.MOZ_UPDATE_CHANNEL */ @Mockable class Analytics( - private val context: Context, - strictMode: StrictModeManager + private val context: Context ) { val crashReporter: CrashReporter by lazy { val services = mutableListOf() @@ -86,10 +84,7 @@ class Analytics( ) } - val leanplumMetricsService by lazy { LeanplumMetricsService( - context as Application, - strictMode - ) } + val leanplumMetricsService by lazy { LeanplumMetricsService(context as Application) } val metrics: MetricController by lazy { MetricController.create( diff --git a/app/src/main/java/org/mozilla/fenix/components/Components.kt b/app/src/main/java/org/mozilla/fenix/components/Components.kt index 92b9d97d0..cbd96e20e 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Components.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Components.kt @@ -125,7 +125,7 @@ class Components(private val context: Context) { AddonManager(core.store, core.engine, addonCollectionProvider, addonUpdater) } - val analytics by lazy { Analytics(context, strictMode) } + val analytics by lazy { Analytics(context) } val publicSuffixList by lazy { PublicSuffixList(context) } val clipboardHandler by lazy { ClipboardHandler(context) } val migrationStore by lazy { MigrationStore() } diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt index fab3b956c..79526cd92 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt @@ -5,11 +5,8 @@ package org.mozilla.fenix.components.metrics import android.app.Application -import android.content.Context.MODE_PRIVATE import android.net.Uri -import android.os.StrictMode import android.util.Log -import androidx.annotation.VisibleForTesting import com.leanplum.Leanplum import com.leanplum.LeanplumActivityHelper import com.leanplum.annotations.Parser @@ -22,7 +19,6 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import mozilla.components.support.locale.LocaleManager import org.mozilla.fenix.BuildConfig -import org.mozilla.fenix.StrictModeManager import org.mozilla.fenix.components.metrics.MozillaProductDetector.MozillaProducts import org.mozilla.fenix.ext.settings import org.mozilla.fenix.home.intent.DeepLinkIntentProcessor @@ -57,9 +53,7 @@ private val Event.name: String? } class LeanplumMetricsService( - private val application: Application, - strictMode: StrictModeManager, - private val deviceIdGenerator: () -> String = { randomUUID().toString() } + private val application: Application ) : MetricsService, DeepLinkIntentProcessor.DeepLinkVerifier { val scope = CoroutineScope(Dispatchers.IO) var leanplumJob: Job? = null @@ -84,32 +78,14 @@ class LeanplumMetricsService( override val type = MetricServiceType.Marketing private val token = Token(LeanplumId, LeanplumToken) - private val preferences = strictMode.resetAfter(StrictMode.allowThreadDiskReads()) { - 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 - } - @Suppress("ComplexMethod") override fun start() { if (!application.settings().isMarketingTelemetryEnabled) return - Log.i(LOGTAG, "Starting Leanplum with device id: $deviceId") - Leanplum.setIsTestModeEnabled(false) Leanplum.setApplicationContext(application) - Leanplum.setDeviceId(deviceId) + Leanplum.setDeviceId(randomUUID().toString()) Parser.parseVariables(application) leanplumJob = scope.launch { @@ -189,10 +165,7 @@ class LeanplumMetricsService( // We compare the local Leanplum device ID against the "uid" query parameter and only // accept deep links where both values match. val uid = deepLink.getQueryParameter("uid") - if (uid != deviceId) { - Log.i(LOGTAG, "Rejecting Leanplum deep link because uid $uid does not match $deviceId") - } - return uid == deviceId + return uid == Leanplum.getDeviceId() } override fun stop() { diff --git a/app/src/test/java/org/mozilla/fenix/components/TestComponents.kt b/app/src/test/java/org/mozilla/fenix/components/TestComponents.kt index a2d1f92c5..1d31eaf56 100644 --- a/app/src/test/java/org/mozilla/fenix/components/TestComponents.kt +++ b/app/src/test/java/org/mozilla/fenix/components/TestComponents.kt @@ -28,7 +28,7 @@ class TestComponents(private val context: Context) : Components(context) { ) } override val intentProcessors by lazy { mockk(relaxed = true) } - override val analytics by lazy { Analytics(context, strictMode) } + override val analytics by lazy { Analytics(context) } override val clipboardHandler by lazy { ClipboardHandler(context) } diff --git a/app/src/test/java/org/mozilla/fenix/components/metrics/LeanplumMetricsServiceTest.kt b/app/src/test/java/org/mozilla/fenix/components/metrics/LeanplumMetricsServiceTest.kt deleted file mode 100644 index ea0e90302..000000000 --- a/app/src/test/java/org/mozilla/fenix/components/metrics/LeanplumMetricsServiceTest.kt +++ /dev/null @@ -1,51 +0,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.components.metrics - -import android.content.Context.MODE_PRIVATE -import io.mockk.mockk -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, - mockk(relaxed = true), - idGenerator - ) - assertEquals("TEST_DEVICE_ID", leanplumMetricService.deviceId) - - val leanplumMetricService2 = LeanplumMetricsService( - testContext.application, - mockk(relaxed = true), - idGenerator - ) - assertEquals("TEST_DEVICE_ID", leanplumMetricService2.deviceId) - assertEquals(1, callCount) - - assertEquals("TEST_DEVICE_ID", sharedPreferences.getString("LP_DEVICE_ID", "")) - } -} From 57805b82a88ce147a1faf1754fb39219f5a3c33b Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Thu, 1 Oct 2020 14:37:55 -0700 Subject: [PATCH 14/24] No issue: run detekt on unit test files. detekt still passes after I make this change. afaik, there isn't a good reason not to run it on unit tests and it can be valuable to add custom rules for them. Also, detekt is already running on our androidTest directory. --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2a04c2b0b..1d4706748 100644 --- a/build.gradle +++ b/build.gradle @@ -179,7 +179,6 @@ tasks.register('ktlint', JavaExec) { tasks.withType(io.gitlab.arturbosch.detekt.Detekt.class).configureEach { exclude("**/resources/**") - exclude("**/test/**") exclude("**/tmp/**") } From f690f8736da409f875e29c7f9064eeeb311c9c5e Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Thu, 1 Oct 2020 14:40:50 -0700 Subject: [PATCH 15/24] No issue: replace LintUnitTestRunner with detekt implementation. This should be more performant and easier to maintain. --- app/build.gradle | 3 - .../fenix/gradle/tasks/LintUnitTestRunner.kt | 108 ------------------ config/detekt.yml | 2 + .../detektrules/CustomRulesetProvider.kt | 3 +- .../MozillaCorrectUnitTestRunner.kt | 76 ++++++++++++ 5 files changed, 80 insertions(+), 112 deletions(-) delete mode 100644 buildSrc/src/main/java/org/mozilla/fenix/gradle/tasks/LintUnitTestRunner.kt create mode 100644 mozilla-detekt-rules/src/main/java/org/mozilla/fenix/detektrules/MozillaCorrectUnitTestRunner.kt diff --git a/app/build.gradle b/app/build.gradle index 88c9a8b72..01f050d80 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,7 +14,6 @@ import com.android.build.OutputFile import groovy.json.JsonOutput import org.gradle.internal.logging.text.StyledTextOutput.Style import org.gradle.internal.logging.text.StyledTextOutputFactory -import org.mozilla.fenix.gradle.tasks.LintUnitTestRunner import static org.gradle.api.tasks.testing.TestResult.ResultType @@ -581,8 +580,6 @@ task buildTranslationArray { android.defaultConfig.buildConfigField "String[]", "SUPPORTED_LOCALE_ARRAY", foundLocalesString } -tasks.register('lintUnitTestRunner', LintUnitTestRunner) - afterEvaluate { // Format test output. Ported from AC #2401 diff --git a/buildSrc/src/main/java/org/mozilla/fenix/gradle/tasks/LintUnitTestRunner.kt b/buildSrc/src/main/java/org/mozilla/fenix/gradle/tasks/LintUnitTestRunner.kt deleted file mode 100644 index 0082d361f..000000000 --- a/buildSrc/src/main/java/org/mozilla/fenix/gradle/tasks/LintUnitTestRunner.kt +++ /dev/null @@ -1,108 +0,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.gradle.tasks - -import org.gradle.api.DefaultTask -import org.gradle.api.GradleException -import org.gradle.api.tasks.TaskAction -import org.gradle.api.tasks.TaskExecutionException -import java.io.File - -private val INVALID_TEST_RUNNERS = setOf( - // When updating this list, also update the violation message. - "AndroidJUnit4", - "RobolectricTestRunner" -) - -/** - * A lint check that ensures unit tests do not specify an invalid test runner. See the error message - * and the suggested replacement class' kdoc for details. - * - * Performance note: AS indicates this task takes 50ms-100ms to run. This isn't too concerning because - * it's one task and it only runs for unit test compilation. However, if we add additional lint checks, - * we should considering aggregating them - e.g. this task reads the unit test file tree and we can - * combine all of our tasks such that the file tree only needs to be read once - or finding more - * optimal solutions - e.g. only running on changed files. - */ -open class LintUnitTestRunner : DefaultTask() { - init { - group = "Verification" - description = "Ensures unit tests do not specify an invalid test runner" - attachToCompilationTasks() - } - - private fun attachToCompilationTasks() { - project.gradle.projectsEvaluated { project.tasks.let { tasks -> - // We make compile tasks, rather than assemble tasks, depend on us because some tools, - // such as AS' test runner, call the compile task directly rather than going through assemble. - val compileUnitTestTasks = tasks.filter { - it.name.startsWith("compile") && it.name.contains("UnitTest") - } - compileUnitTestTasks.forEach { it.dependsOn(this@LintUnitTestRunner) } - - // To return feedback as early as possible, we run before all compile tasks including - // compiling the application. - val compileAllTasks = tasks.filter { it.name.startsWith("compile") } - compileAllTasks.forEach { it.mustRunAfter(this@LintUnitTestRunner) } - } } - } - - @TaskAction - fun lint() { - val unitTestDir = File(project.projectDir, "/src/test") - check(unitTestDir.exists()) { - "Error in task impl: expected test directory - ${unitTestDir.absolutePath} - to exist" - } - - val unitTestDirFileWalk = unitTestDir.walk().onEnter { true /* enter all dirs */ }.asSequence() - val kotlinFileWalk = unitTestDirFileWalk.filter { it.name.endsWith(".kt") && it.isFile } - check(kotlinFileWalk.count() > 0) { "Error in task impl: expected to walk > 0 test files" } - - val violatingFiles = kotlinFileWalk.filter { file -> - file.useLines { lines -> lines.any(::isLineInViolation) } - }.sorted().toList() - - if (violatingFiles.isNotEmpty()) { - throwViolation(violatingFiles) - } - } - - private fun isLineInViolation(line: String): Boolean { - val trimmed = line.trimStart() - return INVALID_TEST_RUNNERS.any { invalid -> - trimmed.startsWith("@RunWith($invalid::class)") - } - } - - private fun throwViolation(files: List) { - val failureHeader = """Lint failure: saw unexpected unit test runners. The following code blocks: - | - | @RunWith(AndroidJUnit4::class) - | @Config(application = TestApplication::class) - |OR - | @RunWith(RobolectricTestRunner::class) - | @Config(application = TestApplication::class) - | - |should be replaced with: - | - | @RunWith(FenixRobolectricTestRunner::class) - | - |To reduce redundancy of setting @Config. No @Config specification is necessary because - |the FenixRobolectricTestRunner sets it automatically. - | - |Relatedly, adding robolectric to a test increases its runtime non-trivially so please - |ensure Robolectric is necessary before adding it. - | - |The following files were found to be in violation: - """.trimMargin() - - val filesInViolation = files.map { - " ${it.relativeTo(project.rootDir)}" - } - - val errorMsg = (listOf(failureHeader) + filesInViolation).joinToString("\n") - throw TaskExecutionException(this, GradleException(errorMsg)) - } -} diff --git a/config/detekt.yml b/config/detekt.yml index 2568a929e..180847b99 100644 --- a/config/detekt.yml +++ b/config/detekt.yml @@ -112,6 +112,8 @@ mozilla-detekt-rules: # with the debuggable flag or not. Use a check for different build variants, # instead. bannedProperties: "BuildConfig.DEBUG" + MozillaCorrectUnitTestRunner: + active: true empty-blocks: active: true diff --git a/mozilla-detekt-rules/src/main/java/org/mozilla/fenix/detektrules/CustomRulesetProvider.kt b/mozilla-detekt-rules/src/main/java/org/mozilla/fenix/detektrules/CustomRulesetProvider.kt index 7899a60b3..1a4c0f67e 100644 --- a/mozilla-detekt-rules/src/main/java/org/mozilla/fenix/detektrules/CustomRulesetProvider.kt +++ b/mozilla-detekt-rules/src/main/java/org/mozilla/fenix/detektrules/CustomRulesetProvider.kt @@ -14,7 +14,8 @@ class CustomRulesetProvider : RuleSetProvider { override fun instance(config: Config): RuleSet = RuleSet( ruleSetId, listOf( - MozillaBannedPropertyAccess(config) + MozillaBannedPropertyAccess(config), + MozillaCorrectUnitTestRunner(config) ) ) } diff --git a/mozilla-detekt-rules/src/main/java/org/mozilla/fenix/detektrules/MozillaCorrectUnitTestRunner.kt b/mozilla-detekt-rules/src/main/java/org/mozilla/fenix/detektrules/MozillaCorrectUnitTestRunner.kt new file mode 100644 index 000000000..25834076b --- /dev/null +++ b/mozilla-detekt-rules/src/main/java/org/mozilla/fenix/detektrules/MozillaCorrectUnitTestRunner.kt @@ -0,0 +1,76 @@ +/* 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.detektrules + +import io.gitlab.arturbosch.detekt.api.CodeSmell +import io.gitlab.arturbosch.detekt.api.Config +import io.gitlab.arturbosch.detekt.api.Debt +import io.gitlab.arturbosch.detekt.api.Entity +import io.gitlab.arturbosch.detekt.api.Issue +import io.gitlab.arturbosch.detekt.api.Rule +import io.gitlab.arturbosch.detekt.api.Severity +import io.gitlab.arturbosch.detekt.api.internal.PathFilters +import org.jetbrains.kotlin.psi.KtAnnotationEntry + +private val BANNED_TEST_RUNNERS = setOf( + // When updating this list, also update the violation message. + "AndroidJUnit4", + "RobolectricTestRunner" +) + +// There is a change to how we output violations in a different PR so the formatting for message +// might be weird but it should still be readable. +private val VIOLATION_MSG = """The following code blocks: + | + | @RunWith(AndroidJUnit4::class) + | @Config(application = TestApplication::class) + | OR + | @RunWith(RobolectricTestRunner::class) + | @Config(application = TestApplication::class) + | + | should be replaced with: + | + | @RunWith(FenixRobolectricTestRunner::class) + | + | To reduce redundancy of setting @Config. No @Config specification is necessary because + | the FenixRobolectricTestRunner sets it automatically. + | + | Relatedly, adding robolectric to a test increases its runtime non-trivially so please + | ensure Robolectric is necessary before adding it.""".trimMargin() + +/** + * Ensures we're using the correct Robolectric unit test runner. + */ +class MozillaCorrectUnitTestRunner(config: Config) : Rule(config) { + override val issue = Issue( + MozillaCorrectUnitTestRunner::class.simpleName!!, + Severity.Defect, + "Verifies we're using the correct Robolectric unit test runner", + Debt.FIVE_MINS + ) + + override val filters: PathFilters? + get() = PathFilters.of( + includes = listOf("**/test/**"), // unit tests only. + excludes = emptyList() + ) + + override fun visitAnnotationEntry(annotationEntry: KtAnnotationEntry) { + super.visitAnnotationEntry(annotationEntry) + + // Example of an annotation: @RunWith(FenixRobolectricUnitTestRunner::class) + val annotationClassName = annotationEntry.shortName?.identifier + if (annotationClassName == "RunWith") { + // Example arg in parens: "(FenixRobolectricUnitTestRunner::class)" + val argInParens = annotationEntry.lastChild.node.chars + val argClassName = argInParens.substring(1 until argInParens.indexOf(":")) + + val isInViolation = BANNED_TEST_RUNNERS.any { it == argClassName } + if (isInViolation) { + report(CodeSmell(issue, Entity.from(annotationEntry), VIOLATION_MSG)) + } + } + } +} From 0154c81f816b1f7c16082394cde7a06ca16abeaf Mon Sep 17 00:00:00 2001 From: Jocelyne <38375996+joc-a@users.noreply.github.com> Date: Fri, 2 Oct 2020 02:42:50 +0300 Subject: [PATCH 16/24] For #10107: Show Today and Yesterday labels in History (#15415) --- .../java/org/mozilla/fenix/ui/robots/HistoryRobot.kt | 6 +++--- .../mozilla/fenix/library/history/HistoryAdapter.kt | 11 ++++++++--- app/src/main/res/values/strings.xml | 4 ++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/HistoryRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/HistoryRobot.kt index 85cfd7fe9..72d62ec06 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/HistoryRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/HistoryRobot.kt @@ -42,7 +42,7 @@ class HistoryRobot { fun verifyVisitedTimeTitle() { mDevice.waitNotNull( Until.findObject( - By.text("Last 24 hours") + By.text("Today") ), waitingTime ) @@ -99,7 +99,7 @@ class HistoryRobot { } fun openThreeDotMenu(interact: ThreeDotMenuHistoryItemRobot.() -> Unit): - ThreeDotMenuHistoryItemRobot.Transition { + ThreeDotMenuHistoryItemRobot.Transition { threeDotMenu().click() @@ -143,7 +143,7 @@ private fun assertEmptyHistoryView() = .check(matches(withText("No history here"))) private fun assertVisitedTimeTitle() = - onView(withId(R.id.header_title)).check(matches(withText("Last 24 hours"))) + onView(withId(R.id.header_title)).check(matches(withText("Today"))) private fun assertTestPageTitle(title: String) = testPageTitle() .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) diff --git a/app/src/main/java/org/mozilla/fenix/library/history/HistoryAdapter.kt b/app/src/main/java/org/mozilla/fenix/library/history/HistoryAdapter.kt index 7a0b33b1a..e82bac914 100644 --- a/app/src/main/java/org/mozilla/fenix/library/history/HistoryAdapter.kt +++ b/app/src/main/java/org/mozilla/fenix/library/history/HistoryAdapter.kt @@ -17,10 +17,11 @@ import java.util.Calendar import java.util.Date enum class HistoryItemTimeGroup { - Today, ThisWeek, ThisMonth, Older; + Today, Yesterday, ThisWeek, ThisMonth, Older; fun humanReadable(context: Context): String = when (this) { - Today -> context.getString(R.string.history_24_hours) + Today -> context.getString(R.string.history_today) + Yesterday -> context.getString(R.string.history_yesterday) ThisWeek -> context.getString(R.string.history_7_days) ThisMonth -> context.getString(R.string.history_30_days) Older -> context.getString(R.string.history_older) @@ -81,11 +82,14 @@ class HistoryAdapter(private val historyInteractor: HistoryInteractor) : companion object { private const val zeroDays = 0 + private const val oneDay = 1 private const val sevenDays = 7 private const val thirtyDays = 30 - private val oneDayAgo = getDaysAgo(zeroDays).time + private val zeroDaysAgo = getDaysAgo(zeroDays).time + private val oneDayAgo = getDaysAgo(oneDay).time private val sevenDaysAgo = getDaysAgo(sevenDays).time private val thirtyDaysAgo = getDaysAgo(thirtyDays).time + private val yesterdayRange = LongRange(oneDayAgo, zeroDaysAgo) private val lastWeekRange = LongRange(sevenDaysAgo, oneDayAgo) private val lastMonthRange = LongRange(thirtyDaysAgo, sevenDaysAgo) @@ -99,6 +103,7 @@ class HistoryAdapter(private val historyInteractor: HistoryInteractor) : private fun timeGroupForHistoryItem(item: HistoryItem): HistoryItemTimeGroup { return when { DateUtils.isToday(item.visitedAt) -> HistoryItemTimeGroup.Today + yesterdayRange.contains(item.visitedAt) -> HistoryItemTimeGroup.Yesterday lastWeekRange.contains(item.visitedAt) -> HistoryItemTimeGroup.ThisWeek lastMonthRange.contains(item.visitedAt) -> HistoryItemTimeGroup.ThisMonth else -> HistoryItemTimeGroup.Older diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1465e3623..2d744301e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -643,6 +643,10 @@ Delete %1$d items + + Today + + Yesterday Last 24 hours From f3b7e294bef46228524debd2a5e149b4a360167f Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Thu, 1 Oct 2020 16:28:29 -0700 Subject: [PATCH 17/24] No issue: remove * ac from codeowners. rocketsroger and I agreed this may be undesireable due to the increased notifications. If we remove it and someone complains, we can re-add it. --- .github/CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 81aa72d6d..eca56c92a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -21,9 +21,9 @@ # the paths you specify in .gitignore: # http://www.benjaminoakes.com/git/2018/08/10/Testing-changes-to-GitHub-CODEOWNERS/ -# By default the Android Components team will be the owner for everything in +# By default the fenix team will be the owner for everything in # the repo. Unless a later match takes precedence. -* @mozilla-mobile/ACT @mozilla-mobile/fenix +* @mozilla-mobile/fenix /.cron.yml @mozilla-mobile/releng @mozilla-mobile/fenix /.taskcluster.yml @mozilla-mobile/releng @mozilla-mobile/fenix /automation/ @mozilla-mobile/releng @mozilla-mobile/fenix From ee4a5283a48d5f37d5d5a33f65368a9638f844c0 Mon Sep 17 00:00:00 2001 From: Mozilla L10n Automation Bot Date: Fri, 2 Oct 2020 00:01:13 +0000 Subject: [PATCH 18/24] Import l10n. --- app/src/main/res/values-cs/strings.xml | 13 +++++++++++++ app/src/main/res/values-es-rAR/strings.xml | 6 +++--- app/src/main/res/values-es/strings.xml | 8 ++++++++ app/src/main/res/values-nl/strings.xml | 6 +++--- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index b7655f1f0..080b9118b 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -146,6 +146,8 @@ Nainstalovat Synchronizované panely + + Synchronizovat znovu Najít na stránce @@ -272,6 +274,8 @@ Otevírat odkazy v anonymních panelech Povolit pořizování snímků obrazovky v anonymním prohlížení + + Pokud toto povolíte, obsah panelů bude viditelný i v zobrazení otevřených aplikací Vytvořit zkratku pro anonymní prohlížení @@ -328,6 +332,8 @@ Našeptávat z historie prohlížení Našeptávat ze záložek + + Hledat v synchronizovaných panelech Nastavení účtu @@ -1172,6 +1178,8 @@ Přihlásit se pomocí fotoaparátu Použít raději e-mail + + Vytvořte si ho a synchronizujte svůj Firefox mezi zařízeními.]]> Firefox ukončí synchronizaci s vaším účtem, ale nesmaže z tohoto zařízení žádná vaše data. @@ -1279,6 +1287,11 @@ The first parameter is the app name --> %s | OSS knihovny + + Sledující přesměrování + + Maže cookies nastavené během přesměrování známými sledujícími servery. + Podpora diff --git a/app/src/main/res/values-es-rAR/strings.xml b/app/src/main/res/values-es-rAR/strings.xml index 455e69cda..51c50aca5 100644 --- a/app/src/main/res/values-es-rAR/strings.xml +++ b/app/src/main/res/values-es-rAR/strings.xml @@ -813,7 +813,7 @@ Activado - Desactivado + Desactivada Permitir audio y video @@ -828,7 +828,7 @@ Activado - Desactivado + Desactivada @@ -1220,7 +1220,7 @@ Qué es lo que está bloqueado por la protección de rastreo estricta - Personalizado + Personalizada Elegí qué rastreadores y secuencias de comandos querés bloquear. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index b6458f1d8..1c5f7efa1 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -72,6 +72,8 @@ Descartar + + Se necesita acceso a la cámara. Ve a los ajustes de Android, toca en permisos y luego en permitir. Ir a ajustes @@ -255,6 +257,8 @@ Abrir enlaces en una pestaña privada Permitir capturas de pantalla en navegación privada + + Si está permitido, las pestañas privadas también serán visibles cuando hayan varias aplicaciones abiertas Agregar acceso directo a la navegación privada @@ -545,6 +549,8 @@ Compartir todas las pestañas Pestañas cerradas recientemente + + Ajustes de pestañas Cerrar todas las pestañas @@ -1562,6 +1568,8 @@ Límite de sitios frecuentes alcanzado + + Para añadir un nuevo sitio frecuente, elimina uno. Toca y mantén presionado el sitio y selecciona eliminar. Vale, entendido diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index a3d93449d..1d3a8850d 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -481,11 +481,11 @@ Trek om te vernieuwen - Scroll om de werkbalk te verbergen + Scrollen om de werkbalk te verbergen - Veeg de werkbalk opzij om van tabblad te wisselen + De werkbalk opzij vegen om van tabblad te wisselen - Veeg de werkbalk omhoog om tabbladen te openen + De werkbalk omhoog vegen om tabbladen te openen From b696fc4c4b06da58b2b8e50334d286d4ffedfb0e Mon Sep 17 00:00:00 2001 From: mcarare Date: Fri, 2 Oct 2020 13:39:41 +0300 Subject: [PATCH 19/24] For #13031: Show size in KB for smaller downloaded files. --- .../java/org/mozilla/fenix/downloads/DynamicDownloadDialog.kt | 4 ++-- .../downloads/viewholders/DownloadsListItemViewHolder.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/downloads/DynamicDownloadDialog.kt b/app/src/main/java/org/mozilla/fenix/downloads/DynamicDownloadDialog.kt index 826a477e6..be571cc84 100644 --- a/app/src/main/java/org/mozilla/fenix/downloads/DynamicDownloadDialog.kt +++ b/app/src/main/java/org/mozilla/fenix/downloads/DynamicDownloadDialog.kt @@ -11,7 +11,7 @@ import kotlinx.android.extensions.LayoutContainer import kotlinx.android.synthetic.main.download_dialog_layout.view.* import mozilla.components.browser.state.state.content.DownloadState import mozilla.components.feature.downloads.AbstractFetchDownloadService -import mozilla.components.feature.downloads.toMegabyteString +import mozilla.components.feature.downloads.toMegabyteOrKilobyteString import org.mozilla.fenix.R import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.ext.metrics @@ -86,7 +86,7 @@ class DynamicDownloadDialog( } else { val titleText = container.context.getString( R.string.mozac_feature_downloads_completed_notification_text2 - ) + " (${downloadState.contentLength?.toMegabyteString()})" + ) + " (${downloadState.contentLength?.toMegabyteOrKilobyteString()})" view.download_dialog_title.text = titleText diff --git a/app/src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt b/app/src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt index c367ca674..c5f6bbbbd 100644 --- a/app/src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt +++ b/app/src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt @@ -8,12 +8,12 @@ import android.view.View import androidx.recyclerview.widget.RecyclerView import kotlinx.android.synthetic.main.download_list_item.view.* import kotlinx.android.synthetic.main.library_site_item.view.* +import mozilla.components.feature.downloads.toMegabyteOrKilobyteString import org.mozilla.fenix.R import org.mozilla.fenix.ext.hideAndDisable import org.mozilla.fenix.library.SelectionHolder import org.mozilla.fenix.library.downloads.DownloadInteractor import org.mozilla.fenix.library.downloads.DownloadItem -import mozilla.components.feature.downloads.toMegabyteString import org.mozilla.fenix.ext.getIcon class DownloadsListItemViewHolder( @@ -29,7 +29,7 @@ class DownloadsListItemViewHolder( ) { itemView.download_layout.visibility = View.VISIBLE itemView.download_layout.titleView.text = item.fileName - itemView.download_layout.urlView.text = item.size.toLong().toMegabyteString() + itemView.download_layout.urlView.text = item.size.toLong().toMegabyteOrKilobyteString() itemView.download_layout.setSelectionInteractor(item, selectionHolder, downloadInteractor) itemView.download_layout.changeSelected(item in selectionHolder.selectedItems) From 01eedd159a4588065e1bc4e2ca8082ed27cadd6c Mon Sep 17 00:00:00 2001 From: ekager Date: Thu, 1 Oct 2020 14:13:46 -0700 Subject: [PATCH 20/24] No issue: Update biometric, core, and recyclerview libraries --- .../settings/logins/fragment/SavedLoginsAuthFragment.kt | 6 ++++-- buildSrc/src/main/java/Dependencies.kt | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsAuthFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsAuthFragment.kt index 4246beccd..9a2d70b6b 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsAuthFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsAuthFragment.kt @@ -16,6 +16,8 @@ import android.provider.Settings.ACTION_SECURITY_SETTINGS import android.util.Log import androidx.appcompat.app.AlertDialog import androidx.biometric.BiometricManager +import androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_WEAK +import androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL import androidx.biometric.BiometricPrompt import androidx.core.content.ContextCompat import androidx.core.content.getSystemService @@ -98,7 +100,7 @@ class SavedLoginsAuthFragment : PreferenceFragmentCompat() { promptInfo = BiometricPrompt.PromptInfo.Builder() .setTitle(getString(R.string.logins_biometric_prompt_message)) - .setDeviceCredentialAllowed(true) + .setAllowedAuthenticators(BIOMETRIC_WEAK or DEVICE_CREDENTIAL) .build() } @@ -154,7 +156,7 @@ class SavedLoginsAuthFragment : PreferenceFragmentCompat() { private fun canUseBiometricPrompt(context: Context): Boolean { return if (SDK_INT >= M) { val manager = BiometricManager.from(context) - val canAuthenticate = manager.canAuthenticate() + val canAuthenticate = manager.canAuthenticate(BIOMETRIC_WEAK) val hardwareUnavailable = canAuthenticate == BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE || canAuthenticate == BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index 6daeba32e..175af04e9 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -13,7 +13,7 @@ object Versions { const val detekt = "1.9.1" const val androidx_appcompat = "1.2.0-rc01" - const val androidx_biometric = "1.1.0-alpha01" + const val androidx_biometric = "1.1.0-beta01" const val androidx_coordinator_layout = "1.1.0-rc01" const val androidx_constraint_layout = "2.0.0" const val androidx_preference = "1.1.0" @@ -22,8 +22,8 @@ object Versions { const val androidx_lifecycle = "2.2.0" const val androidx_fragment = "1.2.5" const val androidx_navigation = "2.3.0" - const val androidx_recyclerview = "1.2.0-alpha05" - const val androidx_core = "1.2.0" + const val androidx_recyclerview = "1.2.0-alpha06" + const val androidx_core = "1.3.2" const val androidx_paging = "2.1.0" const val androidx_transition = "1.3.0" const val androidx_work = "2.2.0" From edcdac5402922339b0b9c37c60ebd25ab8fc5fe9 Mon Sep 17 00:00:00 2001 From: MickeyMoz Date: Fri, 2 Oct 2020 15:32:58 +0000 Subject: [PATCH 21/24] Update Android Components version to 62.0.20201002143132. --- buildSrc/src/main/java/AndroidComponents.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/AndroidComponents.kt b/buildSrc/src/main/java/AndroidComponents.kt index ca387e10a..f1fa81fce 100644 --- a/buildSrc/src/main/java/AndroidComponents.kt +++ b/buildSrc/src/main/java/AndroidComponents.kt @@ -3,5 +3,5 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ object AndroidComponents { - const val VERSION = "62.0.20201001194334" + const val VERSION = "62.0.20201002143132" } From 01d982d4b2371e75c307b53045e67653b90cdf23 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Thu, 1 Oct 2020 16:18:03 -0700 Subject: [PATCH 22/24] No issue: add custom lint guide to readme. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ddd5bbf62..3eea0f8a1 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Please read the [Community Participation Guidelines](https://www.mozilla.org/en- * [#android-tips:mozilla.org channel](https://chat.mozilla.org/#/room/#android-tips:mozilla.org): for tips on Android development * Check out the [project wiki](https://github.com/mozilla-mobile/fenix/wiki) for more information. + * See [our guide on Writing Custom Lint Rules](https://github.com/mozilla-mobile/shared-docs/blob/master/android/writing_lint_rules.md). * Localization happens on [Pontoon](https://pontoon.mozilla.org/projects/android-l10n/). Please get in touch with delphine (at) mozilla (dot) com directly for more information. From 450caf1e428ce5f8e69f503857600a56f53a0bc6 Mon Sep 17 00:00:00 2001 From: Roger Yang Date: Fri, 2 Oct 2020 13:08:15 -0400 Subject: [PATCH 23/24] Revert "No issue: remove * ac from codeowners." (#15638) This reverts commit f3b7e294bef46228524debd2a5e149b4a360167f. --- .github/CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index eca56c92a..81aa72d6d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -21,9 +21,9 @@ # the paths you specify in .gitignore: # http://www.benjaminoakes.com/git/2018/08/10/Testing-changes-to-GitHub-CODEOWNERS/ -# By default the fenix team will be the owner for everything in +# By default the Android Components team will be the owner for everything in # the repo. Unless a later match takes precedence. -* @mozilla-mobile/fenix +* @mozilla-mobile/ACT @mozilla-mobile/fenix /.cron.yml @mozilla-mobile/releng @mozilla-mobile/fenix /.taskcluster.yml @mozilla-mobile/releng @mozilla-mobile/fenix /automation/ @mozilla-mobile/releng @mozilla-mobile/fenix From ec3595d4fc0eae94f3bf262aa97060099bb254f0 Mon Sep 17 00:00:00 2001 From: ekager Date: Thu, 1 Oct 2020 12:19:20 -0700 Subject: [PATCH 24/24] For #15600 - Move removal of timed out sessions to immediately after restoration --- .../java/org/mozilla/fenix/HomeActivity.kt | 11 -------- .../java/org/mozilla/fenix/components/Core.kt | 25 +++++++++++++++---- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt index 333fb7ba5..e73f6a8e5 100644 --- a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt @@ -32,7 +32,6 @@ import kotlinx.android.synthetic.main.activity_home.* import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers.IO -import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.Job import kotlinx.coroutines.delay @@ -281,16 +280,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { } settings().wasDefaultBrowserOnLastResume = settings().isDefaultBrowser() - - if (!settings().manuallyCloseTabs) { - val toClose = components.core.store.state.tabs.filter { - (System.currentTimeMillis() - it.lastAccess) > settings().getTabTimeout() - } - // Removal needs to happen on the main thread. - lifecycleScope.launch(Main) { - toClose.forEach { components.useCases.tabsUseCases.removeTab(it.id) } - } - } } } diff --git a/app/src/main/java/org/mozilla/fenix/components/Core.kt b/app/src/main/java/org/mozilla/fenix/components/Core.kt index 69033a78d..4d76715be 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Core.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Core.kt @@ -77,6 +77,7 @@ import java.util.concurrent.TimeUnit * Component group for all core browser functionality. */ @Mockable +@Suppress("LargeClass") class Core( private val context: Context, private val crashReporter: CrashReporting, @@ -218,6 +219,18 @@ class Core( .periodicallyInForeground(interval = 30, unit = TimeUnit.SECONDS) .whenGoingToBackground() .whenSessionsChange() + + // Now that we have restored our previous state (if there's one) let's remove timed out tabs + if (!context.settings().manuallyCloseTabs) { + store.state.tabs.filter { + (System.currentTimeMillis() - it.lastAccess) > context.settings().getTabTimeout() + }.forEach { + val session = sessionManager.findSessionById(it.id) + if (session != null) { + sessionManager.remove(session) + } + } + } } WebNotificationFeature( @@ -272,11 +285,13 @@ class Core( val bookmarksStorage by lazy { lazyBookmarksStorage.value } val passwordsStorage by lazy { lazyPasswordsStorage.value } - val tabCollectionStorage by lazy { TabCollectionStorage( - context, - sessionManager, - strictMode - ) } + val tabCollectionStorage by lazy { + TabCollectionStorage( + context, + sessionManager, + strictMode + ) + } /** * A storage component for persisting thumbnail images of tabs.