[Android Apps and Games] Christopher83:
[IMG="PKF Manager (Phantom Key Presses Manager)"]http://xdaforums.com/attachment.php?attachmentid=2859523&stc=1&d=1405766279[/IMG]​

This is my app to better manage the filtering parameters customization of Phantom Key Presses Filter kernel module (phantom_kp_filter).

This app requires a kernel that includes the phantom_kp_filter module, it has been initially implemented and included on my kernel (K^Kernel) and then has been also included in other kernels, including the new 3.4 stock kernel.

Phantom key presses issue description:

The phantom key presses issue is a well known hardware bug of some Samsung devices, also some I9001 are affected by this issue.

Pratically, the high activity of the radio hardware, in particular the antenna (expecially when in 2G mode), could cause interference on Melfas chip, which is located very close to the antenna. This interference could induce bad interrupts that are seen by the chip as possible HOME, MENU or BACK key presses.

These unwanted presses could cause unexpected app closings, Google Search popups, back to launcher home, or, the wake up (display light on) when the phone was in suspend mode (simply lying on the desk). Obviously, this problem could also cause a higher battery drain.

App features:

Enable/Disable the phantom HOME key and MENU/BACK touchkeys presses filtering

Filtering parameters customization

View the ignored key presses (possible phantom key presses)

Settings persistence after app close / reboot / shutdown

Previously set filtering parameters will be restored during the first app start

Download link:

PKF Manager

[QRCODE]http://www.mediafire.com/file/65vuudixdwh9jke/PkfManager_1.5.apk[/QRCODE]
​

​

How to install:

Delete the previous 05pkf* scripts you previously placed inside /etc/init.d

Download and install the app

Start it and customize the parameters as you prefer

Screenshots:

​

How to use the app:

You can move inside the app by swiping left/right or by clicking on the desired tab header button.

The selected customized values will be applied and stored immediately after the toggle change or dialog confirmation.

HOME Key Presses Filtering Tab

Status: this toggle allows to enable/disable the phantom HOME key presses filtering (disabled by default)

Max allowed incoming interrupts: by clicking on this preference you can customize the allowed max number of incoming interrupts to consider a HOME key press as valid (from 1 to 32, default = 4), a lower value allows to have a more aggressive filtering, instead a higher value allows to have a more permissive filtering

Report Wait: by clicking on this preference you can customize the wait time in ms before report the collected HOME key presses (from 5 to 25 ms, default = 12 ms), the key presses during this wait time are collected and reported only if the system received a number of interrupts less than or equal to the allowed max number of incoming interrupts

Ignored phantom key presses: show the ignored possible phantom HOME key presses, click on it to refresh and get the updated value

MENU/BACK key Presses Filtering Tab

Status: this toggle allows to enable/disable the phantom MENU and BACK key presses filtering (enabled by default)

Interrupt checks: by clicking on this preference you can customize the number of interrupt checks to be performed for the incoming MENU and BACK key presses (from 1 to 10, default = 10), a lower value is more permissive, a higher value securely avoids most of the bad interrupts

First error wait time: by clicking on this preference you can customize the time in ms to wait after the first error on MENU or BACK keys if there are many invalid key errors in rapid sequence (from 50 to 1000 ms, default = 500 ms), the default value is optimal and well tested

Last error wait time: by clicking on this preference you can customize the time in ms to wait after the last error on MENU or BACK keys if there are many invalid key errors in rapid sequence (from 50 to 1000 ms, default = 100 ms), the default value is optimal and well tested

Ignored phantom key presses: show the ignored possible phantom MENU and BACK key presses, click on it to refresh and get the updated value

About Tab

XDA forum thread: by clicking on this preference, you will be redirected on this thread

Donate: by clicking on this preference, you will be redirected on PayPal

App Sources:

You can find the app sources here:

android-apps​

The kernel side workaround and the phantom_kp_filter module:

To workaround this issue, which affects my I9001 too, I implemented a possible kernel side solution.

The solution includes a new device module (phantom_kp_filter), which also allows the filtering parameters customization via sysfs, and various changes to cypress-touchkey and pmic8xxx-keypad modules.

The phantom key presses filtering is enabled by default for incoming MENU and BACK touch keys, because for these keys is simpler to recognize a bad interrupt or an invalid key press, instead it's disabled for incoming HOME key (read the next howto infos to enable it).

The new device module allows to show the number of ignored key presses and to customize the filtering parameters by means of a sysfs interface, at the following system path: /sys/class/misc/phantom_kp_filter

The interface exposes these files:

home_enabled: show/edit the enable status of the phantom HOME key presses filtering (0 = disabled and 1 = enabled, disabled by default)

home_allowed_irqs: show/edit the allowed max number of incoming interrupts to consider a HOME key press as valid (from 1 to 32, default = 4), a lower value allows to have a more aggressive filtering, instead a higher value allows to have a more permissive filtering

home_report_wait: show/edit the wait time in ms before report the collected HOME key presses (from 5 to 25 ms, default = 12 ms), the key presses during this wait time are collected and reported only if the system received a number of interrupts less than or equal to the allowed max number of incoming interrupts (home_allowed_irqs parameter)

home_ignored_kp: show the ignored possible phantom HOME key presses

menuback_enabled: show/edit the enable status of the phantom MENU and BACK key presses filtering (0 = disabled, 1 = enabled, enabled by default)

menuback_interrupt_checks: show/edit the number of interrupt checks to be performed for the incoming MENU and BACK key presses (from 1 to 10, default = 10), a lower value is more permissive, a higher value securely avoids most of the bad interrupts

menuback_first_err_wait: show/edit the time in ms to wait after the first error on MENU or BACK keys if there are many invalid key errors in rapid sequence (from 50 to 1000 ms, default = 500 ms), the default value is optimal and well tested

menuback_last_err_wait: show/edit the time in ms to wait after the last error on MENU or BACK keys if there are many invalid key errors in rapid sequence (from 50 to 1000 ms, default = 100 ms), the default value is optimal and well tested

menuback_ignored_kp: show the ignored possible phantom MENU and BACK key presses

version: show the module version

Resources:

You can find my kernel side developed solution on my GitHub repo, the commit is the following:

input: Phantom Key Presses filtering​

The software kernel side solution related to the phantom touchkeys presses is in part based and readapted on the work of Electric Bill:

Phantom keypress and screen shot​

Credits and Thanks to:

Electric Bill for his research and possible software and hardware workarounds

Jt1134 for his solution on Fascinate kernel of CyanogenMod team

KTulu84, Smeroni68, Educk, Spaazm and Abhi.a3s for their support in testing

Smeroni68, Neurom, M. Andres, Ludovic D. for their donations

XDA:DevDB Information

[GT-I9001][APP] Phantom Key Presses Filter Manager, App for the Samsung Galaxy S I9000

Contributors

Christopher83

Source Code: https://github.com/Christopher83/android-apps

Version Information

Status: Stable

Current Stable Version: v1.5

Stable Release Date: 2015-01-03

Created 2013-09-13

Last Updated 2016-11-20