Alexandru Circus
Alexandru Circus

Reputation: 5538

Doze app state implications for a voice recording app

I have an android app which records voice using a service - and a thread inside the service(obviously the app can record while in background..)

The app will be affected by the new Doze app state? https://developer.android.com/training/monitoring-device-state/doze-standby.html#whitelisting-cases

I don't have a phone with 6.0 yet and the simulator cannot record voice in general...

Upvotes: 0

Views: 286

Answers (2)

sec_aw
sec_aw

Reputation: 1594

If your service is running in the foreground (with an associated notification) when the device enters Doze mode, it should not be affected according to a comment by Dianne Hackborn to this post. See a documented experience that seems to prove this behavior here.

On the other hand, tests show, that access to certain sensors like GPS are restricted in Doze mode, so this might also apply to the microphone.

Since Doze mode is poorly documented up to now, unfortunately at this point you probably do not get around running your own tests on a physical device.

Upvotes: 1

greywolf82
greywolf82

Reputation: 22183

Yes, every app can be "killed" by Doze. If your service runs in foreground you can avoid App Standby however. Remember that asking to the user to put the app in the whitelist it's prohibited from Google Terms of services, so you can't do it. If you want to do something like that you need to add a permission to your manifest and with cross fingers hope in the Google review of your app.

Upvotes: 0

Related Questions