Priority: P2: Important
Resolution: Out of scope
Affects Version/s: 5.7.0
Fix Version/s: None
Environment:Dev machine: Linux x64, Qt 5.7.0, compiler Android GCC arm-4.9. Tested on Android 4.2 , 4.4 , 6.0
Android Service does not work when phone is locked and no debug usb cable is attached to the Phone.
I have prepared small example here:
It has two counters. First one is from Android Service where QTimer runs with 1 second interval and increments "counter" variable and sends value back to application. Second counter simply displays seconds difference between time when "reset" was pressed and current time.
If Android Service works it counts seconds, so the two counters should be the same.
To replicate error:
Install example, disconnect debug cable from phone, restart counter, lock phone, wait a minute or so, unlock phone - counters are not the same, which means Android Service wasn't counting seconds
If I add gps to the main activity, and set it for updates every 3 seconds, service works in background.
I can't add gps to the service, because it crashes on QGeoPositionInfoSource::createDefaultSource(this);