I looked into this because I find I want something I can stuff into a trouser pocket. The only reasonably viable android option was a Sony Xperia XZ2 compact, from 2018 on android 10. You can put lineage on it which is currently maintained, but that has the downsides of not passing device integrity which some apps will check, or being willing to constantly play cat and mouse to spoof it. Sony also apparently wipe a partition with a little DRM blob for the camera, which degrades some aspect of its post processing capabilities so image quality might be less. There's also the iPhone SE3 which is currently in support
I ended up getting a 'regular' sized samsung only slightly larger than the one it's replacing, but at least modern phones seem to be getting longer software support periods (assuming there's no nasty surprises included).