- First part of your question "Firstly, let's assume its locked, how much time is required for Doze, working to save power?"
Idle time is not specified by Google and I guess this is implemented differently by OEMs
Quoting from Google documentation Optimising for Doze and stand by (emphasis added)
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.
Edit : This may answer from a user perspective as this is what developers are apparently planning 9 minute interval
Dianne Hackborn17 Nov 2015
+Petr Nalevka Sorry scheduling alarms so frequently is currently not supported in doze....For what it's worth, the minimum time between while idle alarms will be changing to 9 minutes at some point relatively soon (even on devices running the current Marshmallow builds).
- Second part of your question ".... if the smart lock is acting (like by geographic location), keeping device unlocked for several hours (is six the limit, right?), how will this affect "Doze" functionality? (and a related question of yours How Doze (marshmallow feature) work during playback?)
It is difficult to answer this correctly as
As can be seen from the answer to first part of question, developers seem to be improving / modifying the behaviour of "Doze" functionality and only once it is matured and implemented, one can reach a conclusion.
As can be seen in this post https://stackoverflow.com/questions/33018306/doze-mode-and-foreground-service, thanks to Firelord for highlighting this
, documentation by Google is lacking in details and developers/ OEM may implement varying behaviors, so nothing can be said at this point of time with certainty.