mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Clean up several UX interactions with proxy entry.
This commit is contained in:
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.keyvalue;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.signalservice.internal.configuration.SignalProxy;
|
||||
|
||||
public final class ProxyValues extends SignalStoreValues {
|
||||
@@ -19,8 +20,11 @@ public final class ProxyValues extends SignalStoreValues {
|
||||
void onFirstEverAppLaunch() {
|
||||
}
|
||||
|
||||
|
||||
public void enableProxy(@NonNull SignalProxy proxy) {
|
||||
if (Util.isEmpty(proxy.getHost())) {
|
||||
throw new IllegalArgumentException("Empty host!");
|
||||
}
|
||||
|
||||
getStore().beginWrite()
|
||||
.putBoolean(KEY_PROXY_ENABLED, true)
|
||||
.putString(KEY_HOST, proxy.getHost())
|
||||
@@ -67,4 +71,9 @@ public final class ProxyValues extends SignalStoreValues {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public @Nullable String getProxyHost() {
|
||||
SignalProxy proxy = getProxy();
|
||||
return proxy != null ? proxy.getHost() : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user