Home » Android » How to assign IDC File for Input Device in Android ?

How to assign IDC File for Input Device in Android ?

As we have seen in “How to identify which IDC file used by Input Device in Android ?” if the input device is already using IDC File, we can see it in “ConfigurationFile” parameter in dumpsys input, but if we don’t have any IDC file assigned to the device and want to use a new file for the device, then this information certainly helps you to achieve it.

Input device configuration files are located by USB vendor, product (and optionally version) id or by input device name.

The following paths are consulted in order.

When constructing a file path that contains the device name, all characters in the device name other than ‘0’-‘9’, ‘a’-‘z’, ‘A’-‘Z’, ‘-‘ or ‘_’ are replaced by ‘_’.

Now, the first thing, we need to do is identify “Vendor ID” , “Product ID” and “Device Name” for the device. This can be done as below,

using “dumpsys input” command, look for device number in “Event Hub State” and the string infront of device number ( 5 in above example) is a “device name” ( “fts_ts” in above example) and then from “identifier” we can see the Vendor ID is 0x0000 and Product ID is 0x0000,

So we found the necessary details as,

Here, we can see Vendor ID and Product ID as non zero, only may be for USB devices. So, if we have those ID’s as zero, then we need to create the IDC file using “device name”, so in our case, the IDC file will be “fts_ts.idc”

Now, create the file as,

and we can either integrate and compile the android source code or push this file to “/vendor/usr/idc/fts_ts.idc” i.e. as mentioned in paths above to “/vendor/usr/idc/device-name.idc”

During development, you will first need to remount the vendor partition as mentioned here.

Now, when you boot the device next time, we can see the input device is assigned with the IDC file we added.

Reference : https://source.android.com/docs/core/interaction/input/input-device-configuration-files

Subscribe our Rurban Life YouTube Channel.. "Rural Life, Urban LifeStyle"

Leave a Comment