aprsworld / awat

APRS World Android Telemetry
1 stars 0 forks source link

Device is going to sleep stopping AWAT from running. #11

Open davarus opened 4 years ago

davarus commented 4 years ago

The device should NOT go to sleep in continuous mode at all and otherwise should wake up and not sleep while GPS is running.

davarus commented 4 years ago

So this is apparently a complex issue because Google is forcing changes and not allowing over-rides that are designed to improved battery life and privacy on Android. The two issues are Application Idling and Doze mode.

The documented work around is to whitelist the application from Battery Optimization but this does not fully solve the problem as even whitelisting the application won't over-ride the device completely and it will still go to sleep and add restrictions to the device. Further whitelisting the application alone seems to result in stricter handling of things like disabling the location and networking immediately when the screen is off and the device is unplugged instead of after a period of time.

I have looked into hacks to get around all this, but there don't appear to be any that actually reliably work. Google's recommended solution is counter to how this application is supposed to operate and wants you to use the Job Scheduler for network connection which could be as infrequent as once a day and to process things as they come in which would result in the readings not being on the top of the minute but whenever they come in which again could be random times delayed at least 15 minutes. This would require a major redesign of the application in addition and is not what we need.

I have unsuccessfully looked for a work around, but there has to be one because leaving the screen on with a Wake Lock solves at least some of the problems but that's no good. Music streaming applications don't have this issue so there has to be a work around but I haven't found it yet so I'm leaving this issue open and not tagging it as wont fix.