Getting BLN to work with CyanogenMod / LineageOS

“Backlight Notification” is a great feature of some Android Linux kernels, that allows to use the backlight of the “Menu” and “Back” buttons to signal pending notifications for phones that don’t have a dedicated notification LED.

There is an app called BLN control in the play store from the developer “neldar”, that allows to control this feature. However, if you try to use it on a recent version of CyanogenMod or LineageOS, it will report “This kernel does not support BLN”. This may not be true, the kernel might support it, like in many recent custom ROMs, but the app cannot configure it due to the SELinux (Security-Enhanced Linux). It’s a module that increases the security of Android, but prevents BLN control to work.

One option (that I do not recommend) is to disable SELinux by settings its mode to permissive (“setenforce permissive” as root).

A better option, that doesn’t compromise the security of the phone, is to enable BLN at each boot. For that, enable “adb” in the developer options of the phone, also enable “root” access for adb, then connect to the phone with ADB:

Computer$ adb shell
Phone$ su -
Phone# cat > /data/local/userinit.sh
echo 1 > /sys/devices/virtual/misc/backlightnotification/enabled
[Press CTRL-D]
Phone#

Now reboot the phone, and call or text your phone. The “menu” and “back” buttons should glow until you dismiss the notifications.

Don’t forget to disable the root access and adb in the developer options!

And if the directory “/sys/devices/virtual/misc/backlightnotification” is missing, then the kernel really doesn’t support BLN, sorry for you.

Please let me know in the comments if this worked for you (or not).

Advertisements
This entry was posted in Android. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s