0

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...

Alexandru Circus
  • 5,478
  • 7
  • 52
  • 89
  • 1
    "The app will be affected by the new Doze app state?" -- probably. Since your app can record while in background, I am assuming that you are not holding a full wake lock (keeping the screen on, etc.), but instead are holding a partial wake lock. The only way that will work is if your app is whitelisted by the user, or if the recordings will be completed before Doze mode starts (e.g., they are all under an hour), or if the user is doing other things to prevent Doze mode in general (e.g., keeping the device on a charger while recording). – CommonsWare Oct 07 '15 at 13:10
  • @CommonsWare - thank you. I think a good practice is to show a dialog when opening the app where the user is asked to include the app in the doze's whitelist. – Alexandru Circus Oct 07 '15 at 13:35

2 Answers2

1

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.

Community
  • 1
  • 1
sec_aw
  • 1,594
  • 1
  • 15
  • 26
0

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.

greywolf82
  • 21,813
  • 18
  • 54
  • 108