public abstract class PresenceConstant extends EventsController implements PresenceHelper, PresenceResourceProvider
If the addon is based on encounters with the user and not able to conclude constant presence from the information, it should pass not extend this class, if not (for example if it monitors wifi) it can. They can just fire the Presence-Event on encountering. It is expected that addons extending this class are pretty sure that the user is around and not a random person.
| Constructor and Description |
|---|
PresenceConstant(Context context,
String ID,
boolean strict,
PresenceIndicatorLevel level) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
controlEvents(EventModel eventModel)
Controls whether the fired Event should be dispatched to all the listeners.
|
PresenceIndicatorLevel |
getLevel()
gets the PresenceIndicatorLevel of the addon (mainly used for communication between presence-providing addons)
|
boolean |
isFirstEncountering()
returns true if the user is first encountered in the current mode
|
boolean |
isKnown()
whether it is known that the user caused the presence
|
boolean |
isPresent()
returns true if the user might be/is present
|
boolean |
isStrict()
true if the addon can guarantee that the user is around, false if not
|
void |
setGlobalPresent(boolean present)
when this method is called the present-status was changed
|
void |
setGlobalStrictPresent(boolean present)
when this method is called, the strict-present status was changed
|
void |
setPresence(boolean present)
sets the presence
|
controlEventDispatchergetContext, getIDclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfireLeaving, firePresence, firePresencefire, fire, fire, fire, fireannounceResources, createPresenceResource, generateResourceannounceEvents, provideResource, resourcesIniteventFiredgetIsPresent, nonStrictAvailabledebug, debug, error, error, fatal, fatal, warn, warnexceptionThrownpublic PresenceConstant(Context context, String ID, boolean strict, PresenceIndicatorLevel level)
context - the contextID - the IDstrict - whether it is strict (very high probability that the user is around)level - the levelpublic boolean controlEvents(EventModel eventModel)
controlEvents in class EventsControllereventModel - the Eventpublic boolean isStrict()
isStrict in interface PresenceProviderpublic boolean isKnown()
isKnown in interface PresenceProviderpublic PresenceIndicatorLevel getLevel()
getLevel in interface PresenceProviderpublic boolean isPresent()
isPresent in interface PresenceProviderpublic void setGlobalPresent(boolean present)
setGlobalPresent in interface PresenceProviderpresent - true if present, false if notpublic boolean isFirstEncountering()
isFirstEncountering in interface PresenceProviderpublic void setGlobalStrictPresent(boolean present)
setGlobalStrictPresent in interface PresenceProviderpresent - true if present, false if notpublic void setPresence(boolean present)
present - true for presence, false if notCopyright © 2016. All rights reserved.