mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Make REASON_USER into a generic reason code.
This commit is contained in:
@@ -11,6 +11,6 @@ public interface BluetoothConstants {
|
||||
|
||||
String PREF_BT_ENABLE = "enable";
|
||||
|
||||
int REASON_USER = 1;
|
||||
// Reason code returned by Plugin#getReasonDisabled()
|
||||
int REASON_NO_BT_ADAPTER = 2;
|
||||
}
|
||||
|
||||
@@ -35,12 +35,18 @@ public interface Plugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code returned by {@link #getReasonDisabled()} ()} to indicate
|
||||
* that the plugin is disabled because it has not been started or has been
|
||||
* Reason code returned by {@link #getReasonDisabled()} to indicate that
|
||||
* the plugin is disabled because it has not been started or has been
|
||||
* stopped.
|
||||
*/
|
||||
int REASON_STARTING_STOPPING = 0;
|
||||
|
||||
/**
|
||||
* Reason code returned by {@link #getReasonDisabled()} to indicate that
|
||||
* the plugin has been disabled by the user.
|
||||
*/
|
||||
int REASON_USER = 1;
|
||||
|
||||
/**
|
||||
* Returns the plugin's transport identifier.
|
||||
*/
|
||||
@@ -75,9 +81,9 @@ public interface Plugin {
|
||||
* Returns an integer code indicating why the plugin is
|
||||
* {@link State#DISABLED disabled}, or -1 if the plugin is not disabled.
|
||||
* <p>
|
||||
* The codes used are plugin-specific, except the generic code
|
||||
* {@link #REASON_STARTING_STOPPING}, which may be used by
|
||||
* any plugin.
|
||||
* The codes used are plugin-specific, except the generic codes
|
||||
* {@link #REASON_STARTING_STOPPING} and {@link #REASON_USER}, which may
|
||||
* be used by any plugin.
|
||||
*/
|
||||
int getReasonDisabled();
|
||||
|
||||
|
||||
@@ -3,6 +3,4 @@ package org.briarproject.bramble.api.plugin;
|
||||
public interface TcpConstants {
|
||||
|
||||
String PREF_TCP_ENABLE = "enable";
|
||||
|
||||
int REASON_USER = 1;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public interface TorConstants {
|
||||
int PREF_TOR_NETWORK_WITH_BRIDGES = 2;
|
||||
int PREF_TOR_NETWORK_NEVER = 3;
|
||||
|
||||
int REASON_USER = 1;
|
||||
// Reason codes returned by Plugin#getReasonDisabled()
|
||||
int REASON_BATTERY = 2;
|
||||
int REASON_MOBILE_DATA = 3;
|
||||
int REASON_COUNTRY_BLOCKED = 4;
|
||||
|
||||
@@ -52,7 +52,6 @@ import static org.briarproject.bramble.api.plugin.Plugin.State.ACTIVE;
|
||||
import static org.briarproject.bramble.api.plugin.Plugin.State.DISABLED;
|
||||
import static org.briarproject.bramble.api.plugin.Plugin.State.INACTIVE;
|
||||
import static org.briarproject.bramble.api.plugin.TcpConstants.PREF_TCP_ENABLE;
|
||||
import static org.briarproject.bramble.api.plugin.TcpConstants.REASON_USER;
|
||||
import static org.briarproject.bramble.util.IoUtils.tryToClose;
|
||||
import static org.briarproject.bramble.util.LogUtils.logException;
|
||||
import static org.briarproject.bramble.util.PrivacyUtils.scrubSocketAddress;
|
||||
|
||||
@@ -88,7 +88,6 @@ import static org.briarproject.bramble.api.plugin.TorConstants.PROP_ONION_V3;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.REASON_BATTERY;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.REASON_COUNTRY_BLOCKED;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.REASON_MOBILE_DATA;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.REASON_USER;
|
||||
import static org.briarproject.bramble.plugin.tor.TorRendezvousCrypto.SEED_BYTES;
|
||||
import static org.briarproject.bramble.util.IoUtils.copyAndClose;
|
||||
import static org.briarproject.bramble.util.IoUtils.tryToClose;
|
||||
|
||||
Reference in New Issue
Block a user