frameworks/base/services/java/com/android/server/WindowManagerService.java --> new InputManager( )
frameworks/base/services/java/com/android/server/InputManager.java --> nativeInit( )
frameworks/base/services/jni/com_android_server_InputManager.cpp --> new NativeInputManager( )
--> new InputManager( )
frameworks/base/libs/ui/InputManager.cpp --> new InputReaderThread( )
frameworks/base/libs/ui/InputReader.cpp --> loopOnce( ) --> mEventHub->getEvent( )
frameworks/base/libs/ui/EventHub.cpp --> getEvent( )
const struct pollfd& pfd = mFDs[mInputDeviceIndex];
if (pfd.revents & POLLIN) {
readSize = read(pfd.fd, mInputBufferData,sizeof(struct input_event) * INPUT_BUFFER_SIZE);
mInputBufferCount = readSize / sizeof(struct input_event);
mInputBufferIndex = 0;
}
if (mInputBufferIndex < mInputBufferCount) {
const struct input_event& iev = mInputBufferData[mInputBufferIndex++];
const device_t* device = mDevices[mInputDeviceIndex];
read(mFDs[mInputDeviceIndex].fd..)
mFDs[] 是 /dev/input node
read 的內容 (struct input_event) 是定義在 kernel/include/linux/input.h:
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};
沒有留言:
張貼留言