inputdevices: adjust the code structure

tower:https://tower.im/projects/8f19f0bf0e754f0b82ef2c24bc230973/todos/dd35fed608424ab3ba695313bb3fa9ba/

Change-Id: I4499de1edfe5195dc638cb7a995455d94dc25ca0