Several years ago my wife ran a conference of Immunologists. One of the visitors was on her way from her lab in the UK and she was stopped at UK boarder control. Seems her laptop tested positive for nitrates (they use them in the lab) even though she had been real careful to keep this laptop out of the lab so it would be clean. They wanted to hold her laptop and send it to her, but as it was to be a short trip she told them to hold it for her return. Then came the clincher, she had to tell them that they could not look at the data as it had confidential patient data protected under UK law. Now the rest of us are not protected under such laws, and need to worry what happens if a boarder agent demands your password to check your device (phone, laptop, etc.)
Anyone who travels with laptops, phones and tablets should know what to do if security asks for their password, an agent asks to see what's on their phone, and how to protect sensitive or private information if their gadget gets out of their hands.
She references material from the EFFthat everyone should read about basic precautions, how the government searches devices, how (and when) to protect your data, encryption and good passwords, border agent demands, and more.
On the EFF's Travel Screening page, they cover the basics on border search, and travel 'blacklists' such as the Department of Homeland Security's Automated Targeting System.