Never a good idea.
Very tired after a 700 mile ride in the rain...dismounted a heavy bike,
lost my balance on wet dirt and managed to land on my chest and crack my "sternum" with a cell phone in my top left coat pocket.
The bone that protects the heart....could not breath well for 2 months, $3,000 in medical bills (chest xrays, drugs, etc) and very painful to sleep. There is nothing that can be done for a cracked sternum.
I never carry cell or gps in my front pockets anymore.