I think savvy journalists ensure that they don't know their passwords when crossing borders. That presumably irritates the terrorism police, but also shows what a ludicrous law it is to begin with.
Upload phone backup to cloud before getting to border and reload it from cloud after passing border.
Not gone that far myself but I have removed some content from my phone prior to some border crossings.
But it is ludicrous as it's so easy to encrypt anything that most people whose phones will be of interest to the Police will have encrypted that content go giving Police the phone PIN just gives them !D£T%1-*#b¶•se¡L:'|IU]]e4% etc.
But they can't just take your phone and demand the PIN. They have to give you written notice inder Section 49 of the Regulation of Investigatory Powers Act 2000. Written permission must be obtained from a Judge or a District Judge for the giving of a notice under section 49, this then provides “appropriate permission”. And they can only do that in the interests of national security or for the purpose of preventing or detecting crime or if it is in the interests of the economic well-being of the UK.