This started happening when I noticed a small part of the phone near the USB port on the phone had chip off, which causes the USB cable to fall out when the phone is tilted to the left or even held right-side up. I would have to put the cable into the phone's port in such a way so that the connection would not be lost (attaching cable, then rotating phone clockwise on a flat surface to keep the USB cable from falling out). However, the phone would restart randomly when I do this. I even tried looking for patterns so I could prevent the restarting but I have found no evidence that this is not entirely random. I don't know what to do.