public final class InputEventConsistencyVerifier extends Object
When a problem is detected, the event is tainted. This mechanism prevents the same error from being reported multiple times.
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_RAW_DEVICE_INPUT
Indicates that the verifier is intended to act on raw device input event streams.
|
Constructor and Description |
---|
InputEventConsistencyVerifier(Object caller,
int flags)
Creates an input consistency verifier.
|
InputEventConsistencyVerifier(Object caller,
int flags,
String logTag)
Creates an input consistency verifier.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isInstrumentationEnabled()
Determines whether the instrumentation should be enabled.
|
void |
onGenericMotionEvent(MotionEvent event,
int nestingLevel)
Checks a generic motion event.
|
void |
onInputEvent(InputEvent event,
int nestingLevel)
Checks an arbitrary input event.
|
void |
onKeyEvent(KeyEvent event,
int nestingLevel)
Checks a key event.
|
void |
onTouchEvent(MotionEvent event,
int nestingLevel)
Checks a touch event.
|
void |
onTrackballEvent(MotionEvent event,
int nestingLevel)
Checks a trackball event.
|
void |
onUnhandledEvent(InputEvent event,
int nestingLevel)
Notifies the verifier that a given event was unhandled and the rest of the
trace for the event should be ignored.
|
void |
reset()
Resets the state of the input event consistency verifier.
|
public static final int FLAG_RAW_DEVICE_INPUT
public InputEventConsistencyVerifier(Object caller, int flags)
caller
- The object to which the verifier is attached.flags
- Flags to the verifier, or 0 if none.public InputEventConsistencyVerifier(Object caller, int flags, String logTag)
caller
- The object to which the verifier is attached.flags
- Flags to the verifier, or 0 if none.logTag
- Tag for logging. If null defaults to the short class name.public static boolean isInstrumentationEnabled()
public void reset()
public void onInputEvent(InputEvent event, int nestingLevel)
event
- The event.nestingLevel
- The nesting level: 0 if called from the base class,
or 1 from a subclass. If the event was already checked by this consistency verifier
at a higher nesting level, it will not be checked again. Used to handle the situation
where a subclass dispatching method delegates to its superclass's dispatching method
and both dispatching methods call into the consistency verifier.public void onKeyEvent(KeyEvent event, int nestingLevel)
event
- The event.nestingLevel
- The nesting level: 0 if called from the base class,
or 1 from a subclass. If the event was already checked by this consistency verifier
at a higher nesting level, it will not be checked again. Used to handle the situation
where a subclass dispatching method delegates to its superclass's dispatching method
and both dispatching methods call into the consistency verifier.public void onTrackballEvent(MotionEvent event, int nestingLevel)
event
- The event.nestingLevel
- The nesting level: 0 if called from the base class,
or 1 from a subclass. If the event was already checked by this consistency verifier
at a higher nesting level, it will not be checked again. Used to handle the situation
where a subclass dispatching method delegates to its superclass's dispatching method
and both dispatching methods call into the consistency verifier.public void onTouchEvent(MotionEvent event, int nestingLevel)
event
- The event.nestingLevel
- The nesting level: 0 if called from the base class,
or 1 from a subclass. If the event was already checked by this consistency verifier
at a higher nesting level, it will not be checked again. Used to handle the situation
where a subclass dispatching method delegates to its superclass's dispatching method
and both dispatching methods call into the consistency verifier.public void onGenericMotionEvent(MotionEvent event, int nestingLevel)
event
- The event.nestingLevel
- The nesting level: 0 if called from the base class,
or 1 from a subclass. If the event was already checked by this consistency verifier
at a higher nesting level, it will not be checked again. Used to handle the situation
where a subclass dispatching method delegates to its superclass's dispatching method
and both dispatching methods call into the consistency verifier.public void onUnhandledEvent(InputEvent event, int nestingLevel)
onInputEvent(android.view.InputEvent, int)
and other methods.event
- The event.nestingLevel
- The nesting level: 0 if called from the base class,
or 1 from a subclass. If the event was already checked by this consistency verifier
at a higher nesting level, it will not be checked again. Used to handle the situation
where a subclass dispatching method delegates to its superclass's dispatching method
and both dispatching methods call into the consistency verifier.