Skip to main content
Sign in
Snippets Groups Projects
Commit 50a2e757 authored by Matthew Finkel's avatar Matthew Finkel
Browse files

fixup! Bug 40028: Implement Tor connect and logger screens

parent ab897368
Branches
No related tags found
1 merge request!26Bug 40041 09
......@@ -83,6 +83,7 @@ class TorBootstrapConnectViewHolder(
}
}
@SuppressWarnings("EmptyFunctionBlock")
override fun onTorConnecting() {
}
......@@ -90,32 +91,13 @@ class TorBootstrapConnectViewHolder(
components.torController.unregisterTorListener(this);
}
@SuppressWarnings("EmptyFunctionBlock")
override fun onTorStopped() {
}
override fun onTorStatusUpdate(entry: String?, status: String?) {
if (entry == null) return
if (status != null && status.startsWith("STOPPING")) {
if (entry.contains("Unable to start Tor")) {
// Only restart Tor with Debug logging once
if (components.torController.isDebugLoggingEnabled) {
with(view.tor_bootstrap_connect_button) {
text = context.resources.getString(R.string.tor_bootstrap_connecting_failed)
isEnabled = false
}
return
}
interactor.onTorStartDebugBootstrapping()
} else {
// We assume TorService is "stopping" as the result of the user cancelling bootstrap,
// such as by selecting the Tor Network Settings button
with(view.tor_bootstrap_connect_button) {
text = context.resources.getString(R.string.tor_bootstrap_connect)
}
}
}
view.tor_bootstrap_status_message.text = entry
if (entry.startsWith(BOOTSTRAPPED_PREFIX)) {
val percentIdx = entry.indexOf("%")
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment