@NotThreadSafe public final class Condition extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Condition.ConditionResult |
Constructor and Description |
---|
Condition(Context context,
Plugin plugin)
Constructs a new plug-in setting.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys the plug-in condition, freeing up resources that were used to
perform queries to the plug-in.
|
int |
query(Bundle pluginBundle,
int previousState)
Performs a blocking query to the plug-in condition.
|
int |
query(PluginInstanceData data,
int previousState)
Performs a blocking query to the plug-in condition.
|
@Slow(value=SECONDS) public int query(PluginInstanceData data, int previousState)
data
- The plug-in's instance data previously saved by the Edit Activity.previousState
- The previous query result of the plug-in, to be set as the initial
result code
when querying the plug-in. This must be one of RESULT_CONDITION_SATISFIED
,
RESULT_CONDITION_UNSATISFIED
, or
RESULT_CONDITION_UNKNOWN
.
Plug-in implementations might use this
previous result code for hysteresis. If no previous state is
available,
pass RESULT_CONDITION_UNKNOWN
.RESULT_CONDITION_SATISFIED
,
RESULT_CONDITION_UNSATISFIED
, or
RESULT_CONDITION_UNKNOWN
.@Slow(value=SECONDS) public int query(Bundle pluginBundle, int previousState)
pluginBundle
- The plug-in's instance data previously saved by the Edit Activity.previousState
- The previous query result of the plug-in, to be set as the initial
result code
when querying the plug-in. This must be one of RESULT_CONDITION_SATISFIED
,
RESULT_CONDITION_UNSATISFIED
, or
RESULT_CONDITION_UNKNOWN
.
Plug-in implementations might use this
previous result code for hysteresis. If no previous state is
available,
pass RESULT_CONDITION_UNKNOWN
.RESULT_CONDITION_SATISFIED
,
RESULT_CONDITION_UNSATISFIED
, or
RESULT_CONDITION_UNKNOWN
.public void destroy()
query(PluginInstanceData,
int)
}
cannot be called.