Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android
Commits:
-
87e8fea1
by clairehurst at 2024-01-31T16:12:55-07:00
10 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
- fenix/app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt
- fenix/app/src/main/java/org/mozilla/fenix/components/TorBrowserFeatures.kt
- fenix/app/src/main/java/org/mozilla/fenix/settings/TorNetworkSettingsFragment.kt
- fenix/app/src/main/java/org/mozilla/fenix/tor/TorBootstrapStatus.kt
- fenix/app/src/main/java/org/mozilla/fenix/tor/TorController.kt
- fenix/app/src/main/java/org/mozilla/fenix/tor/TorControllerGV.kt
- fenix/app/src/main/java/org/mozilla/fenix/tor/TorControllerTAS.kt
- fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapConnectViewHolder.kt
- fenix/app/src/main/java/org/mozilla/fenix/tor/view/TorBootstrapLoggerViewHolder.kt
Changes:
... | ... | @@ -685,7 +685,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity, TorIn |
685 | 685 | }
|
686 | 686 | override fun onTorConnecting() { /* no-op */ }
|
687 | 687 | override fun onTorStopped() { /* no-op */ }
|
688 | - override fun onTorStatusUpdate(entry: String?, status: String?) { /* no-op */ }
|
|
688 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) { /* no-op */ }
|
|
689 | 689 | })
|
690 | 690 | return
|
691 | 691 | }
|
... | ... | @@ -59,7 +59,7 @@ class IntentReceiverActivity : Activity() { |
59 | 59 | }
|
60 | 60 | override fun onTorConnecting() { /* no-op */ }
|
61 | 61 | override fun onTorStopped() { /* no-op */ }
|
62 | - override fun onTorStatusUpdate(entry: String?, status: String?) { /* no-op */ }
|
|
62 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) { /* no-op */ }
|
|
63 | 63 | })
|
64 | 64 | |
65 | 65 | // In the meantime, open the HomeActivity so the user can get connected.
|
... | ... | @@ -164,7 +164,7 @@ object TorBrowserFeatures { |
164 | 164 | }
|
165 | 165 | |
166 | 166 | @SuppressWarnings("EmptyFunctionBlock")
|
167 | - override fun onTorStatusUpdate(entry: String?, status: String?) {
|
|
167 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) {
|
|
168 | 168 | }
|
169 | 169 | })
|
170 | 170 | }
|
... | ... | @@ -166,7 +166,7 @@ class TorNetworkSettingsFragment : PreferenceFragmentCompat(), TorEvents { |
166 | 166 | override fun onTorStopped() {
|
167 | 167 | }
|
168 | 168 | |
169 | - override fun onTorStatusUpdate(entry: String?, status: String?) {
|
|
169 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) {
|
|
170 | 170 | setStatus()
|
171 | 171 | }
|
172 | 172 | } |
... | ... | @@ -34,7 +34,7 @@ class TorBootstrapStatus( |
34 | 34 | }
|
35 | 35 | |
36 | 36 | @SuppressWarnings("EmptyFunctionBlock")
|
37 | - override fun onTorStatusUpdate(entry: String?, status: String?) {
|
|
37 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) {
|
|
38 | 38 | }
|
39 | 39 | |
40 | 40 | fun unregisterTorListener() {
|
... | ... | @@ -9,7 +9,7 @@ import androidx.lifecycle.LifecycleCoroutineScope |
9 | 9 | interface TorEvents {
|
10 | 10 | fun onTorConnecting()
|
11 | 11 | fun onTorConnected()
|
12 | - fun onTorStatusUpdate(entry: String?, status: String?)
|
|
12 | + fun onTorStatusUpdate(entry: String?, status: String?, progress: Double? = 0.0)
|
|
13 | 13 | fun onTorStopped()
|
14 | 14 | }
|
15 | 15 | |
... | ... | @@ -55,7 +55,7 @@ interface TorController: TorEvents { |
55 | 55 | |
56 | 56 | override fun onTorConnecting()
|
57 | 57 | override fun onTorConnected()
|
58 | - override fun onTorStatusUpdate(entry: String?, status: String?)
|
|
58 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?)
|
|
59 | 59 | override fun onTorStopped()
|
60 | 60 | |
61 | 61 | fun registerTorListener(l: TorEvents)
|
... | ... | @@ -155,9 +155,9 @@ class TorControllerGV( |
155 | 155 | }
|
156 | 156 | |
157 | 157 | // TorEvents
|
158 | - override fun onTorStatusUpdate(entry: String?, status: String?) {
|
|
158 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) {
|
|
159 | 159 | synchronized(torListeners) {
|
160 | - torListeners.toList().forEach { it.onTorStatusUpdate(entry, status) }
|
|
160 | + torListeners.toList().forEach { it.onTorStatusUpdate(entry, status, progress) }
|
|
161 | 161 | }
|
162 | 162 | }
|
163 | 163 | |
... | ... | @@ -221,7 +221,7 @@ class TorControllerGV( |
221 | 221 | // and state for firefox-android (designed for tor-android-service)
|
222 | 222 | // fun onTorConnecting()
|
223 | 223 | // fun onTorConnected()
|
224 | - // fun onTorStatusUpdate(entry: String?, status: String?)
|
|
224 | + // fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?)
|
|
225 | 225 | // fun onTorStopped()
|
226 | 226 | |
227 | 227 | // TorEventsBootstrapStateChangeListener
|
... | ... | @@ -268,7 +268,7 @@ class TorControllerGV( |
268 | 268 | |
269 | 269 | }
|
270 | 270 | entries.add(Pair(status, lastKnownStatus.toTorStatus().status))
|
271 | - onTorStatusUpdate(status, lastKnownStatus.toTorStatus().status)
|
|
271 | + onTorStatusUpdate(status, lastKnownStatus.toTorStatus().status, progress)
|
|
272 | 272 | }
|
273 | 273 | |
274 | 274 | // TorEventsBootstrapStateChangeListener
|
... | ... | @@ -170,7 +170,7 @@ class TorControllerTAS (private val context: Context): TorController { |
170 | 170 | handlePendingRegistrationChanges()
|
171 | 171 | }
|
172 | 172 | |
173 | - override fun onTorStatusUpdate(entry: String?, status: String?) {
|
|
173 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) {
|
|
174 | 174 | lockTorListenersMutation = true
|
175 | 175 | torListeners.forEach { it.onTorStatusUpdate(entry, status) }
|
176 | 176 | lockTorListenersMutation = false
|
... | ... | @@ -92,7 +92,7 @@ class TorBootstrapConnectViewHolder( |
92 | 92 | override fun onTorStopped() {
|
93 | 93 | }
|
94 | 94 | |
95 | - override fun onTorStatusUpdate(entry: String?, status: String?) {
|
|
95 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) {
|
|
96 | 96 | if (entry == null) return
|
97 | 97 | |
98 | 98 | binding.torBootstrapStatusMessage.text = entry
|
... | ... | @@ -103,7 +103,7 @@ class TorBootstrapConnectViewHolder( |
103 | 103 | percentIdx
|
104 | 104 | )
|
105 | 105 | with(binding.torBootstrapProgress) {
|
106 | - progress = percent.toInt()
|
|
106 | + this.progress = percent.toInt()
|
|
107 | 107 | }
|
108 | 108 | }
|
109 | 109 | }
|
... | ... | @@ -55,7 +55,7 @@ class TorBootstrapLoggerViewHolder( |
55 | 55 | override fun onTorStopped() {
|
56 | 56 | }
|
57 | 57 | |
58 | - override fun onTorStatusUpdate(entry: String?, status: String?) {
|
|
58 | + override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) {
|
|
59 | 59 | if (status == null || entry == null) return
|
60 | 60 | if (status == "ON" && entry.startsWith("Circuit")) return
|
61 | 61 |