[Android Software/Hacking General [Developers Only]] tj_style:
I fun with ICS SDK system Image and ramdisk, trying to booting up the ICS system on my CSL Mi-410.

But.. end up with not working touchscreen, see the logcat:

23:54:06.962 Info SystemServer 134 Input Method Service

23:54:06.962 Info EventHub 134 New device: id=8, fd=107, path='/dev/input/event2', name='bu21018mwvkey', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

[B][COLOR="Red"]23:54:06.962 Debug EventHub 134 No input device configuration file found for device 'bu21018mwv'.[/COLOR][/B]

23:54:06.962 Warning InputManagerService 134 Couldn't create dir.: /data/system/inputmethod

[B][COLOR="red"]23:54:06.962 Info EventHub 134 New device: id=9, fd=114, path='/dev/input/event1', name='bu21018mwv', classes=0x15, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false[/COLOR][/B]

23:54:06.962 Debug EventHub 134 No input device configuration file found for device 'fbx_kybd'.

23:54:06.962 Info EventHub 134 New device: id=10, fd=116, path='/dev/input/event0', name='fbx_kybd', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

23:54:06.962 Info InputReader 134 Device added: id=10, name='fbx_kybd', sources=0x00000101

[B][COLOR="red"]23:54:06.962 Info InputReader 134 Touch device 'bu21018mwv' could not query the properties of its associated display 0. The device will be inoperable until the display size becomes available.[/COLOR][/B]

23:54:06.962 Info InputReader 134 Device added: id=9, name='bu21018mwv', sources=0x00002103

23:54:06.962 Info InputReader 134 Device added: id=8, name='bu21018mwvkey', sources=0x00000101

23:54:06.962 Info InputReader 134 Device added: id=3, name='7k_handset', sources=0x80000101

23:54:06.962 Info SystemServer 134 Accessibility Manager

23:54:06.962 Info InputReader 134 Reconfiguring input devices. changes=0x00000004

[B][COLOR="red"]23:54:06.962 Info InputReader 134 Device reconfigured: id=9, name='bu21018mwv', surface size is now 480x800, mode is 3[/COLOR][/B]

So I try to place bu21018mwv.idc at /system/usr/idc/.

Reboot the phone and when come back to Lockscreen and see the logcat:

23:57:03.720 Info EventHub 134 New device: id=8, fd=110, path='/dev/input/event2', name='bu21018mwvkey', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

23:57:03.720 Info SystemServer 134 Input Method Service

[B][COLOR="Blue"]23:57:03.720 Info EventHub 134 New device: id=9, fd=114, path='/dev/input/event1', name='bu21018mwv', classes=0x15, configuration='/system/usr/idc/bu21018mwv.idc', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false[/COLOR][/B]

23:57:03.720 Debug EventHub 134 No input device configuration file found for device 'fbx_kybd'.

23:57:03.720 Warning InputManagerService 134 Couldn't create dir.: /data/system/inputmethod

23:57:03.720 Info EventHub 134 New device: id=10, fd=115, path='/dev/input/event0', name='fbx_kybd', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

23:57:03.720 Info InputReader 134 Device added: id=10, name='fbx_kybd', sources=0x00000101

[B][COLOR="Red"]23:57:03.720 Info InputReader 134 Touch device 'bu21018mwv' could not query the properties of its associated display 0. The device will be inoperable until the display size becomes available.[/COLOR][/B]

23:57:03.720 Info InputReader 134 Device added: id=9, name='bu21018mwv', sources=0x00001103

23:57:03.720 Info InputReader 134 Device added: id=8, name='bu21018mwvkey', sources=0x00000101

23:57:03.720 Info InputReader 134 Device added: id=3, name='7k_handset', sources=0x80000101

23:57:03.720 Info InputReader 134 Reconfiguring input devices. changes=0x00000004

[B][COLOR="Blue"]23:57:03.720 Info InputReader 134 Device reconfigured: id=9, name='bu21018mwv', surface size is now 480x800, mode is 1[/COLOR][/B]

Good.. The Input manager is using bu21018mwv.idc..

I try to touch the screen with one finger, there is no logcat message, but when I touch the screen with two fingers lot of message are bouching on logcat:

[COLOR="Blue"]23:59:12.875 Debug InputEventConsistencyVerifier 134 GenericMotionEvent: Pointer count is 2 but it should always be 1 for ACTION_HOVER_ENTER

23:59:12.875 Debug InputEventConsistencyVerifier 134 in Handler (android.view.ViewRootImpl) {415519f8}

23:59:12.875 Debug InputEventConsistencyVerifier 134 0: sent at 145547252000, MotionEvent { action=ACTION_HOVER_ENTER, id[0]=0, x[0]=140.25531, y[0]=118.25, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=290.7234, y[1]=284.2222, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=145547, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 -- recent events --

23:59:12.875 Debug InputEventConsistencyVerifier 134 1: sent at 122225749000, MotionEvent { action=ACTION_HOVER_EXIT, id[0]=0, x[0]=-0.68085104, y[0]=-38.694443, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=122225, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 2: sent at 122215617000, MotionEvent { action=ACTION_HOVER_MOVE, id[0]=0, x[0]=83.06383, y[0]=331.44443, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=281.87234, y[1]=513.38885, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x80000000, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=122215, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 3: sent at 122199870000, MotionEvent { action=ACTION_HOVER_MOVE, id[0]=0, x[0]=84.42553, y[0]=332.1389, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=283.23404, y[1]=512.6944, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x80000000, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=122199, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 4: sent at 122182414000, MotionEvent { action=ACTION_HOVER_MOVE, id[0]=0, x[0]=85.78723, y[0]=332.1389, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=284.59573, y[1]=512.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x80000000, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=122182, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 5: sent at 122157085000, MotionEvent { action=ACTION_HOVER_MOVE, id[0]=0, x[0]=86.46808, y[0]=330.75, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=284.59573, y[1]=510.61108, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x80000000, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=122157, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 GenericMotionEvent: Pointer count is 2 but it should always be 1 for ACTION_HOVER_MOVE

23:59:12.875 Debug InputEventConsistencyVerifier 134 in Handler (android.view.ViewRootImpl) {415519f8}

23:59:12.875 Debug InputEventConsistencyVerifier 134 0: sent at 145547252000, MotionEvent { action=ACTION_HOVER_MOVE, id[0]=0, x[0]=140.25531, y[0]=118.25, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=290.7234, y[1]=284.2222, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=145547, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 -- recent events --

23:59:12.875 Debug InputEventConsistencyVerifier 134 1: sent at 145547252000, MotionEvent { action=ACTION_HOVER_ENTER, id[0]=0, x[0]=140.25531, y[0]=118.25, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=290.7234, y[1]=284.2222, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x80000000, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=145547, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 2: sent at 122225749000, MotionEvent { action=ACTION_HOVER_EXIT, id[0]=0, x[0]=-0.68085104, y[0]=-38.694443, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=122225, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 3: sent at 122215617000, MotionEvent { action=ACTION_HOVER_MOVE, id[0]=0, x[0]=83.06383, y[0]=331.44443, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=281.87234, y[1]=513.38885, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x80000000, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=122215, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 4: sent at 122199870000, MotionEvent { action=ACTION_HOVER_MOVE, id[0]=0, x[0]=84.42553, y[0]=332.1389, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=283.23404, y[1]=512.6944, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x80000000, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=122199, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 5: sent at 122182414000, MotionEvent { action=ACTION_HOVER_MOVE, id[0]=0, x[0]=85.78723, y[0]=332.1389, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=284.59573, y[1]=512.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x80000000, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=122182, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 GenericMotionEvent: Pointer count is 2 but it should always be 1 for ACTION_HOVER_MOVE

23:59:12.875 Debug InputEventConsistencyVerifier 134 in Handler (android.view.ViewRootImpl) {415519f8}

23:59:12.875 Debug InputEventConsistencyVerifier 134 0: sent at 145568034000, MotionEvent { action=ACTION_HOVER_MOVE, id[0]=0, x[0]=137.5319, y[0]=121.02777, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=290.7234, y[1]=284.2222, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=145568, downTime=0, deviceId=9, source=0x1002 }

23:59:12.875 Debug InputEventConsistencyVerifier 134 -- recent events --[/COLOR]

The messages is just say only ACTION_HOVER_ENTER, ACTION_HOVER_MOVE & ACTION_HOVER_EXIT.

And I think I need to send something like BTN_TOUCH and ABS_PRESSURE from kernel.. :)

Now it's time to modify the touchscreen driver, this is what I've modify:

This is the original:

https://gist.github.com/1328331/57956230c967d55742bc195faa5d2ec41f469b7d

This is what i've modify:

https://gist.github.com/1328331/239f7b6a6fa1dd4e3d4c230891c7d77f8d41d474

Compile the kernel, flash the new boot.img to my phone and remove the bu21018mwv.idc.

When i reboot the phone and come back to Lockscreen, try to touch and move with one, also with two finger, there is no bounching message again on logcat:

00:01:39.612 Info EventHub 134 New device: id=3, fd=103, path='/dev/input/event9', name='7k_handset', classes=0x81, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

00:01:39.612 Debug EventHub 134 No input device configuration file found for device 'proximity'.

00:01:39.612 Debug EventHub 134 No input device configuration file found for device 'light'.

00:01:39.612 Debug EventHub 134 No input device configuration file found for device 'orientation'.

00:01:39.612 Debug EventHub 134 No input device configuration file found for device 'accelerometer'.

00:01:39.612 Debug EventHub 134 No input device configuration file found for device 'bu21018mwvkey'.

00:01:39.612 Debug BluetoothAdapterStateMachine 134 PowerOff process message: 5

00:01:39.612 Info EventHub 134 New device: id=8, fd=110, path='/dev/input/event2', name='bu21018mwvkey', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

[B][COLOR="Red"]00:01:39.612 Debug EventHub 134 No input device configuration file found for device 'bu21018mwv-ics'.[/COLOR][/B]

00:01:39.612 Info SystemServer 134 Input Method Service

[B][COLOR="red"]00:01:39.612 Info EventHub 134 New device: id=9, fd=111, path='/dev/input/event1', name='bu21018mwv-ics', classes=0x15, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false[/COLOR][/B]

00:01:39.612 Debug EventHub 134 No input device configuration file found for device 'fbx_kybd'.

00:01:39.612 Warning InputManagerService 134 Couldn't create dir.: /data/system/inputmethod

00:01:39.612 Info EventHub 134 New device: id=10, fd=115, path='/dev/input/event0', name='fbx_kybd', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

00:01:39.612 Info InputReader 134 Device added: id=10, name='fbx_kybd', sources=0x00000101

[B]00:01:39.612 Info InputReader 134 Touch device 'bu21018mwv-ics' could not query the properties of its associated display 0. The device will be inoperable until the display size becomes available.[/B]

00:01:39.612 Info InputReader 134 Device added: id=9, name='bu21018mwv-ics', sources=0x00002103

00:01:39.612 Info InputReader 134 Device added: id=8, name='bu21018mwvkey', sources=0x00000101

00:01:39.612 Info InputReader 134 Device added: id=3, name='7k_handset', sources=0x80000101

00:01:39.721 Info InputReader 134 Reconfiguring input devices. changes=0x00000004

00:01:39.721 Info SystemServer 134 Accessibility Manager

[B][COLOR="red"]00:01:39.721 Info InputReader 134 Device reconfigured: id=9, name='bu21018mwv-ics', surface size is now 480x800, mode is 3[/COLOR][/B]

But the Touchscreen are now recognized as pointer, not as native touchscreen.. :D

View attachment 769877View attachment 769878

And the last, i've place the bu21018mwv-ics.idc (just to make different name with original driver) to /system/usr/idc/

Reboot the phone, back to lockscreen, try to touch the screen, and here is the logcat:

00:08:01.750 Info EventHub 134 New device: id=3, fd=103, path='/dev/input/event9', name='7k_handset', classes=0x81, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

00:08:01.750 Debug EventHub 134 No input device configuration file found for device 'proximity'.

00:08:01.750 Debug EventHub 134 No input device configuration file found for device 'light'.

00:08:01.750 Debug EventHub 134 No input device configuration file found for device 'orientation'.

00:08:01.750 Debug EventHub 134 No input device configuration file found for device 'accelerometer'.

00:08:01.750 Debug EventHub 134 No input device configuration file found for device 'bu21018mwvkey'.

00:08:01.750 Debug BluetoothAdapterStateMachine 134 PowerOff process message: 5

00:08:01.750 Info EventHub 134 New device: id=8, fd=110, path='/dev/input/event2', name='bu21018mwvkey', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

00:08:01.750 Info SystemServer 134 Input Method Service

[B][COLOR="Blue"]00:08:01.750 Info EventHub 134 New device: id=9, fd=114, path='/dev/input/event1', name='bu21018mwv-ics', classes=0x15, configuration='/system/usr/idc/bu21018mwv-ics.idc', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false[/COLOR][/B]

00:08:01.750 Warning InputManagerService 134 Couldn't create dir.: /data/system/inputmethod

00:08:01.750 Debug EventHub 134 No input device configuration file found for device 'fbx_kybd'.

00:08:01.750 Info EventHub 134 New device: id=10, fd=116, path='/dev/input/event0', name='fbx_kybd', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false

00:08:01.750 Info InputReader 134 Device added: id=10, name='fbx_kybd', sources=0x00000101

[B][COLOR="Red"]00:08:01.750 Info InputReader 134 Touch device 'bu21018mwv-ics' could not query the properties of its associated display 0. The device will be inoperable until the display size becomes available.[/COLOR][/B]

00:08:01.750 Info InputReader 134 Device added: id=9, name='bu21018mwv-ics', sources=0x00001103

00:08:01.750 Info InputReader 134 Device added: id=8, name='bu21018mwvkey', sources=0x00000101

00:08:01.750 Info InputReader 134 Device added: id=3, name='7k_handset', sources=0x80000101

00:08:01.750 Info InputReader 134 Reconfiguring input devices. changes=0x00000004

[B][COLOR="Blue"]00:08:01.750 Info InputReader 134 Device reconfigured: id=9, name='bu21018mwv-ics', surface size is now 480x800, mode is 1[/COLOR][/B]

And GREAAAT... My touchscreen is work as native touchscreen..

View attachment 769879View attachment 769880

I think this methode will can be implemented on all touchscreen driver, and maybe we not must to do that if we can modify the libinput source code.

or maybe other developers have another methode? please share in this thread..