People aren’t going to do without phones and at least in the US where all of the major carriers offer 0% interest payment plans. Over the course of two years, the monthly price of an iPhone isn’t that much more than a cheap Android phone. All most people care about is the monthly cost.
Also, Apple unlike any other phone manufacturer has a direct relationship with the customer and has its own payment plans.
Finally, while Apple’s revenue had start back growing pre-Covid, services has been growing like crazy. Even if people keep their iPhones longer, Apple is still making money off of them - unlike any other phone carrier. Apple is much better diversified than Google.