If the police stop you on suspicion of committing a drug-related offence, they may try to seize your phone under Section 23 of the Misuse of Drugs Act 1973. However, they can only do this if they have reasonable suspicion to believe it is evidence of a drugs offence.
In many situations, it is debateable whether the police can use Section 23 to seize mobile phones. Therefore, if you have been stopped, searched, and had your phone looked through on this basis.