Android Doze Mode - Bluetooth

My question is pretty simple. I would like to know that this is the best practice for my application, so this may be "Doze-proof". This becomes even more relevant as Android N will use Doze in a more random scenario.

When reading the Doze Documentation, there is a link to network access :

In the "Dosing" mode, the system tries to save the battery by restricting applications to access networks and resources that use CPU intensively. It also prevents applications from accessing the network and delays their operation, synchronization, and standard alarms.

I believe that the Battery falls under Network access , is that right?

Since I do not have a device with the Marshmallow device (or Android N) turned on, and since the emulator does not allow interaction with Bluetooth, I can not check the behavior of my application in Doze mode.

Will Doze mode kill any current Bluetooth connection ? The same goes for Bluetooth Classic and LE? What about Bluetooth A2DP headsets?

My application must support this connection, otherwise the basic functionality will be broken.

Of course, there are some exceptions for the case when your device should be connected to the remote Bluetooth device as long as the user also wants.

I know there is a Doeth Whitelist , but it might seem that in some cases the application may behave the same as on a device below API 23.

Thank you for your help!

+5
source share
1 answer

It seems that the dose has no restrictions on bluetooth as such, but to do something meaningful, you will need to keep the processor on and unlock the locks, ignored in a deeper dose.

If this is the main functionality of your application, you can ask users to whitelist your application. This can provide partial tracking locks and save the processor.

Foreground services are also exempted from any dose restrictions to another transparent way.

0
source

Source: https://habr.com/ru/post/1244929/


All Articles