I will leave this comment here since it's one of the highest ranked for the "s4 mini keeps restarting" google search.
The phone, for some reason, kept restarting itself from time to time. Sometimes it took several days but it ended up restarting in the end. I did all the debugging I could trying to pinpoint what was the source of this issue. I went through several cycles of reinstalling a firmware and not change any of the preferences to changing most of them, trying to see if it was something I did (or didn't do) that was causing this or the phone hardware was simply faulty. Sometimes I just didn't install any of my most intrusive rooted apps but it still kept restarting. I even installed a logging application that logged EVERYTHING in the system in order to see what kind of crash was causing the restart and I found nothing.
After a while I just came to the conclusion that it had nothing to do with anything I did but I was starting to see a pattern. Whenever a restart occurred it happened after I had receive or made at least one phone call (later I noticed that SMS messages would trigger it too, both are related to the Phone system application). It could take several days after a phone call for the restart to happen or it could happen on the same day but always after a call had been placed or received. Thanks to instant messaging I rarely need to make a phone call so I could go days without using the Phone application and the phone wouldn't restart itself and thanks to this I could see the pattern. After this discovery I started to tweak the Phone settings in order to see if it could be fixed this way but I had no luck. In the end I decided to change the sim card not because I thought it was damaged but because I was running out of ideas
. After changing it and making a call I saw what the problem was. By default, the Phone app always shows a little message that reads "conditional call forwarding is active" or something like that. A long time ago I had disabled that message and I didn't remember but after changing the sim card the message is showing up again. It turns out that that setting is saved in the sim card and that is why none of my firmware reinstallations fixed the issue since the setting was being read from the sim card anyways. For some reason the phone doesn't deal well with this feature being disabled which is weird but I don't care, I haven't had the phone restart again even after placing numerous phone calls
. Usually it restarted once every 4 days or so AT LEAST and now I have 23 days of continuous uptime.
I love this phone, I've been using it for years and have bought several models of the S4 mini. I really didn't want to change models (something this issue was driving me towards), it's perfect for me size-wise and phones these days are just TOO BIG. Someone was even offering me an S4 but I didn't want it because for me the deciding feature when it comes to phones it's a small size and this one has both: comfortable size and decent specs. I hope this helps someone in the future.