Verified Commit c8971a8e authored by clairehurst's avatar clairehurst 🌱 Committed by ma1
Browse files

fixup! TB 41878: [android] Add standalone Tor Bootstrap

parent 57f68dda
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -139,8 +139,6 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
        isDeviceRamAboveThreshold()
    }

    var terminating = false

    open val components by lazy { Components(this) }

    var visibilityLifecycleCallback: VisibilityLifecycleCallback? = null
@@ -190,21 +188,6 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
        }
    }

    fun isTerminating() = terminating

    fun terminate() {
        onTerminate()
        System.exit(0)
    }

    override fun onTerminate() {
        terminating = true

        super.onTerminate()
        components.torController.stop()
        components.torController.stopTor()
    }

    @OptIn(DelicateCoroutinesApi::class) // GlobalScope usage
    @VisibleForTesting
    protected open fun initializeGlean() {
+0 −9
Original line number Diff line number Diff line
@@ -705,15 +705,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
        if (this !is ExternalAppBrowserActivity && !activityStartedWithLink) {
            stopMediaSession()
        }

        if (isFinishing && !(application as FenixApplication).isTerminating()) {
            // We assume the Activity is being destroyed because the user
            // swiped away the app on the Recent screen. When this happens,
            // we assume the user expects the entire Application is destroyed
            // and not only the top Activity/Task. Therefore we kill the
            // underlying Application, as well.
            (application as FenixApplication).terminate()
        }
    }

    final override fun onConfigurationChanged(newConfig: Configuration) {