Whitelist fix
Tries to avoid shell commands getting ahead of each other. Could probably keep things async and reload whitelist upon completion. Small logic and object reuse change. Seems to work.
I was about to merge this but noticed some conflicts. Would you mind resolving the issues with this commit (and the previous ones) and re-test it to make sure it works fine. After that I will merge this and push an update to Play Store.
The commits needs some fixing as it seems that this whitelist fix PR includes other unrelated commits. This is same for other PRs that you have submitted.
It seemed to be minor conflicts which I have resolved to the best of my ability. But as I've said, I am new to GIT and they were funky cumulative patches, each new one including all the previous. I wouldn't mind testing it, but I really have no idea how to fetch the files resulting from the resolved conflicts.
All said, I see no reason why it should not work. Perhaps a tempWakeLock.release() got in a little to early in one of the enterDoze() methods. It seems to me these should be placed as late as possible.
You can follow the steps here to create a new PR with only specific commits, you should do that with other PRs as well: http://blog.asquareb.com/blog/2014/06/19/making-a-git-pull-request-for-specific-commits/
You can also create a new branch for each PR, and send a PR for each branch, containing the respective commits.
There's plenty of information available on the internet on how to create PRs properly. I can cherry-pick the commits myself in each of these PRs, but it would be better to have a PR which is properly set up in the first place.