My phone is only for communication and entertainment. Same for my tablet. I don't save passwords or account information. Honestly, of late I tend to do anything secure on my desktop with good old-fashioned hard line connections from my home office. Avoids the problem.
As to the legality of border searches, got to remember that there are three kinds of law...(1) the written law, (2) the law of prior decisions, and (3) the law of the judge in front of you. Sometimes, the last one is the only one that matters, because the other two might only help in the appeal.