There are two other threads on this, but try the solution that I found:
Turn off Fingerprints for locking your screen.
I know this sounds ridiculous, but hear me out or try it. I noticed that other users had noted that their system had upgraded before getting this random notification. I had tried cleaning out my USB port with air and a toothpick. And I tried different USB cables. But after a recent OS update (7.0, Android Security Patch Level March 1, 2017, Build NRD9OU, SW Version H83020f, Security software version MDF v2.09 Release 2.0) my battery life dropped dramatically and I got this error all the time, especially if nothing was plugged into the USB port. I looked to see what was using the most battery and strangely it was the Android OS, by a big margin. Android OS was not only first, but 47%! I thought back to what I had done before the upgrade. I had set a fingerprint lock for the first time. As a test, I turned off the fingerprint unlocking. Now I no longer get the phone asking to change the USB connection AND Android OS is 3rd and a much more reasonable 9%. Battery life is improved and the phone is fast like it was when I bought it!
Go figure? I don't know what the connection is other than some bug in the OS with the Fingerprint lock. I tried the other suggestions in this thread and other threads (except for restoring to factory settings). Nothing worked.
Maybe some programmer will look at this exclaim "Oh Crap, I forgot..."
Here's how to change the lock:
Settings >Lock screen > Select screen lock
-Enter your lock code (or fingerprint) as prompted
-Change to any of the other options (I selected "Pattern")
Let me know if it works.