An electronic device includes a charging circuit and a bypass circuit. The charging circuit adapted to charge a battery of the electronic device. The bypass circuit is connected in parallel with the charging circuit. A controller is configured to selectively turn on or turn off the bypass circuit…