It's also critical to know whether—and where—police have the right to search your phone without a warrant in the first place. As the Electronic Frontier Foundation points out, your constitutional protection against unreasonable search and seizure should mean that police cannot simply rummage through your files without a warrant except when (a) you consent to the search or (b) give them probable cause that there's incriminating evidence in immediate danger of being deleted from the device.
A growing number of states, though, are allowing officers to search phones without a warrant upon arresting a suspect. As you can see in the map below, based on EFF information provided to Forbes, nearly half the states in the country—shown in red—allow for warrantless mobile device searches. Only those in blue explicitly require a warrant to search phones, while the yellows have no set precedent.