Can't this be avoided, at least on Android, by simply shutting down your phone? Thought I read somewhere that they lock down everything, even system processes, after turning on again until you unlock it again. Or are you also forced to type the password and let them in?
Border entry is different than self incrimination.
If you are charged with a crime you cannot be compelled to give a password as it resides in your head. However if you use finger prints or face recognition to unlock it you're SOL.
Best thing to do is get an android and setup a dummy account. use that account when you get off the plane so when you unlock it there is nothing to go through.
Seeing a lot of responses that are wrong because they are talking about what police in the US can do. This article is about border crossing where border patrol can ask you to unlock the phone without any warrant/etc. If you refuse then you can be denied entry to the country (although I believe that is just non-citizens). Not sure if things can escalate from there.
Edit: which means if your phone was off, they'd just ask you to turn it on and unlock it.