Ambient display on the Android O developer preview is doing some odd things right now. It’s showing a minimal and less useful UI for some people, while others see something more akin to the old version. Whatever is going on there, we do know of one small (but useful) change to ambient display in O—covering the proximity sensor now puts the phone back to sleep.
In Nougat and earlier, ambient display won’t kick on if the proximity sensor is covered.
Android O feature spotlight: The proxiomity sensor can turn off ambient display was written by the awesome team at Android Police.