I am runnning an app or service with a active Bluetooth LE scanner and showing scan results on Log console. If I lock the phone in a table and not touching anymore. After a time it stops, and it doesn't give me more scan results.
If I press power button and the screen wake up it gives me more scan results. If i lock again the screen or wait to lock automatically it stops and not give me more scan results.
I test with service and an app that give me more results by Log and see the app is running but scanner LE stops and no give me more results while the screen is lock.
I have the app in "no optimized battery" for doze mode. I test forcing by command introducing the phone en doze mode and work fine it give me scan results.
In my Nexus 5 with Android 7.1.1 pass when running APP and lock the screen and not touch anymore the phone. The time is 30 minutes. The phone is in a table alone, only connected with microusb to see the log in android studio.
In other Moto G2 with android 7.1 pass exactly but the time is between 20 minutes and 40 minutes, it is more aleatory. The phone is in a table alone, only connected with microusb to see the log in android studio.
For have running well again, I need to force close the app manually and restart, otherwise only works when screen is active and no give me more results when screen is locked.
This is used for beacon results, first I use Android Beacon Library for this purpose and the result was the same.
I think it is a problem of android bluetooth component, because I have the same result with the Android Beacon Library or if I implement my own BLE Scanner, but I don't know how to solve this.
Are any form to use Bluetooth Scanner LE always running in Android when the phone is much time in lock state??
Thanks in advance.
Best regards.