-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Battery saver #229
Battery saver #229
Conversation
One known issue. The connection wake lock release code needs a boolean check in an Exception code block. I can't remember but think it resulted in an app crash. Added 1e1a31a commit to deal with this. Its been too long and I don't know what happened now lol. But, that line was added in this pull request for the connection wakelocks so it should work as expected if it was a problem. Might only have been a problem seen during code changes as that's when I noticed it and not during normal use. Half the reason why I'm lost on it now :) |
…line was added specifically for this pull request and for connection wakelocks.
Sorry, just noticed an issue :'(
For some reason isn't actually keeping the screen on lol. Not with Android 14 and not with Android 8 either. The wake lock definitely appears to be running and isn't being ended in the code. So, I need to look into this. I don't know what happened there. Edit: I see. Made an oops. I know what happened now. When I looked at the hover popup documentation, it says use the flag under deprecated, so I used it there at that time and left it like that lol. Probably when I was confirming it and making final changes and reverting and changing things and testing things. They wrote that there not clear enough. I wonder how many people that got? :)P Can't be just me. Only problem now is that it requires the Activity... I may just revert it to the old FULL_WAKE_LOCK. Now I wonder if it had stabilized before because of no wake lock at all since that flag wasn't working or I had a static Activity for testing there. Quite sure it was static for testing. Kind of remember that now.... Added pull request #241 to fix this. Tried getting it added here with a request for you to add it but that looks to be "not going to happen". I will add it to a new pull request as a duplicate one is not looking like a good idea. |
Adding here various new tests for Android 14 to find ways of dealing with its forced over aggressive power saving... This will be updated over time for as long as I have Android 14 to test with and have reason to, Indirect connection influenceso AOD: Sleeping connection moves again each time the AOD time changes but it may also sleep a lot.
Time differences (all A14 and scoped storage)Set 1 (has 1k files, and 400 dirs more than the other sets)
Set 2 + reboot WIFI AP
Set 3
Set 4
o Battery % has nothing to do with times. Testing has gone down into the 20% range. o Had to move to fully using experimental list improvement to deal with the bad sleeping issue. o Experimental list improvement is more important than I thought. Will look further into that and testing sooner than later. o Might be possible that there's another battery saver switching bug as the one LOW + AOD had low times but am not sure at this time. o Debugging affecting times is a bit of an annoyance for certain things. o Target time to get as close as possible: 45 min Android 8 java.io.File (match of sets 2-4) HIGH + CPU FULL + background. Saving about 50% ms on each file/dir would get it there. |
Adding here Android 14 sleep problem (where it awakes eg automatically, above on AOD time change, when screen is manually put on, etc)... This appears to be only or normally happening only during listing (MLST, LIST, etc) and appears to be happening on DocumentFile and DocumentsContract code such as documentFile.getName() or buildChildDocumentsUriUsingTree(). Also do not understand why its continually on listing and not on similar use during transfers. Thread priority doesn't appear to make a difference. Both use data connection and other same things. Understanding this could maybe provide a solution. However, experimental list improvement does work in current testing. Scoped storage experimental list code is showing to be a fix for this. As its importance has increased, will work on further testing of it. |
Closes
Battery saver
Some quick notes:
Other notes:
Issues seen with causes noted (more causes can exist):
Connection timed out
No route to host
Examples to adjust Android OS battery settings for apps:
Original info I wrote to figure out what was going on with the loop I removed in FsService run() that I didn't want to leave commented in the code for this pull request.
So what does actually happen after this point here...
which it removes but also adds so its always there and not lost. registerSessionThread() is
mostly remove/cleanup so its a bit oddly named. Don't get thrown off looking at it.
listenSocket.accept() blocks until new connection is made. Has no timeout, etc. Thus,
everything stays working, socket stays open, clients can connect, etc.
while its blocking. Once it receives the next connection is made, everything loops again. Repeat.
cleans everything up. When server is toggled on again, we arrive back here.
However, removal tested without a single issue. Tested for months, tested against original during any seen problems to the same result. Zero difference found except for lower battery use :)
Again, no loop + full wakelocks + battery saver at HIGH with app running in bg (no foreground use at all) had super smooth connections with 0 connection failures or delays for 10 days straight. Logs for all connections watched with times visible. Connections in UIs always heavily watched. Android 14.