I had the sub-board replaced in mine. Samsung ran diagnostics in store on my phone which flagged up on a software issue, not hardware, so they flashed the latest update to the phone again but that didn't fix it. I took it back and they tested it with a volt and amp meter and that showed that charging was inconsistent and below what would be expected so they explained that perhaps the port and the sub-board needed replacing. I asked Carphone Warehouse to replace the port (that's where I bought the device) and they replaced the sub board. That was about a week a go and the phone has been fine since. It was covered under warranty.
I do still find it hard to believe this is just a software problem given how many of you have the problem as well...
I turned off notifications and generally fiddled with settings which seemed to stop the USB connection on/off issue from waking up the lock screen, though the issue was still there, but at some point that stopped as well and at the moment the phone is working normally.
I too bought from Carphone Warehouse but haven't had any boards changed. It's all a bit inconclusive and I wouldn't be surprised if the problem re-occurred since nothing I did seemed to make any difference at the time!
If it is still in warranty, take back to,the vendor and make it their problem, that is what they are for after all.
Best of luck
I have this problem as well.
Only one person reported it was fixed after doing a software downgrade/hardware replacement, so which is it?
Can anyone else report what they did to fix it?
The lab's guy already told me that it's 110% broken hardware and I should pay for that but I'm sure it's not, now go prove it... I'm about to go there later today...
I had the exact problem where it shows android system message, connected/disconnected and kept my screen turning on while it's not charging. I found out that there's an app called "Always On Display" by Samsung, I think it's a new thing. I force stop it and now the screen is turning off. Hope this is your problem!