Sony is rolling out a new update 51.1.A.4.173 for Sony Xperia XZ2 and XZ2 Compact smartphones. The new patch has added latest Android security patches for the month of May.
The latest Android May Security patch fixes Common Vulnerabilities and Exposures (CVE) in the open-source Android OS. In addition, there are various other fixes and improvements.
Sony Xperia XZ2 and XZ2 Compact update 51.1.A.4.173 will gradually release to everyone. You can also check manually for updates, go to Settings > About device > System update.
Make sure you have enough charge on your device at least 60% to 70% before downloading the update.