For developers wishing to tinker with Sony phones, the Open Devices program is a welcome official point of entry. The Japanese company adds most of its high-profile Android handsets to the list of supported devices after a little while, and the Xperia XZ2 and XZ3 are the latest to join the ranks.
Sony doesn't stop short of allowing bootloader unlocking and flashing of custom ROMs, but also provides AOSP build guides and other resources. There's also a GitHub project for each phone to encourage the open source community to get involved and collaborate.
You can learn more about the program and see all the documentation on the Sony site. I reviewed the Xperia XZ3 and really enjoyed using it — it's the best Sony phone in quite some time. The Open Devices program makes it and other Sony phones even more appealing.
Sony has now updated its blog post to add the Xperia XZ2 Compact, so good news for anyone hoping support for that would also come.