Question: I forgot to silence my phone before I went into shul and it beeped while I was davening the amida. Was I allowed to switch it onto silent so as not to disturb others?
Answer: The Gemara (Berachos 23b) writes that one shouldn’t hold one’s tefillin or money while davening. As one will be concerned not to drop them, they won’t be able to concentrate properly (See Shulchan Aruch OC 96:1).
The Pri Megadim (96:1) writes that this halacha applies to other parts of davening to, even pesukei dezimra. Thus, one shouldn’t hold one’s phone at all while davening.
The Magen Avraham (OC 96:3) writes that if one’s siddur falls onto the floor while they are davening, they can pick it up in between the berachos if it is disturbing them.
Nonetheless, R’ Nosson Gestetner (Lehoros Nosson 15:5) writes that switching one’s phone off is considered to be a tzorech mitzva, necessary for the davening, and so permissible. Unlike speaking which is considered to be a hefsek, interruption, motioning or hinting for mitzva purposes is permissible (See Shulchan Aruch Harav OC 63:7). Thus, the Shaarei Teshuva (OC 104:1) and Mishna Berura (104:1) write that one may motion to a child to be quiet. Likewise, a Rabbi can motion to the chazzan to start chazaras hashatz rather than wait for him to finish.
Especially as a phone ringing can disturb others, one should even pause mid-beracha to switch it off.
In conclusion, if one forgot to switch their phone onto silent, they should do so even in the middle of their amida.