[SuperSU] mag01:
1.99r4 and battery drain issues

[MENTION=631273]Chainfire[/MENTION]

I did focus on these 3 cases where 3rd and 4th are the most interesting ones.

1st case was added just for comparison with 3rd - the only difference between them is whether the Greenify is allowed or not.

1. set to FKU prompt only

- after approx 2.5 minutes of screen on it goes off and then it seems fine

- all su attempts (incl. 1 from Greenify which is allowed) visible in the SuperSU log

3. set to FKU and Greenify prompt, but nothing for Greenify to hibernate

- after approx 2.5 minutes of screen on it goes off and then it seems fine

- but Greenify's su attempt (there should be one denied that should match that 1 from the 1st case) isn't visible in the SuperSU log, even refreshing the log view doesn't make any difference

- also only FKU is mentioned in the notification of silently denied apps, Greenify is missing here

4. set to FKU and Greenify prompt, but there's an Opera browser running for Greenify to hibernate

- after approx 2.5 minutes of screen on it goes off

- after another ~ 4 minutes the sreen goes on again and stays on for ~ 30s, then goes off

- then again after another ~ 4 minutes the sreen goes on again for 30s etc. I didn't test this for longer but it will probably keep doing it several times, maybe indefinitely. It's caused by Greenify so it depends on how many times it will retry after failure.

- Greenify's su attempts are visible in the SuperSU log this time, however I've got a feeling that there should be one more Greenify entry - the same as in the 1st case which is also missing in the 3rd case

- both FKU and Greenify are mentioned in the notification of silently denied apps

So it's definitely better, but something still seems to be not right.

1. There seems to be a concurrency issue when multiple su attempts occur simultaneously when the screen is locked (missesd Greenify in 3rd and 4th case).

2. Su attempts still switch the screen on and then it heavily depends on how the apps are written and how often they attempt to su. It would be better to not let the screen go on in this case though I can understand it may be hard to implement.

Attached logcat log from the 4th case (it should be enough I hope)

Note: Android 4.4.3 this time (Nexus 5, stock ROM)

EDIT: I found one glitch related to the new notification, the steps below were done with FKU but the same may happen with other apps:

1. set to FKU prompt (not in the SuperSU applications list)

2. reboot

3. turn screen off

4. let the FKU to fail on its su attempts that way so that the notification would show

5. turn screen on

6. notificaton will show denied su attempt - that's correct

7. run FKU, let allow its su attempt interactively, allow forever it without any limitations

8. switch to launcher

9. remove FKU from recent apps (which should end its process) - this is important, otherwise the thing described below (12) won't happen

10. turn screen off

11. turn screen on

12. notificaton will show denied su attempt - that's incorrect one, it shouldn't appear (also no related su attempt is shown in SuperSU log view)

It isn't that big deal as one usually doesn't need to remove apps from recents, but I do it from time to time to keep that list clean of not much used stuff