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