If longevity is important, I’d go for flagship models. Also, I’d avoid Oppo as they’ve just been caught selling user data. I’d also stay away from Huawei (or any Chinese manufacturer, for that matter) because they supposedly have “too close” of ties to the government and are probably sharing data as well.
We’ve had a couple of Korean phones which didn’t make the 2-year mark. Interestingly, it was the motherboard that went on both of them. My HTC Incredible S went 5 years. It’s still my backup phone should I need one. I currently have the HTC 10, and my wife has the HTC U11.
I’d recommend the U11 for its overall performance, excellent sound quality, great camera, and light touch with the Android operating system (not a lot of extra crap). Don’t let a stock keyboard app jar you. As mentioned, choose a different app (I recommend SwiftKey).
Do some research on it. Vlad at The Verge called it the best phone of 2017. Read what some of the better tech blogs are saying about it. Find some YouTubers who know what they’re talking about (phone geeks with hundreds of thousands, if not millions, of followers). A lot of them are saying the same thing: the U11 is the best phone people aren’t buying. And, just so we’re clear, people aren’t buying because of HTC’s bad marketing, not because they have a disappointing flagship.