android input子系统--InputReader EventHub::getevents之mClosingDevices调用过程详细分析

EventHub::getEvents中:分析mClosingDevices在android系统中的调用过程

        // Report any devices that had last been added/removed.
        while (mClosingDevices) {
            Device* device = mClosingDevices;
            ALOGV("Reporting device closed: id=%d, name=%s\n",
                 device->id, device->path.string());
            mClosingDevices = device->next;
            event->when = now;
            event->deviceId = device->id == mBuiltInKeyboardId ? BUILT_IN_KEYBOARD_ID : device->id;
            event->type = DEVICE_REMOVED;
            event += 1;
            delete device;
            mNeedToSendFinishedDeviceScan = true;
            if (--capacity == 0) {
                break;
            }
        }


mClosingDevices在android系统中所出现的地方

1.EventHub:~EventHub的构造函数中将其初始化为0


2.EventHub:EventHub的构造函数中如果mClosingDevices存在,那么将一个个取出,并

将其device释放,然后关闭epoll,notify,pipe的文件 mEpollFd mINotifyFd  mWakeReadPipeFd mWakeWritePipeFd

3.如果mClosingDevices存在,那么挨个取出mClosingDevices,然后将其构造成RawEvent,然后将变量

mNeedToSendFinishedDeviceScan设置为true


4.此处是对mClosingDevices进行赋值的地方



阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页