Open Power Options, click on “Change plan settings,” then “Change advanced power settings,” locate “USB settings,” expand “USB selective suspend setting,” set both “On battery” and “Plugged in” options to “Disabled,” and click “Apply” and “OK.”