Dan Ballard pushed to branch tor-browser-128.8.0esr-14.5-1 at The Tor Project / Applications / Tor Browser

Commits:

3 changed files:

Changes:

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
    ... ... @@ -158,8 +158,6 @@ import org.mozilla.fenix.search.toolbar.SearchSelectorMenu
    158 158
     import org.mozilla.fenix.tabstray.Page
    
    159 159
     import org.mozilla.fenix.tabstray.TabsTrayAccessPoint
    
    160 160
     import org.mozilla.fenix.theme.FirefoxTheme
    
    161
    -import org.mozilla.fenix.tor.TorBootstrapFragmentDirections
    
    162
    -import org.mozilla.fenix.tor.TorBootstrapStatus
    
    163 161
     import org.mozilla.fenix.tor.TorConnectionAssistViewModel
    
    164 162
     import org.mozilla.fenix.utils.Settings.Companion.TOP_SITES_PROVIDER_MAX_THRESHOLD
    
    165 163
     import org.mozilla.fenix.utils.allowUndo
    
    ... ... @@ -262,7 +260,6 @@ class HomeFragment : Fragment(), UserInteractionHandler {
    262 260
         private val bottomToolbarContainerIntegration = ViewBoundFeatureWrapper<BottomToolbarContainerIntegration>()
    
    263 261
     
    
    264 262
         private lateinit var savedLoginsLauncher: ActivityResultLauncher<Intent>
    
    265
    -    private lateinit var torBootstrapStatus: TorBootstrapStatus
    
    266 263
     
    
    267 264
         override fun onCreate(savedInstanceState: Bundle?) {
    
    268 265
             // DO NOT ADD ANYTHING ABOVE THIS getProfilerTime CALL!
    
    ... ... @@ -295,12 +292,6 @@ class HomeFragment : Fragment(), UserInteractionHandler {
    295 292
             val activity = activity as HomeActivity
    
    296 293
             val components = requireComponents
    
    297 294
     
    
    298
    -        torBootstrapStatus = TorBootstrapStatus(
    
    299
    -            !BuildConfig.DISABLE_TOR,
    
    300
    -            components.torController,
    
    301
    -            ::dispatchModeChanges
    
    302
    -        )
    
    303
    -
    
    304 295
             val currentWallpaperName = requireContext().settings().currentWallpaperName
    
    305 296
             applyWallpaper(
    
    306 297
                 wallpaperName = currentWallpaperName,
    
    ... ... @@ -1037,7 +1028,6 @@ class HomeFragment : Fragment(), UserInteractionHandler {
    1037 1028
         override fun onStop() {
    
    1038 1029
             dismissRecommendPrivateBrowsingShortcut()
    
    1039 1030
             super.onStop()
    
    1040
    -        torBootstrapStatus.unregisterTorListener()
    
    1041 1031
         }
    
    1042 1032
     
    
    1043 1033
         override fun onStart() {
    
    ... ... @@ -1090,15 +1080,6 @@ class HomeFragment : Fragment(), UserInteractionHandler {
    1090 1080
             }
    
    1091 1081
         }
    
    1092 1082
     
    
    1093
    -    private fun dispatchModeChanges(isBootstrapping: Boolean) {
    
    1094
    -        if (isBootstrapping) {
    
    1095
    -            val directions =
    
    1096
    -                TorBootstrapFragmentDirections
    
    1097
    -                    .actionStartupTorbootstrap()
    
    1098
    -            findNavController().navigate(directions)
    
    1099
    -        }
    
    1100
    -    }
    
    1101
    -
    
    1102 1083
         @VisibleForTesting
    
    1103 1084
         internal fun removeCollectionWithUndo(tabCollection: TabCollection) {
    
    1104 1085
             val snackbarMessage = getString(R.string.snackbar_collection_deleted)
    
    ... ... @@ -1122,7 +1103,6 @@ class HomeFragment : Fragment(), UserInteractionHandler {
    1122 1103
     
    
    1123 1104
         override fun onResume() {
    
    1124 1105
             super.onResume()
    
    1125
    -        torBootstrapStatus.registerTorListener()
    
    1126 1106
             if (browsingModeManager.mode == BrowsingMode.Private) {
    
    1127 1107
                 activity?.window?.setBackgroundDrawableResource(R.drawable.private_home_background_gradient)
    
    1128 1108
             }
    

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorBootstrapStatus.kt deleted
    1
    -/* This Source Code Form is subject to the terms of the Mozilla Public
    
    2
    - * License, v. 2.0. If a copy of the MPL was not distributed with this
    
    3
    - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    
    4
    -
    
    5
    -package org.mozilla.fenix.tor
    
    6
    -
    
    7
    -@SuppressWarnings("LongParameterList", "TooManyFunctions")
    
    8
    -class TorBootstrapStatus(
    
    9
    -        private val shouldStartTor: Boolean,
    
    10
    -        private val torController: TorController,
    
    11
    -        private val dispatchModeChanges: (isShouldBootstrap: Boolean) -> Unit
    
    12
    -    ) : TorEvents {
    
    13
    -
    
    14
    -        init {
    
    15
    -            torController.registerTorListener(this)
    
    16
    -        }
    
    17
    -
    
    18
    -        fun isBootstrapping() = (shouldStartTor && !torController.isBootstrapped)
    
    19
    -
    
    20
    -
    
    21
    -        @SuppressWarnings("EmptyFunctionBlock")
    
    22
    -        override fun onTorConnecting() {
    
    23
    -        }
    
    24
    -
    
    25
    -        override fun onTorConnected() {
    
    26
    -            dispatchModeChanges(isBootstrapping())
    
    27
    -        }
    
    28
    -
    
    29
    -        override fun onTorStopped() {
    
    30
    -            dispatchModeChanges(isBootstrapping())
    
    31
    -        }
    
    32
    -
    
    33
    -        @SuppressWarnings("EmptyFunctionBlock")
    
    34
    -        override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) {
    
    35
    -        }
    
    36
    -
    
    37
    -        fun unregisterTorListener() {
    
    38
    -            torController.unregisterTorListener(this)
    
    39
    -        }
    
    40
    -
    
    41
    -    fun registerTorListener() {
    
    42
    -        torController.registerTorListener(this)
    
    43
    -    }
    
    44
    -
    
    45
    -}

  • mobile/android/fenix/app/src/main/res/navigation/nav_graph.xml
    ... ... @@ -15,12 +15,6 @@
    15 15
             app:popUpTo="@id/startupFragment"
    
    16 16
             app:popUpToInclusive="true" />
    
    17 17
     
    
    18
    -    <action
    
    19
    -        android:id="@+id/action_startup_torbootstrap"
    
    20
    -        app:destination="@id/torbootstrapFragment"
    
    21
    -        app:popUpTo="@id/startupFragment"
    
    22
    -        app:popUpToInclusive="true" />
    
    23
    -
    
    24 18
         <action
    
    25 19
             android:id="@+id/action_startup_tor_connection_assist"
    
    26 20
             app:destination="@+id/torConnectionAssistFragment"
    
    ... ... @@ -248,25 +242,6 @@
    248 242
                 app:popExitAnim="@anim/slide_out_right" />
    
    249 243
         </fragment>
    
    250 244
     
    
    251
    -    <fragment
    
    252
    -        android:id="@+id/torbootstrapFragment"
    
    253
    -        android:name="org.mozilla.fenix.tor.TorBootstrapFragment"
    
    254
    -        tools:layout="@layout/fragment_home">
    
    255
    -
    
    256
    -        <action
    
    257
    -            android:id="@+id/action_home"
    
    258
    -            app:destination="@id/homeFragment"
    
    259
    -            app:popUpTo="@id/torbootstrapFragment"
    
    260
    -            app:popUpToInclusive="true" />
    
    261
    -        <action
    
    262
    -            android:id="@+id/action_torbootstrapFragment_to_SettingsFragment"
    
    263
    -            app:destination="@id/settingsFragment"
    
    264
    -            app:enterAnim="@anim/slide_in_right"
    
    265
    -            app:exitAnim="@anim/slide_out_left"
    
    266
    -            app:popEnterAnim="@anim/slide_in_left"
    
    267
    -            app:popExitAnim="@anim/slide_out_right" />
    
    268
    -    </fragment>
    
    269
    -
    
    270 245
         <fragment
    
    271 246
             android:id="@+id/torConnectionAssistFragment"
    
    272 247
             android:name="org.mozilla.fenix.tor.TorConnectionAssistFragment"