Always on Display has been a feature on many devices for a long time. Ironically, Google devices never had it until the Pixel 2 and Pixel 2 XL, and they call it "Ambient Display." Unfortunately, Google didn't backport the feature officially to the first generation of Pixels from 2016, probably for the power inefficiency reasons. But we have some good news for you: you can now enable Always on Display on the Google Pixel and Pixel XL. I've tested the method myself and it worked without any problems. XDA Senior Member shagbag913 released a Magisk module which does exactly that, so you need root. If you already have it, you can follow this tutorial:

  1. Download the module from the thread
  2. Open Magisk Manager on your device
  3. From the left-side navigation menu, go to Modules
  4. Tap on "+" FAB on the bottom
  5. Select AODEnabler.zip you just downloaded
  6. Tap on reboot
  7. That's it!

After following the process, Always on Display will be automatically enabled on the device. You can toggle this setting under Settings > Display > Ambient display. Keep in mind that keeping the display on always on has an impact on battery life, despite the fact that Pixel and Pixel XL both have AMOLED screens which are capable of completely turning off the unused pixels on the screen.

The method currently only works on Android Pie. The author mentioned that he will add support for Android Oreo and lower later. This module uses an RRO overlay which sets the Always on Display string to "true" and packs that into an APK. The module then copies the overlay to /system/product/overlay/, so that's why it only works on Android Pie for now. You'll also need to get Magisk 17.0+. You can download the latest version of the rooting solution from the Magisk Hub on the XDA portal.

Always on Display Enabler Thread