Screen black out and reboots while charging and gaming

When ever I plug the charger the screen goes off and some times even phone shut down and it starts only after unplugging the charging cable , same thing happens when playing games. Can anyone tell me is it a software issue or hardware defect
0
Comments
For black out and restarting issues, mods here in the past till now have always advised to go to service centres as most diagnostic is showing as hardware issue.
Hi salimpathan8087,
Please check your PM and share the requested details.
same for me after the new update i face it.
It's a hardware defect, it's a well documented defect that happens when the pm8150 ic starts to die.