I believe it's either internal circuitry, internal memory or root system file damage but I thought it's best I ask here first.
I'm using a Sony Xperia M (nicki) C1905 android. I believe I've had this for just about a year now. This is the second one I've had, the one before lasted 2-3 years that took some heating up from gaming apps.
Few weeks ago. It started to fail with apps in the background. Mainly Google Play Store or Google Play Services kept prompting it's not responding. So I've ran the Xperia Companion Recovery which fixed it. Then it started to happen again repeatedly after a while after recovering it again.
Later I've flashed TWRP and LineageOS over the old Sony OS, hoping for it to solve the problem and to try it out since I thought it was going to stop working anyway. It runs miles better but usually every 1-2 days, it starts to lag, some random app fail and eventually force restarts into a hanged boot of the LineageOS logo.
I've had KingRoot app, which I've found out later was presumed Spyware, when I was trying to root the device to replace the original OS. But the app crashes occurred before that.
I've done full format of the partitions with TWRP and clean flashed LineageOS and GAPPS but it still occurs.
Is there anything I can do? I've tried diagnostic app but didn't seem to pick up any faults with it.
The occurrences are: device lag, repeative app crash and then OS fails to fully start up and hangs. It happens different order sometimes.