Of course, it is up to you whether you take your smartphone to demonstrations or not. It may also be indispensable for you because you need to organize your arrival or departure or because you want to take photos and videos. However, you should be aware of the risks so that you can make a good decision.
The main reason not to take it to the protest is that phones can simply be seized or confiscated by the police. This means that all your stored data can potentially be read. Use strong encryption and turn off your device before confiscation to protect the data.
Another reason why you might want to leave your device at home are so-called IMSI catchers or stingrays. In theory, this allows all devices that are currently present at the demo to be recorded. To protect yourself from this, you can use flight mode or remove the SIM card.
Another big problem is that governments or authorities can easily analyze the cell phone data at a demonstration. Even days after the demonstration. This gives them a list of all the SIM cards logged in. And since these are often not anonymous, it is known who was at the demonstrations. Use flight mode, remove the SIM card, switch off your device or use anonymous SIM cards if you want to minimize the risks.