Android Input Pipeline

Narendra Harny
Make Android
Published in
2 min readAug 1, 2020
Photo by Todd Mittens on Unsplash

The Lowest layer of Linux based operating systems is Linux Kernel and this is only the place where all the inputs will be received but the important thing is kernel is also a program that needs an input to execute the instructions.

The input pipeline starts with any type of action on hardware, for example, if a USB connection is detected, the Device battery is low or a simple touch event on an Android device screen anything that changes the system state is considered an interrupt.

The permanent software programmed into a read-only memory called device firmware is responsible for encoding and transmitting these signals by producing interrupts on an I2C bus.

Linux Device drivers are responsible for translating hardware interrupts into a standard input event format, Linux/input.h kernel header file contains all standard sets of event types and codes. Android has Event-hub that reads input events from the kernel by using the “evdev” drivers associated with input device hardware. The Android Input reader decodes the input event and the Linux input protocol event codes are translated into Android event codes, There is a Keymapping will be done by the Android Event-hub and Input-reader components to configure the mapping from Linux event codes to Android event codes.

Input-reader then sends input events to the Input-dispatcher which forwards them to the appropriate window.

Originally published at https://www.linkedin.com.

--

--

Narendra Harny
Make Android

Connect on https://medium.com/make-android | Write On, Android AOSP & Applications | Python | DevOps | Java | C++ | Kotlin | Shell | Linux | Android Auto | IVI