ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上

2014年3月19日 星期三

from System Server to Input fd

framewors/base/services/java/com/android/server/SystemServer.java --> WindowManagerService.main( )

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;
};

沒有留言:

標籤

網誌存檔