While some see this as a consequence of living with a privacy-be-damned era where are your details are centered on a single carried device, it's always been the choice of US Customs to search your stuff.
Doesn't matter if you made an incoming declaration or not. Assets are assets--- and people forget that digital assets are still assets.
Is searching a phone like a body cavity search? Some equate these two. For me, the good phone stays in the US, and I take a burner with me overseas. I suggest foreign visitors to the US do the same thing, if they believe their private details should be above suspicion by DHS. Change passwords frequently. Don't use things like Facebook apps while traveling. Always remove your cookies and browser privacy info.
Then remind your friends to vote.