简体   繁体   中英

Android Doze mode for motion sensors

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?

  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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM