Merge "Move focus dispatch to input (2/2)"
This commit is contained in:
committed by
Android (Google) Code Review
commit
e33a992c19
@@ -127,6 +127,19 @@ public abstract class InputEventReceiver {
|
||||
finishInputEvent(event, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a focus event is received.
|
||||
*
|
||||
* @param hasFocus if true, the window associated with this input channel has just received
|
||||
* focus
|
||||
* if false, the window associated with this input channel has just lost focus
|
||||
* @param inTouchMode if true, the device is in touch mode
|
||||
* if false, the device is not in touch mode
|
||||
*/
|
||||
// Called from native code.
|
||||
public void onFocusEvent(boolean hasFocus, boolean inTouchMode) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a batched input event is pending.
|
||||
*
|
||||
@@ -213,8 +226,13 @@ public abstract class InputEventReceiver {
|
||||
onBatchedInputEventPending();
|
||||
}
|
||||
|
||||
public static interface Factory {
|
||||
public InputEventReceiver createInputEventReceiver(
|
||||
InputChannel inputChannel, Looper looper);
|
||||
/**
|
||||
* Factory for InputEventReceiver
|
||||
*/
|
||||
public interface Factory {
|
||||
/**
|
||||
* Create a new InputReceiver for a given inputChannel
|
||||
*/
|
||||
InputEventReceiver createInputEventReceiver(InputChannel inputChannel, Looper looper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8043,6 +8043,11 @@ public final class ViewRootImpl implements ViewParent,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFocusEvent(boolean hasFocus, boolean inTouchMode) {
|
||||
windowFocusChanged(hasFocus, inTouchMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
unscheduleConsumeBatchedInput();
|
||||
|
||||
Reference in New Issue
Block a user