There were reports that some travellers, young people in particular, were asked to unlock their phones when entering the Mainland last year, but I never was. Not young enough, I suppose.
As to the US, I believe but am not sure that when applying for ESTA, you now must supply your social media IDs, but only for Twitter, Instagram, Facebook and LinkedIn. Perhaps someone can confirm or not.
As the Alasaad case indicates, there's now legal uncertainty whether U.S. customs needs a "reasonable suspicion" before they can inspect your phone. It'll probably be two years or so before this reaches the Supreme Court.