According to the new Sony Xperia update policies, the Xperia XZ1 and Xperia XZ1 Compact should get both Android P and Android Q, since they both launched with Android Oreo onboard. Sadly, the mid-range Xperia handsets might not get the same treatment.
https://www.notebookcheck.net/High-end-Sony-Xperia-handsets-will-receive-two-years-of-updates.281312.0.html