I noticed mine (a5c8) doing the same in windows – I don’t use android on it – when I was using an older Samsung micro USB cable. Replacing the old USB cable made that problem go away for me.
My guess was that a bad or shorted connection caused by the dodgy cable freaked out the charging electronics which shut things down in a panic. I’ve had that happen with a couple other devices – in one case it was a bad socket on the phone itself. 🙁 That sucks. I’m always ~really~ gentle with micro usb port on the x98 because of that experience.