Edited by R0user at 2016-09-06 03:50 PM |
01.jpg (39.35 KB, Downloads: 27)
2016-09-06 15:29:53 Upload
Ever since the advent of MIUI over Marshmallow, there has always been Questions regarding the fate of most talked about feature of Marshmallow:
with the advent of MIUI 8 (Marshmallow), It will rise only stronger.
Here we will try answering the same, for once & all, together.
Before we go & discuss about it's presence on MIUI 8 (M), let's dive into Doze First.
Doze, as just a term, was used in Kitkat (API 20) for wear later for primary devices with Lollipop, for a mere meaning a "display state" - A new low power screen-on mode for showing non-interactive static content temporarily.
"Doze Mode" introduced with Android Marshmallow holds a different meaning.
It's a forced-idle state of OS where little or no background processing is allowed, specifically when user isn't actively interacting with the device.
Q. We already have a Deep Sleep mode for our processor, how Doze differs?
- Deep Sleep is a state of Processor with very low power consumption, while Doze mode is a state, let's say, of an OS. The more time processor be in Deep sleep state while doing nothing, less power will be spent.
The system & so the apps in it, can hold the processor in the Active state to do something by the use of "wakelock". Even when the screen is off "Partial wakelock" can stop CPU going into the Deep Sleep state, so it might not even enter or for just a fraction of time; wasting energy. This is where Android 6.0 Marshmallow (API 23) came with the answer - Doze mode. It works as a guard in between the apps and cpu, by deferring Background CPU and Network Activity for apps when device is unused for longer periods of time & smartly batching the requests and processing together only at regular interval of time. All this, when it detects that you're not using the phone "actively" (by using the motion sensors)
If a user leaves a device unplugged and stationary for a period of time, with the screen off, the device enters Doze mode. In Doze mode, the system attempts to conserve battery by restricting apps' access to network and CPU-intensive services. It also prevents apps from accessing the network and defers their jobs, syncs, and standard alarms.
Periodically, the system exits Doze for a brief time to let apps complete their deferred activities. During this maintenance window, the system runs all pending syncs, jobs, and alarms, and lets apps access the network.
02.png (57.76 KB, Downloads: 20)
2016-09-06 15:31:03 Upload
At the conclusion of each maintenance window, the system again enters Doze, suspending network access and deferring jobs, syncs, and alarms. Over time, the system schedules maintenance windows less and less frequently, helping to reduce battery consumption in cases of longer-term inactivity when the device is not connected to a charger.
As soon as the user wakes the device by moving it, turning on the screen, or connecting a charger, the system exits Doze and all apps return to normal activity.
The following restrictions apply to apps while in Doze:
Doze support requires the following:
For MI3, testing shows this
03.png (43.35 KB, Downloads: 28)
2016-09-06 15:32:24 Upload
DeviceIdleController is the primary driver of Doze - Let's refer it to device idle mode instead of doze mode since that better fits the code. Going through the official documentation gives the commands to manually enter into doze mode.
dumpsys is a binary that interacts with system services. deviceidle is a new system service
we are checking with the MI3W, Lets scan the device services for deviceidle service presence.
04.png (19.67 KB, Downloads: 19)
2016-09-06 15:33:36 Upload
As you can see, the service actually exists.
(I'm assuming you already know how to be in debugging via ADB)
This new service is registered at all times to listen for the following system events, which can trigger it into (and out of) this new idle mode:
DeviceIdleController maintains a state machine that contains different states. we can manually drive into each state like below & check the behaviour of system.
after entering into the IDLE , it wll only switch back & forth between IDLE & IDLE_MAINTENANCEPress power button once & you will be stepped to ACTIVE state, whenever you want.
- Remember, we are manually driving into the doze(idle) mode.
- The device needs to be locked via power button to switch to different states, otherwise only "Active" you will see.
- After execution of "battery unplug" , "adb shell dumpsys battery reset" is necessary at the end of test or you will not see USB charging.
- You can also use "adb shell dumpsys deviceidle force-idle" too skipping both the commands directly.
Let's leave it to the IDLE state for about 15 Minutes and check for BBS graphs.
Yes, surely It works manually.
In Real world scenarios, Doze doesn't fire that fast, it fires only after predefined time (after above mentioned 3 conditions are met)
Leaving the phone on baterry, unplugged & untouched - Here are the results.
07.png (33.71 KB, Downloads: 27)
2016-09-06 15:43:51 Upload
08.png (30.79 KB, Downloads: 23)
2016-09-06 15:43:52 Upload
MIUI 8 (M) users, Yes DOZE will work in the background (as long as your device meets the requirements)
For MI3W, yes Doze is definitely working in the background of MIUI 8.
- Redmi 7
- Redmi Y3
- Redmi Note 7S
- Redmi K20 Pro
- Redmi K20
- Redmi 7A
- Mi A3
- Redmi Note 7 Pro
- Redmi Note 7
- Redmi Go
- Mi TV
- Mi A2
- Redmi Y2
- Redmi 5
- Redmi Note 5 Pro
- Redmi Note 5
- Redmi 5A
- Redmi Y1
- Mi MIX 2
- Redmi 4
- Redmi 4A
- Redmi 3S
- Redmi Note 4
- Redmi Note 3
- Redmi Note
- Redmi 6A
- Redmi 6 Pro
- Redmi 6
- Redmi Note 6 Pro
- Mi A1
- Mi Max 2
- Mi Max
- Mi 5
- Mi Phone
- Mi Band
- Air Purifier 2/2S
- Mi Router 3C
- Mi Pad