The issue is that customs agents have the authority to refuse you entry into the country for no reason if they so choose. Refuse to consent to a search and you could be refused entry. This includes simply transiting through the airport, as the US requires foreigners to go through customs even for connecting flights (I’m not sure if that’s always the case, but it has always been the case for me.) So they can’t force you to let them search your phone, but the end result is the essentially the same.
Don’t refuse… Just casually forget
The issue is that customs agents have the authority to refuse you entry into the country for no reason if they so choose. Refuse to consent to a search and you could be refused entry. This includes simply transiting through the airport, as the US requires foreigners to go through customs even for connecting flights (I’m not sure if that’s always the case, but it has always been the case for me.) So they can’t force you to let them search your phone, but the end result is the essentially the same.
Well, you know when you get around my age, technology gets confusing