4

I have question(s) related to Android Doze Mode (Android N [deep doze] and M). As per Android official documentation once device enters doze mode, it stops receiving location updates either via GPS or Network.

And to exit doze mode, either screen turns on or power plugged in. But how about

1) In doze mode if device is moved but screen remains off. Will device exit the doze mode for movement?

2) In Doze mode are sensors such as Gyro or accelerometer are they working or also stopped?

Adil Bhatty
  • 17,190
  • 34
  • 81
  • 118

2 Answers2

6
  1. Sure, device will leave the Doze mode. Because as written in Android Doze docs, device will be in Doze mode, only if it's stationary.
  2. There are two type of sensors.

    • Wake-up sensor: ensure that their data is delivered independently of the state of the SoC.
    • Non-wake-up sensor: do not prevent the SoC from going into suspend mode and do not wake the SoC up to report data.

    Accelerometer and Gyroscope are non-wake-up sensors, so they will be stopped. From Android Sensor Type page.

mrcrambo
  • 484
  • 2
  • 5
  • 13
  • 1
    Accelerometer and gyroscope are not necessarily non-wake-up. It is device specific. For example, fossil sport has wake-up accelerometer and gyroscope. Source: https://source.android.com/devices/sensors/suspend-mode#how_to_define_wake-up_and_non-wake-up_sensors – Scott Driggers Jan 20 '21 at 06:55
3

This is a very good question. First, be aware that doze mode has two states : light and deep.

1) It is possible. First enters in deep doze mode with the "step" command to be in idle_maintenance state. Then shake your phone directly after. If you print the history (see command below), you will see this :

  • deep-idle: -23s222ms
  • deep-maint: -16s621ms
  • normal: -12s431ms (motion)

2) When forcing doze mode with adb, the sensors are still making acquisition. That's for sure. But still not sure if this forced mode is exactly similar to letting the device entering in doze mode by itself.

Those are the command I am using to enter in deep doze mode.

adb shell dumpsys battery unplug
adb shell dumpsys deviceidle step deep
[... each time you change the state of deep mode - several states]
adb shell dumpsys battery reset

You can also check the parameters and history of doze mode by just entering this command :

adb shell dumpsys deviceidle