image source: 9to5Google
Screen burn-in is one of the unfortunate realities of OLED. Manufacturers are well-aware of this shortcoming, and yet, at this point at least, there is not much that can be done to completely prevent it hardware-wise. However, there's always the option of mitigating the issue through software, and that's exactly what Google is trying to do for its Pixel lineup of smartphones.
One of the biggest culprits for screen burn-in on the Pixel 2 and Pixel 2 XL, as well as last year's models, is the persistent navigation bar that Google uses – a black stripe with bright, white buttons. Since the navbar is almost always on-screen, after extended use, it leaves its mark on the OLED panel. To combat this, Google is introducing a burn-in protection feature in Android 8.1 Developer Preview that will dim the navbar after a short period of inactivity. Google is also encouraging developers to adopt a light navigation bar for their apps—light gray with dark gray buttons—to even further diminish the possibility of problematic burn-in.
The company is setting an example with the latest beta version of the Google app, which features a light navbar on Pixel and Pixel 2 models running Android 8.1 DP.
The latest version of Google app introduces a light navigation bar to minimize screen burn-in on OLED displays" 
Another change that Android 8.1 will bring to the table to combat screen burn-in is a lower max brightness for the Pixel 2 XL. The maximum brightness of the handset will be lowered with 50 nits.
Things that are NOT allowed: