Should be perfectly legal to demonstrate but if you’ve got you’re phone on you someone will know you were there and protesting for X.
That’s very valuable information not just for law enforcement but also for marketing/advertising and also for more scummy stuff like influencing your political choices (eg Cambride Analytica style).
I don’t have my phone on my when I attend events that could “leak” my political or ethical choices.