Maybe keep the card of Apple's lawyers on your person. If you're in a situation like this, have them call the number. Or clarify Apple's policy on this before traveling.
> I asked the agents if I could speak to my employer or an attorney before unlocking my devices. This request seemed to aggravate the customs officers. They informed me that I had no right to speak to an attorney at the border despite being a U.S. citizen, and threatened me that failure to immediately comply with their demand is a violation of federal criminal code 18 USC 111.