The police have powers to stop and question you on the street at any time. Typically, you do not have to answer their questions if you do not want to. The police can also search you but only if they have reasonable grounds to suspect you are carrying illegal objects such as drugs or weapons.
The police cannot stop you to search your phone without your consent. Exceptions include if they can justify using legal powers such as terrorism or child sex offence laws.
Another potential exception is if the police suspect the phone is stolen and their reason for searching you is to confirm that is the case (although it’s not fully established whether the police can search the phone itself).