Good afternoon, situation:
I am developing an Android application that serves as a sports tracker / navigation application, so it requires a constant connection to GPS, as well as constant wakefulness. Recording is performed every second.
The current solution, working for many years, thanks to wakelocks that the device is not working.
Doze mode in Android 6.0+ complicates the situation, but that's not the point.
There is probably another type of optimization on the Huawei device.
Here is the part of the magazine:
10-10 10:33:18.462 1014-384 D/PFW.HwPFWAppWakeLockPolicy: getUidWakeLock uid: 10097 wakelock >= 10 mins 10-10 10:33:18.543 1014-384 D/PFW.HwPFWAppWakeLockPolicy: force stop abnormal wakelock app uid: 10097 10-10 10:33:18.558 1014-384 I/ActivityManager: Force stopping menion.android.locus appid=10097 user=0: from pid 1014
So, after approx. 30+ minutes, the system will simply decide that the application uses too many wakelocks and completely terminates it with all services, history, just kill .
Any experience with this behavior and any suggestion, how is this simple task (constantly recording GPS location with the screen off) better?
As I wrote at the beginning, on all other devices except the new Huawei, such a system has been working correctly for many years.
EDIT : Note after one user’s comment (deleted?), The whitelist application in Huawei Battery Manager (mark as a “secure application”) does not affect this problem.
android huawei gps wakelock
Menion asamm
source share