I wasn't saying all Android phones had lower quality than iPhone, I was simply using the G2 as an example because of my own personal experience, and I figured the G2 is an example of the typical flagship Android device from 6 years ago.
I know there are many Android devices with higher quality and some with lower quality. In fact, I just got an LG V20, to replace my Stylo 3 Plus. Stylo 3 Plus was a lower-mid-range phone, had really bad build quality and a bad screen. The LG V20 has excellent build quality(I like it because of it's all-metal construction, removable battery, 5.7" 2560x1440 LCD + 1.2" second screen, has a 16MP + 8MP rear camera, and it also has FM Radio and IR blaster, 4GB RAM and 64GB internal storage and a microSD slot. Hardware-wise, it's IMO better than current-gen iPhones.
I considered myself a die-hard Android user for a long time, but it's recently that I really decided to go in on Apple products(I opted not to get an iPhone for this phone upgrade, because I don't want any screen smaller than 5.7" and I only buy used phones. I'm not going to pay $750 for a used iPhone XS or XR, because for that price, I could have bought a new one).
I do agree with you, Android 6 and 7 were way better than Android 5, Oreo(Android 8) is the best IMO. Android 5(Lollipop) was a sh!tshow at first(remember the memory leaks?), I suspect that was because it was the first release to switch from Dalvik to ART by default, so there were still some bugs that needed to be fixed, along with the fact that Google completely overhauled the UI.
So, to recap, I didn't mean that *all* Android phones have bad quality, or that all Android phones will have those kind of problems. I was just saying that based on my personal experience, the G2 a typical flagship Android from 6 years ago has not aged as well as a 6-year-old iPhone.