The Google Pixel 2 XL is plagued with a thousand issues, quite a few of which concern the screen. Now a new issue has come to light - many users report that the screen flashes when locking or unlocking the phone. The issue seems to be related to the ambient display. Some have found that disabling this feature prevents the issue, others say that even just toggling it off and then on is a temporary solution. This could prove to be a software issue so it could be fixed with a future update. So far the smaller Pixel 2 seems unaffected. Recently, the Pixel 2 XL screen has had black...
Source: https://www.gsmarena.com/pixel_2_xl_screen_flash-news-28172.php