Settings > Power > Advanced > When device is turned on, do not charge the battery when connected to PC.