It happened to me when I first got the phone. I tried to fix it using Companion but that gave an error. Sony support were no use. Someone who knew what they were doing flashed the ROM and it's much better now. Companion repair works too, but I still get the occasional restart. I'm trying to find out why... Camera and fingerprint are my main suspects.