I have a Sony Xperia Z1 Compact. Nice phone.
It runs Android 5 (Lollipop). I'd had it a little over a year (the phone had been out for nearly two years by then) when Android 6 (Marshmallow) was released, but the Z1 series didn't get the upgrade. The latest kernel is dated November 2015.
OK, I understand that a manufacturer can't support old hardware for ever, but a less-than-two-years-old phone is not "old" hardware. I had expected I'd get to at least Android 6 and hoped to get to 7 before updates stopped. Bad Sony.
When the phone was a little over two years old it developed the nasty habit of suddenly claiming that the battery had reached 0% charge, when a moment or two before it had been at around 50%. The battery is sealed in, so hard to replace -- it also turned out to be quite hard to source.
I managed to get a battery which was said to be new (with "zero charge cycles") but may not have been. I had to heat the back of the phone to soften the glue and prise it open to put the new battery in. This, of course, wrecked the waterproofing, which had been one of my reasons for buying the Sony in the first place (I walk a lot, and sometimes it rains). Nonetheless I carried on using the phone with its old OS until the replacement battery started to display the same sudden discharge behaviour*.
I'd love to buy another Xperia phone, but I won't do so until they make the battery officially user-replaceable, and give some commitment to supporting Android updates for at least (say) three years from the release of the phone. Oh, I'd like it to be dual-SIM, too ... is that too much to ask?
* I suspect that the battery isn't really dropping from 50% to 0% in a couple of seconds, but that the battery monitoring circuit in the phone is uselessly optimistic until the voltage drops a little under load (because the user has, say, turned the screen on) and then it panics and turns the phone off. Maybe later Xperias have fixed this?