While the law still allows the U.S. CBP (Customs, Border Patrol) to conduct a limited search of a cell phone or laptop at the border without any suspicion whatsoever based upon  the border search exception which is designed for customs inspections, the court re-visited United States v. Cotterman, 709 F.3d 952 (9th Cir. 2013) and made it clear this exception is not for general law enforcement.  It is now clear they cannot force you to unlock your cell phone or laptop so they can look around, or take it and do a forensic search without respecting your 4th Amendment protections, e.g they need an objective suspicion there is evidence of a crime inside your phone or that you committed a crime (in the US) with some evidence of that crime inside your phone or laptop.  I think that means they can only force you to give them your phone, but not force you to unlock it.
The 9th Circuit (Calif.) Court made it clear that cell phones cannot be searched at the border under the border exception unless the cell phone itself is suspected to contain contraband, as opposed to it may lead to discovery of evidence of or to help convict of a crime.
This was a drug smuggling case, but the underlying law is from a child porn case.
Unfortunately the larger problem remains, the border officers can still threaten and make people uncomfortable.  But If asked for my phone, I’d ask what reasonable suspicion do they have that contraband is inside my phone and tell them read the Cano case!