You say as if "consent" means anything in such situations. They told me to unlock the smartphones. The plain-clothes policeman was so aggressive and rude that I felt the devices would be confiscated otherwise, he was already holding them in his hands. I was only transiting, didn't feel like looking for a lawyer in Germany or even speaking German. They refused to identify themselves when I wanted to note it down before finally driving away. I know they were real policemen because regular uniformed police patrol joined them during the search.
I've never had any experience like that luckily, but nowadays I only travel with disposable phones. They want to confiscate it? Let them. And If I do decide to grant access, anything important is never stored on the phone itself.