Hi All,
I had this exact thing happen to me while I was on vacation in Hawaii.
My M8 would be going into the Car App (I had no freakin idea what it was) at seemingly random times. Also I got the alert that it was in USB host mode and not charging as well.
I only had the phone for a few months, so I decided to do a factory restore since none of the reboot sequences was helping.
Unfortunately it was still doing it.
Then as it did it one time with the charger plugged in, I happened to jiggle the charger on the phone and it exited the car app. Aha! I suspected that I got some dust or something in the port causing some short or connection where the phone thinks you've got it on the car dock (I found that you can buy this thing from HTC).
So I started to look carefully at the plug, stopped using that cable (as I had another aftermarket one with me). I blew on the port to see if there might be some particles trapped in there, also stripped a q-tip to see if I can get there to clean anything. So avoiding that cable that I was using and trying to keep the port clean, it stopped happening!
After getting home I took an air duster and carefully blew out the port. So far so good for more than a week now.
Anyone have any thoughts about this theory? or can confirm that's what might be causing this particular issue?