Cell phone data is extremely private.
You have a right to privacy in your phone, as well as in your communications, unless police have legal authorization to search you or intercept your communications. But even if police have authorization to search you (including a search of your phone), they cannot force you to give them your password or force you to put it in.
Your text message conversation on another person’s phone, if you sent it with the expectation that it would be private, might be seen as private, and this is assessed based on the circumstances. CCLA and other rights advocates believe that your text messages on your phone or anyone else’s should be seen as private, and should not be accessible to police except in cases of legal authorization.
If police arrest you, they are allowed by law to search your phone, so long as they have a valid reason – but keep in mind that police cannot force you to give them your password or force you to put it in. The search must be for the purpose of protecting the police, the public, the accused, or for preserving evidence or locating evidence that might be compromised if they did not perform the search in that moment, or for protecting additional people that might be at risk.