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
|
controlEventDispatcher
getContext, getID
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fireLeaving, firePresence, firePresence
fire, fire, fire, fire, fire
announceResources, createPresenceResource, generateResource
announceEvents, provideResource, resourcesInit
eventFired
getIsPresent, nonStrictAvailable
debug, debug, error, error, fatal, fatal, warn, warn
exceptionThrown
public 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 EventsController
eventModel
- the Eventpublic boolean isStrict()
isStrict
in interface PresenceProvider
public boolean isKnown()
isKnown
in interface PresenceProvider
public PresenceIndicatorLevel getLevel()
getLevel
in interface PresenceProvider
public boolean isPresent()
isPresent
in interface PresenceProvider
public void setGlobalPresent(boolean present)
setGlobalPresent
in interface PresenceProvider
present
- true if present, false if notpublic boolean isFirstEncountering()
isFirstEncountering
in interface PresenceProvider
public void setGlobalStrictPresent(boolean present)
setGlobalStrictPresent
in interface PresenceProvider
present
- true if present, false if notpublic void setPresence(boolean present)
present
- true for presence, false if notCopyright © 2016. All rights reserved.