mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Add method for getting reason why plugin is disabled.
This commit is contained in:
@@ -34,6 +34,13 @@ public interface Plugin {
|
||||
INACTIVE
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Returns the plugin's transport identifier.
|
||||
*/
|
||||
@@ -64,6 +71,16 @@ public interface Plugin {
|
||||
*/
|
||||
State getState();
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
int getReasonDisabled();
|
||||
|
||||
/**
|
||||
* Returns true if the plugin should be polled periodically to attempt to
|
||||
* establish connections.
|
||||
|
||||
@@ -23,4 +23,8 @@ public interface TorConstants {
|
||||
int PREF_TOR_NETWORK_WITH_BRIDGES = 2;
|
||||
int PREF_TOR_NETWORK_NEVER = 3;
|
||||
|
||||
int REASON_USER = 1;
|
||||
int REASON_BATTERY = 2;
|
||||
int REASON_MOBILE_DATA = 3;
|
||||
int REASON_COUNTRY_BLOCKED = 4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user