With the belief that a Customs and Border Inspector is this nation's first line of defense against foreign threats, Congress has given them as well as Conofficers overseas very broad powers in their decisions as to who they will confer the privilege of entering the United States. And so, a CBP officer can conduct a full scale search of your person and belongings before allowing you to enter. Secondly, while a US airport may be within the geographical confines of United States, that same port of entry may well be thousands of miles away from the US where you have no rights including prohibition against search and seizure, or to an attorney. Also, the visa you got from a US embassy does not guarantee you will in fact be allowed to enter. It is only an application for permission to enter wish can be denied as is done for thousands of foreigners whose visas are revoked each day a US airports and then sent right back from where they came.u00a0 Of course, if you do not want your cell phone to be searched, you can withdraw your application for admission in which case you will be sent back . This is not to say you cannot lodge a complaint where a CBP officer has been particularly rude. But you will find that is very unlikely to get him fired. You may ask your own country's embassy to complain to the State Dept.