|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.os.UEventObserver
public abstract class UEventObserver
UEventObserver is an abstract class that receives UEvent's from the kernel.
Subclass UEventObserver, implementing onUEvent(UEvent event), then call startObserving() with a match string. The UEvent thread will then call your onUEvent() method when a UEvent occurs that contains your match string.
Call stopObserving() to stop receiving UEvent's.
There is only one UEvent thread per process, even if that process has multiple UEventObserver subclass instances. The UEvent thread starts when the startObserving() is called for the first time in that process. Once started the UEvent thread will not stop (although it can stop notifying UEventObserver's via stopObserving()).
| Nested Class Summary | |
|---|---|
static class |
UEventObserver.UEvent
Representation of a UEvent. |
| Constructor Summary | |
|---|---|
UEventObserver()
|
|
| Method Summary | |
|---|---|
protected void |
finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. |
abstract void |
onUEvent(UEventObserver.UEvent event)
Subclasses of UEventObserver should override this method to handle UEvents. |
void |
startObserving(String match)
Begin observation of UEvent's. |
void |
stopObserving()
End observation of UEvent's. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UEventObserver()
| Method Detail |
|---|
public final void startObserving(String match)
This method will cause the UEvent thread to start if this is the first invocation of startObserving in this process.
Once called, the UEvent thread will call onUEvent() when an incoming UEvent matches the specified string.
This method can be called multiple times to register multiple matches. Only one call to stopObserving is required even with multiple registered matches.
match - A substring of the UEvent to match. Use "" to match all
UEvent'spublic final void stopObserving()
This process's UEvent thread will never call onUEvent() on this UEventObserver after this call. Repeated calls have no effect.
public abstract void onUEvent(UEventObserver.UEvent event)
protected void finalize()
throws Throwable
ObjectNote: The virtual machine assumes that the implementation in class Object is empty.
finalize in class ObjectThrowable - The virtual machine ignores any exceptions which are
thrown during finalization.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||