Android 6 persistent notification icon

If you don't want to have the persistent icon download this version of Light Flow https://play.google.com/store/apps/details?id=com.rageconsulting.android.lightflowlegacy

If on the full version of the app, keep the full version still installed as this will authenticate your purchase. It will miss out on any android 6.0 features but will not show the persistent icon.
Ensure the full version you are on is version 3.60.12 or later for this.

Why do the latest builds have the Persistent notification?
Previous versions of Light Flow have targeted an omission in Android's API which allowed a notification to get created to control the LED without a notification. Since android 4.3 in the system logs there's been warnings that future versions of Android will cause apps to crash using this method.

Android 6 preview 1 and 2 had this warning, but Preview 3 and the official release changed to crashing apps.

Therefore light flow now needs a persistent notification (but only when the notification bar is pulled down). Without it the app would crash (using the previous method) or loose control of the notification led when other app tried to control it and wouldn't be able to regain control. 

Note that you'll sometimes see a flicker of the notification icon when switching on the screen. This is because light flow now has to dynamically change the notification when the screen switches on/off. When it's off the app needs to have the notification set to priority "normal" as that's the mode that the led will show. When the screen is on (to prevent a permanent notification in the notification bar at the top) the app changes the notification to priority "minimum". The change can sometimes take up to about a second depending on how quickly android broadcasts out the screen state change.

In versions of Light Flow prior to version 3.60.0 even in Android 6 you wouldn't need this notification. This is because the when creating an app you select a "target" version of Android. Versions prior to 3.60.0 targeted android 5.1, version 3.60.0 upwards target android 6. Android won't crash apps targeting older versions to try and keep apps from crashing.

The app has to target android 6 to use new great features like permission controls, auto backup and any new feature that'll come in future versions of android.

I've raised a feature request with Google to improve LED control in future versions. It can be "starred" here https://code.google.com/p/android/issues/detail?id=190997

One advantage of having the persistent notification is that it can be combined with having the app run in the foreground which means it's less likely to miss notifications and be less effected by side effects of doze mode and battery optimizations.


Aquamail support

We teamed up with the Aquamail developer to add support between the two apps. This gives the benefit of notifications working per email account set up in Aquamail.

Due to permissions set between the two apps to allow this to happen Aquamail must be installed before light flow to be able to see the accounts.

If Aquamail isn't showing up for you try the following:


  • Go into light flow
  • Select Tools
  • Select Backup and backup your settings
  • Uninstall light flow
  • Install light flow again
  • Go into light flow
  • Select Tools
  • Select Restore and restore your settings back in
Now when you go into Light Flow -> Notification settings and press on the "+" button you should see your accounts listed.

There is one limitation in aquamail, you mustn't use the smart inbox notifications in aquamail (ie keep your notifications per email account). Note it is fine to use the actual smart inbox feature, just not it's grouped notifications.

Changes for Android 6 - Marshmallow

Android 6.0 has brought some pretty major changes to android which affect Light Flow. Some are positive changes whereas others may limit features users are accustomed to.

Here are some of the benefits:

App permission control
  • The app now doesn't grant lots of permissions at startup. Permissions are requested for the user to select when they want to use a specific feature. For example, contact access if using contact specific notifications. This is great for letting the user control what the app has access to.
Better support for camera flash
  • Camera flash should work across all Android 6.0 phones are Google added standard access to the camera flash whereas previously every phone was different and many undocumented.
Automatic backup of app settings
  • The app settings should now get automatically backed up and restored if reinstalling
* Note the above new features are available in Light Flow version 3.60.0 upwards


And here's a few changes in how things work that may limit functionality:


Doze mode
Android 6.0 has a new feature to help improve phone battery usage called Doze mode. It's a system wide feature that places many parts of android into a sleeping state to help preserve the battery. When in this mode apps don't run and their operations will be limited.

During this time there's only really two things that are guaranteed ways to make apps work:
  • Alarm apps where a user alarm is set will wake a few minutes before the alarm time
  • Apps which send messages via Google Cloud Messenger as high priority will wake the phone for a few seconds to place up notifications.
Because of these limitations, during this period Light Flow can't run code that'll cycle the led or perform repeating notification sounds and vibrations. Using Google Cloud messenger wouldn't be practical for the purpose of Light Flow as every few seconds the phone would need to be getting data from servers which would do exactly the opposite of what Doze mode is intended for. 

Your phone will typically enter doze mode if the following criteria are met:
  • not plugged in (ie it's running on battery)
  • has not been switched on for an hour
  • has not moved recently.
This does mean that if you leave your phone on your desk all day not on charge after approx 1 hour the led cycling may stop.

If you have your phone in your pocket and get it out the sensors will detect the movement and also bring the phone out of doze mode.

Although android has a new battery optimization option for apps in the phone settings these settings don't change the behavior of doze mode so the above limitations are not possible to change with any system settings.

Persistent notifications
Previous versions of Light Flow have targeted an omission in Android's API which allowed a notification to get created to control the LED without a notification. Since android 4.3 in the system logs there's been warnings that future versions of Android will cause apps to crash using this method.

Android 6 preview 1 and 2 had this warning, but Preview 3 and the official release changed to crashing apps.

Therefore light flow now needs a persistent notification (but only when the notification bar is pulled down). Without it the app would crash (using the previous method) or loose control of the notification led when other app tried to control it and wouldn't be able to regain control.

In versions of Light Flow prior to version 3.60.0 even in Android 6 you wouldn't need this notification. This is because the when creating an app you select a "target" version of Android. Versions prior to 3.60.0 targeted android 5.1, version 3.60.0 upwards target android 6. Android won't crash apps targeting older versions to try and keep apps from crashing.

The app has to target android 6 to use new great features like permission controls, auto backup and any new feature that'll come in future versions of android.

I've raised a feature request with Google to improve LED control in future versions. It can be "starred" here https://code.google.com/p/android/issues/detail?id=190997

One advantage of having the persistent notification is that it can be combined with having the app run in the foreground which means it's less likely to miss notifications and be less effected by side effects of doze mode and battery optimizations.

Sounds not playing or cut short if you have the switch screen on option enabled
If in Light Flow for an notification you set a "volume control method" of "android standard" then the sound will only play if you have the screen switched off. That's because previously light flow could create a notification and set a sound without an additional icon in the notification bar. As this isn't possible now (it's required for notifications to play sounds, similar to the priority of showing the LED as described above) then it's not possible to do cleanly.

Using a volume control method of "Light flow controlled notification volume" should fix this.

Vibrations not triggering when the screen is on
In light flow->settings->labs, there's a "Notification vibration" option. If this is on and the screen is on then the vibration may not play due to the same reasons as the sound not playing described above.

Having this option switched off in Android 6 is recommended.


Phone Help - LG G4 and G5

Light Flow should work well with the LG G4 and G5

You must go into your phone settings, display, leds and make sure only "Downloaded apps" is enabled.

Also note that the flash speed of "Always On" doesn't work on the G4. This is due to an LED driver limitation. You can get pretty close to an always on LED by going into Light Flow and setting up a custom flash rate of 50000,1

Phone Help - Samsung S6/S6 edge

Compatibility

Light Flow should work on the S6 and S6 edge.

The following phone settings are required:

Light Flow Legacy is recommended for better compatibility.


Android 7 users
The workarounds for Android 6 are not required in android 7, but you may have to clear the apps data if your phone upgrades from 6 to 7.

Go into your phone settings
  • applications
  • application manager
  • Select "Light Flow"
  • Storage
  • Clear data
This will reset the app and should fix issues that some users may be having after the upgrade.

Note you shouldn't need any of the samsung workaround options on in android 7 



Android 6 users
Light Flow, when prompted, make sure you switch the following:
  •  Notification Access (In your phone settings, Lock screen and security->Other security settings->Notification access if Light Flow doesn't prompt)
  • Accessibility  (In your phone settings, Accessibility if Light Flow doesn't prompt)
  • Samsung workaround. When it's enabled the yellow box will show "disable workaround" as it'll currently be enabled.
If you have any apps which allow controlling the LED in their settings, make sure you switch that option off. e.g. Facebook, whatsapp, twitter, Skype all have settings that can be switched off.

Some users are reporting that certain apps will cause the LED to still turn blue. The following are notifications that may cause this, but there may be more

  • SMS
  • Missed calls
  • Email (samsung's email app)
  • Gmail
  • Hangouts
If you get a blue led override the correct led for these then so far the only option seems to be in lightflow to set the "switch screen on" option for these notifications. You can set a small screen on time such as 0.3 seconds which seems to fix the issue.


Side effects of the samsung workaround


Due to the workaround there Are A Few Side-Effects For Light Flow Controlling Apps Where The Native App Is Raising A Notification.

  • You may get duplicate vibrations and sound if using the native app to control them instead of Light Flow
  • If the notification is expandable and has buttons then if the button doesn't launch the app then the notification will persist. For example Gmail shows an "Archive" and "Reply" button. If you press "Archive" the archive process will happen but the notification will still persist. Just swipe away to clear it. For the "Reply" button, when it's pressed enters Gmail to reply and therefore clears the notification automatically. 
  • If an app can normally remotely clear a notification (for example when you view a Gmail on another device) this notification won't automatically clear.
Note that all these side-effects only happen for apps without the option to switch the led off that would normally show one.

Are you still seeing a blue led when you've selected another color?

This will usually when system/stock apps raise a notification such as the messenger app, missed calls etc. Some users have reported that going into lightflow for these notifications and enabling the "Switch screen on" option helps ensure the LED ends up the correct color.

Why do Messenger notifications not always show?

The samsung sms app works a little differently to most other messaging apps.
Try going into light flow, notification settings, SMS and on the first tab set the last 4 options to

  • Off
  • On
  • Off
  • On

as shown in the screenshot above and see if that helps. Note that with these settings contact specific sms notifications will not trigger. If you want them to we'd recommend using a different messeging app such as EvolveSMS which allows you to switch off the LED control in their app.




Android 5.1.1 users
Details about controlling the LED on the S6 and S6 Edge on android 5.1.1 can be found here: http://www.reactle.com/2015/07/samsungled.html


Previous versions of Android should just work as long as you go into your phone settings, sounds and notification and enable the LED option at the bottom of the list.

If it doesn't work but you've already got this on, try switch it off and back on again and then reboot the phone and see if that helps as I've known in the past the switch to show as the incorrect state.


Samsung devices running Android 5.1.1 upwards

Please note that the below document is applicable to version 3.55.2 of Light Flow and above.

Quick summary of settings required

  • Make sure "Led indicator" is on in your phone settings, sounds and notifications
  • Enable Notification Access and Accessibility when prompted in Light Flow
  • Enable the Samsung workaround when prompted
  • Switch off the notification led option in apps which allow it such as Facebook, twitter, Whatsapp in their app settings
  • If using SMS/Messenger go into lightflow, notification settings, sms and on the first tab set the last 4 options to:
    - off
    - on
    - off
    - on
  • Read below for more details

Intro

When Samsung pushed out 5.1.1 to their phones they made a change to how their LED control works. Previously it worked like other Android phones, but now it's non-standard there seems little logic to how it's controlled.

I'd been getting reports of the LED not working and just flashing blue so decided to buy an S6 edge to specifically look into it.

It took a couple of weeks of writing sample apps try and get any understanding of how the control was working, but eventually I worked out a pattern.

One part of the issue is regaining control of the LED once it's turned blue and I'd had to do similar on the S3 for the USA version when initially released so I knew of a method that I thought should work. Sadly since I'd last used that, android permissions have changed around a lot and now only system apps could use this trick. I then spent a week trying several different ideas which all lead to dead-ends on gaining control.

Another week of late nights and I worked out a method to gain control which I've now implemented into Light Flow


Recommended settings

Rooted users
Firstly, if you've got root access on your phone, then that's the simplest.
Go into Light Flow, settings->device settings and root
And enable:
  • root mode
  • Samsung root mode 
Then go into your phone settings, sounds and notifications and switch off "Led indicator".

Standard users
If your phone is not rooted, then the following settings are required:

  • Notification Access must be enabled when prompted in the app to enable it.
  • Accessibility must be enabled when promoted by the app
  • "Enable workaround" must also be enabled.
Any apps that have the option to display a notification LED in them should be set to off.
Apps such as Facebook, Twitter, Whatsapp, Snapchat and twitter all have this option. This allows Light Flow to keep control of the LED.

Some apps don't have this option but there are similar apps that can be used instead which have the option.
  • For example, Gmail doesn't have the option by "Inbox by Gmail" does.
  • Messenger doesn't have the option but many 3rd party texting apps do.
For apps where there's no alternate app with more control or where you don't want to change app Light Flow will control the LED for them, but it'll have a few side-effects on the actual notifications which are listed below.

Side-effects of the workaround

There are a few side-effects for Light Flow controlling apps where the native app is raising a notification.
  • You may get duplicate vibrations and sound if using the native app to control them instead of Light Flow
  • Some apps may just show a "star" in the notification bar when the notification arrives. See below to help with this issue if running Android 5.1.1. With Android 6.0 upwards it's now possible to automatically set the correct icon (Light Flow version 3.61.12 upwards)
  • If the notification is expandable and has buttons then if the button doesn't launch the app then the notification will persist. For example Gmail shows an "Archive" and "Reply" button. If you press "Archive" the archive process will happen but the notification will still persist. Just swipe away to clear it. For the "Reply" button, when it's pressed enters Gmail to reply and therefore clears the notification automatically.
  • If an app can normally remotely clear a notification (for example when you view a Gmail on another device) this notification won't automatically clear.
Note that all these side-effects only happen for apps without the option to switch the led off that would normally show one.

Help changing the "Star" notification into a real one

The workaround to keep control of the notifications is quite complex and there's no automatic way to change this to the real icon as a change needs to be made to Light Flow for each notification type if running Android 5.1.1
Getting the icons required for this for several thousand apps would be far too time consuming, but you can help.

If there's an app that shows you a "star" where you'd normally see the real icon, Light Flow will have automatically created a backup of that icon and placed it into a /lightflow/app_icons directory.

If you email the files in this directory to support@reactle.com then I'll add them into the next release.

Future plans

I plan to keep looking into different ways to get things working with fewer side-effects and also to chase Samsung regarding their inconsistent approach to LED control that they have introduced.



Android M - changes affecting light flow

I've been busy over the last couple of hours trying to get a handle on all the changes coming in the android M preview

Here's a summary of things I can see that will affect Light Flow that I'll need to work on:
  • app permissions on request - Light flow needs many permissions for everything it does and there's going to be quite a bit of work working out when those permissions are used and what to disable in the user interface when they are disabled
  • The new doze mode by default I think will totally stop any led cycling, but it looks like with some extra calls I think I can get around this
  • I don't think the "fixed volume", "relative volume" sound options will work anymore as it seems setting the stream volume isn't permitted anymore. I also need to look at the "play sound when in silent mode" as there's changes around that as there's now just a toggle mute/unmute call that can be made
  • There's a new mode of "alarms" ie so your alarm will trigger in the morning etc - like "none" but including alarms. I'll add sleep mode triggers to lightflow and a new notification type (well that's my guess)
  • There's a new Torch mode API which will be quite nice as it should allow easier control of the camera led flash for notifications than the total non-standard mess that things currently are.

There's enough there to keep me busy for a while!

It won't be possible to publish any versions of the apps with these features at the moment as google don't allow it.

Lite version status

I've had a few people asking why there's no been an update to the lite version for a long time and if it's still being developed.

The answer is yes it's still planned for updates but this last year has been very difficult as I've wanted to try and improve things for full version users.

Version 3.50 (where the interface totally changed) came out in the earlier half of last year and rolled out to paid users first. With it being such a major release there were a number of bugs that cropped up so I didn't push it out to the lite version while trying to get those fixed as quickly as possible.

The main reason for holding back is due to the huge influx in support requests once the lite version hits an update.

Just as this was starting to settle down and I was getting ready for a lite version update, along came Google IO 2014. This brought with it Android-L - the preview release to Lollipop. This caused some pretty serious issues for the app (causing the phone to get stuck in a boot-loop), so the focus was then diverted to getting that working for paid users. The boot loop was actually and Android bug, but given the number of people using it I had to find a temporary workaround.

Ok so that was the main issue with L, but there were others, the new sound modes, the changes in the way repeating alarms (not the wake you up in the morning type, but the programming ones) meant there was a lot to work through.

Focus went onto resolving those. Shortly after this Lollipop started to roll out. Quite a few things had changed from L (luckily including the boot-loop bug) but led cycling was still really inaccurate.

I've since had a couple of attempt at rewriting things to get this to run better without causing too much battery drain, but things still weren't great. So for the last couple of months the focus has been on totally rewriting this area - which has been pushed out in the 3.54 release just rolling out.

Now the focus moves onto getting the lite version up to date. It's nearly there but I'm wanting to get in-app purchasing added so people can move from the lite to the full version without needing to uninstall and download a new app - I'm in a race against time on this as we are now coming up to Google IO 2015 which I'm hoping doesn't hit quite as badly as last year!

Screen based Notification

Version 3.54.2 of Light Flow introduces a new method of getting notifications which is handy for phones that don't have a notification LED where you still want to get a visual notification of a notification.

Older version of Light Flow has a "Switch screen on" option for notifications, but it was a bit unreliable and only switched the screen on for approx 5 seconds without any control. It also caused some issues on phones where it switched the phones default screen timeout incorrectly.

This has all been replaced with a much more reliable method - now it's possible to set choose from a list of different lengths of time to switch the screen on for.

To use different switch on times first you have to grant Light Flow an administration right that allows it to instantly lock the screen. This can be access from

Light Flow->Settings->General settings and is the the option shown in the screenshot below


You will be promoted to enable the setting in android's system menus and then should have access.

Then to enable the "Switch screen on" option, go into Light Flow->Notification Settings and select a notification you want the screen to come on for.







At the bottom of the "Notification" tab you'll see 5 options which are described below:

  • Switch screen on - this switches the screen on when the notification first arrives.
  • Full Brightness - by default the screen will wake in a dim state, but you can change to full brightness. Note the brighter the screen the more battery will be used.
  • Screen on Length - allows you to select how long the screen should stay on for. Shorter times will use less battery.
  • Wake screen when in pocket - with this you can save some battery power by having the screen not switch on when it's in your pocket, in a case with the screen covered or when the phone is face down.
  • Repeating - this allows you to keep the screen flashing until the notification is cleared. As the repeating cycle of notifications is generic across all notification types the timings are set for this in another page described below.
Repeating notifications
If you select a repeating notification in notification settings you can change the settings for how often the screen switches on and for how long. This is accessed from Light Flow->Settings>Notification control style. As shown below


There are three settings for this

Cycle speed - How frequently the screen will switch on when the phone is locked to help you spot the outstanding notification. The faster this is set the more battery will be used as the screen will be on more often.

Wake screen when in pocket - if this is enabled then the screen will wake up even when in your pocket, face down or in a case with the screen covered and will therefore use more battery. 

Screen on length - the length of time the screen will stay on for. Note these timings are short to ensure not too much battery use. While testing some phones won't wake the screen on the shorted duration of 0.3 seconds and required slightly longer duration to give the phone time to switch the screen on before it's off again.



Live wallpaper
Up until now all the settings only switch the screen on. This can be handy for knowing you've a notification, but if you have the phone on a table across the room or on your desk you'll probably still have to go over to the phone to see what type of notification it is to decide if it's important enough to look at now.

We spent a while evaluating how to get a good visual notification onto the screen. We looked into lockscreen overlays but these enforce you to have an extra step before getting to your lockscreen which felt incontinent. 

After a bit of experimenting instead of showing an overlay on-top of the screen is seemed better to show something underneath the lock screen details so you can still view and unlock the phone as normal without any extra steps. A live wallpaper seemed the best approach to this.

There's a link in light flow's nav bar to access the live wallpaper or you can access control of it via the normal phone's wallpaper selection options. Once you've chosen Light Flow you can see the settings page:



The top section will show a default wallpaper but you can just select any images on your phone as an alternative picture.

Scrolling background - this should work on all devices but not all homescreens - some HTC and Samsung home screens will ignore this setting. The scrolling happens to move the wallpaper slightly as the homepage screen is scrolled fro one to the next - similar to on Nexus Devices with any wallpaper.

Lock screen notification display style
When you've got several outstanding notifications all set to repeat this option determines how to display them. You can either have one notification color show each time the screen wakes (ie cycle around each outstanding notification) or all colors show every time the screen wake.




Lock screen layout
This section determines how to display the outstanding notifications visually. 

Horizontal stripes - display a list of color bands across the screen horizontally for each outstanding notification (or just one notification if set to cycle colors)
Vertical stripes - as above but with the bands vertically
Side notifications - just show a color down the side of the screen and black for the rest of the screen

Below are a couple of examples:



Vertical stripes


Side notifications





LED behaviour differences between android 4.4 - 5.0 and 5.1

Android has always been on a rapid release cycle and still continues to be which means that across different versions the way your phone or tablet work may vary several times over a short period of time.

One area that has particularly caused issues for Light Flow users is when the LED displays.

Since the earliest versions of Android up until android 4.4 the led would be on if raised by an application as long as the screen is off. As soon as the screen is on the LED shuts off. There's no options to alter this behavior without root access on the phone and even then it's only possible if your ROM or lightflow can directly control the LED drivers bypassing Android.

Android 5.0 brought in an additional time that the led doesn't show. If the phone is in "None" or "Mute" sound mode (varies depending on the manufacturer to the name used) the LED will also not show. For a lot of people this has caused quite a bit of grief as they rely on the LED more when in silent mode to be aware of notifications.

Luckily Android 5.1 reverted this change so now the LED will show again when the phone is muted. If your phone is currently still on Android 5.0 then hopefully your manufacturer will push out an update soon to bring back the old behavior.

 
Copyright Reactle Ltd