[App][Root] Nextlit: control the Robin's segmented LEDs

Prospero.X-3

Senior Member
May 6, 2015
108
192
73
github.com
The LP5523-controlled segmented LEDs on the rear of the Nextbit Robin are one of the device's most unique features. Yet they see very little use, being used only for effects relating to the now-defunct "Smart Storage" in the stock ROM and simply displaying a pattern during boot in custom ROMs. Nextlit rectifies this by employing these lights as a useful notification indicator.


Nextlit allows you to preview the five patterns programmed into the LP5523 by Nextbit plus another five unique to the app, and select one to activate when a notification is received. You can configure patterns for individual apps, letting you identify which app requires your attention without needing to wake your phone. Nextlit exploits the potential of the segmented LEDs to encode greater meaning than can be expressed with the standard notification light and looks cool while doing it.

If you want to use the app for any more than simply previewing the available patterns you'll need to give its service notification access. The application does not read nor care about the contents of notifications; the only thing it does is count them. You can see the relevant routines here.

The app needs root access in order to access /sys but will work on any ROM. Nextlit has been featured on XDA and is free software, released under the Mozilla General Public License version 2.0.

To do

Changelog

2.0
  • First release marked as 'stable'
  • Completely overhauled UI
  • Added app icon
  • Added per-app notification configuration
  • Added five new patterns: Breathe, Pulse, Chase, Blink and Dapple
  • By default, notifications will now only activate the lights if they would normally activate the standard notification LED
  • Calls and alarms now activate the lights
  • Added service configuration options:
    • Obey Do not disturb policy
    • Mimic standard LED behaviour (experimental)
  • Minor changes:
    • Improved service stability
    • Fixed preview not stopping if service not bound
    • Renamed 'show for ongoing' to 'show for all notifications' to better reflect its function
    • Preview now ends on app pause
    • Service will now disable if unbound

1.2
  • Fixed possible force close on unrooted devices
  • Service is now persistent between reboots
  • Added 'show for ongoing notifications' option

1.1
  • Added option to enable lights when screen on

1.0.1
  • Fixed possible force close on service enable
  • Fixed service failing to stop

1.0
  • Initial release

XDA:DevDB Information
Nextlit, Device Specific App for the Nextbit Robin

Contributors
Prospero.X-3
Source Code: https://github.com/biqqles/nextlit


Version Information
Status: Stable
Current Stable Version: 2.0
Stable Release Date: 2018-09-17
Current Beta Version: 1.2
Beta Release Date: 2018-01-13

Created 2018-01-13
Last Updated 2018-09-17
 

Attachments

Last edited:

NurKeinNeid

Senior Member
Aug 3, 2014
907
4,008
133
33
Berlin
The preview works but I can not enable it for notifications. The app force closes if I try. How do I give the app the correct permissions? There is no permission in the app settings, which I can assign.
 

Prospero.X-3

Senior Member
May 6, 2015
108
192
73
github.com
The preview works but I can not enable it for notifications. The app force closes if I try. How do I give the app the correct permissions? There is no permission in the app settings, which I can assign.
Oh dear :s The app is meant to take you to the notification access settings when you first enable the service with the switch, does it crash before that? You can try giving it access by navigating to notification access yourself (For Nougat, Settings > Apps > cogwheel > Special access > Notification access). What ROM and Android version are you on?
 
  • Like
Reactions: NurKeinNeid

NurKeinNeid

Senior Member
Aug 3, 2014
907
4,008
133
33
Berlin
Oh dear :s The app is meant to take you to the notification access settings when you first enable the service with the switch, does it crash before that? You can try giving it access by navigating to notification access yourself (For Nougat, Settings > Apps > cogwheel > Special access > Notification access). What ROM and Android version are you on?
I am using a personal build of AOSiP, Android 7.1.2

The app quits before the query. But thanks for the hint. I did not know this option yet. I already had logfile ready. But it works now. At least the message "Service started" came.
Thank you for your quick help. :)
 

Prospero.X-3

Senior Member
May 6, 2015
108
192
73
github.com
Thanks for the logcat. I actually realised what the error is just after my last post (stupid mistake, it'll happen whenever someone has no apps set up for notification access), and that is fixed. I will try to reproduce the service failing to stop, but it's working fine for me. I'll upload an updated apk, hopefully with fixes for both, later today. Don't worry about spamming the thread or anything, I can only fix things if people report them :)
 
Jun 25, 2014
17
1
0
New Delhi
OMG thanks for the effort, really really appreciate it. I hope other ROM devs see what you did and implement this in their ROM's. Props to you for working on the application, great work keep it up please.
 

L3R0N

Senior Member
Jul 13, 2014
786
323
0
Roseau
New version (1.0.1) is up, with fixes for both issues. I've updated the download link in the OP. Because Android caches services, you should uninstall 1.0 before installing 1.0.1 for the fix to take effect.
Thanks for the update. Service starts and stops fine now. I look forward to future improvements to this app.
 
  • Like
Reactions: Prospero.X-3

Prospero.X-3

Senior Member
May 6, 2015
108
192
73
github.com
That's great news! I'll update the OP.

Regarding battery drain, when I wrote that I was thinking about the service that listens for notifications requiring loads of wakelocks because I misunderstood the way that the NotificationListenerService works. Unlike a normal service, it actually runs constantly in the background and is managed by the Android system rather than the app itself (this was also the reason for the "service not stopping" bug that was fixed in 1.0.1). So I'll remove the lines about "minimising battery drain" in the OP, unless people report that the app is actually having an effect on their SoT. For the lights themselves, according to max_current, each LED can draw a maximum of 3.2 mA , so assuming negligible power consumption of the LP5523 itself, that's just 12.8 mAh, or just 0.5% of the Robin's total battery capacity per hour (assuming they're at 3.7 V) for all four at full brightness.

One thing that will actually reduce power consumption, though, is adding options to show only when the screen is off (you can't see the lights if you're using the phone after all!), and to only show patterns for notifications that would normally activate the "standard" notification light (so music players don't set it off, for example).

In other news, I have setting custom patterns fully working, but need some more time to document the process fully, and to come up with some nice ones to show off what the chip is capable of. The LP5523 can hold up to 96(!) instructions, but the kernel driver only supports up to 16, which is quite frustrating. I may be able to find a workaround for that by chaining multiple engines together, but that's something for later. In the future I'd also like to try to implement user-definable patterns, but that will take more time.

This project has been rather more popular than I expected, so now is a good time to ask everyone: what features do you want to see in the app? :D
 
Last edited:

raulrash

Member
Sep 11, 2009
7
2
0
Lights don't stop flashing

Great use for the leds. A few observations:
Using the app (1.0.1) for a couple of days now. The leds do not stop flashing after dismissing notifications.
Also, while there is no notification for the service stopped, it does stop on its own after a 3-4 hrs (Which is when the leds do not flash when receiving notifications) Haven't figured out what makes it stop yet.

I'm on LOS 14.1 (Android 7.1.2)
 
Jun 25, 2014
17
1
0
New Delhi
That's great news! I'll update the OP.

Regarding battery drain, when I wrote that I was thinking about the service that listens for notifications requiring loads of wakelocks because I misunderstood the way that the NotificationListenerService works. Unlike a normal service, it actually runs constantly in the background and is managed by the Android system rather than the app itself (this was also the reason for the "service not stopping" bug that was fixed in 1.0.1). So I'll remove the lines about "minimising battery drain" in the OP, unless people report that the app is actually having an effect on their SoT. For the lights themselves, according to max_current, each LED can draw a maximum of 3.2 mA , so assuming negligible power consumption of the LP5523 itself, that's just 12.8 mAh, or just 0.5% of the Robin's total battery capacity per hour (assuming they're at 3.7 V) for all four at full brightness.

One thing that will actually reduce power consumption, though, is adding options to show only when the screen is off (you can't see the lights if you're using the phone after all!), and to only show patterns for notifications that would normally activate the "standard" notification light (so music players don't set it off, for example).

In other news, I have setting custom patterns fully working, but need some more time to document the process fully, and to come up with some nice ones to show off what the chip is capable of. The LP5523 can hold up to 96(!) instructions, but the kernel driver only supports up to 16, which is quite frustrating. I may be able to find a workaround for that by chaining multiple engines together, but that's something for later. In the future I'd also like to try to implement user-definable patterns, but that will take more time.

This project has been rather more popular than I expected, so now is a good time to ask everyone: what features do you want to see in the app? :D
I would like to see custom pattern notifications for different apps, that'd be really cool and awesome
 

Prospero.X-3

Senior Member
May 6, 2015
108
192
73
github.com
After installing and turning on notification access for the app force closes when trying to open it
Installed app, ran app.
Nexlit has stopped working.
Notification access granted.
Still no luck.

Lineage OS (latest)
Logcat please.


Great use for the leds. A few observations:
Using the app (1.0.1) for a couple of days now. The leds do not stop flashing after dismissing notifications.
Also, while there is no notification for the service stopped, it does stop on its own after a 3-4 hrs (Which is when the leds do not flash when receiving notifications) Haven't figured out what makes it stop yet.

I'm on LOS 14.1 (Android 7.1.2)
That's odd. The logic for handling a notification dismissal is as simple as counting the number of active notifications and turning the lights off if there aren't any, so I can't think why the lights would enable but not disable. It sounds obvious, but did you have any low priority persistent notifications active while testing? That's honestly the only thing I can think of.


I would like to see custom pattern notifications for different apps, that'd be really cool and awesome
This is definitely something I'm planning!

Seeing the app featured on the side panel was a great surprise today, but it keeps the pressure up to improve it :D
 
  • Like
Reactions: [email protected]