Controlling charging of computing device through ports connected to external devices
An apparatus comprises at least one processing device configured to obtain information characterizing a status of one or more batteries of a computing device. The processing device is also configured to determine whether at least one connector port of the computing device is connected to one or more external devices, the at least one connector port being configured to receive power from the connected external devices for charging the one or more batteries of the computing device. The processing device is further configured, responsive to determining that the at least one connector port of the computing device is connected to the one or more external devices, to selectively enable the charging of the one or more batteries of the computing device utilizing power received from the connected external devices based at least in part on the information characterizing the status of the one or more batteries of the computing device.
1. An apparatus comprising:
at least one processing device comprising a processor coupled to a memory;
the at least one processing device being configured to perform steps of:
obtaining information characterizing a status of one or more batteries of a computing device;
determining whether at least one connector port of the computing device is connected to one or more external devices, the at least one connector port being configured (i) to receive power from the connected one or more external devices for charging the one or more batteries of the computing device and (ii) to transfer data between the computing device and the connected one or more external devices; and
responsive to determining that the at least one connector port of the computing device is connected to the one or more external devices, selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices based at least in part on the obtained information characterizing the status of the one or more batteries of the computing device, wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices is performed while maintaining data transfer functionality between the computing device and the connected one or more external devices, and wherein the connected one or more external devices comprise at least one of one or more peripheral devices and a docking station connecting at least one of the one or more peripheral devices to the computing device.
2. The apparatus of claim 1 wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices comprises disabling charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices without unplugging the one or more external devices from the at least one connector port.
3. The apparatus of claim 1 wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices comprises disabling charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices responsive to the obtained information characterizing the status of the one or more batteries of the computing device indicating that a charge level of the one or more batteries exceeds a designated threshold charge level.
4. The apparatus of claim 3 wherein disabling charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices comprises setting a battery status indicator in a dashboard of an operating system of the computing device to a status indicating that the connected one or more external devices are plugged in but not charging the one or more batteries of the computing device.
5. The apparatus of claim 1 wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices comprises enabling charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices responsive to the obtained information characterizing the status of the one or more batteries of the computing device indicating that a charge level of the one or more batteries is below a designated threshold charge level.
6. The apparatus of claim 1 wherein the at least one connector port comprises a Universal Serial Bus (USB) connector port.
7. The apparatus of claim 6 wherein the USB connector port comprises a USB type C connector port.
8. The apparatus of claim 6 wherein the USB connector port comprises a Thunderbolt type connector port.
9. The apparatus of claim 1 wherein the computing device comprises a laptop computing device.
10. The apparatus of claim 1 wherein the information characterizing the status of the one or more batteries of the computing device is received from an operating system kernel power manager of the computing device.
11. The apparatus of claim 10 wherein the operating system kernel power manager of the computing device is configured to receive one or more battery status alerts for the one or more batteries of the computing device from a driver stack of the computing device.
12. The apparatus of claim 11 wherein the driver stack of the computing device comprises a Universal Serial Bus (USB) extensible host controller driver and one or more battery port drivers.
13. The apparatus of claim 1 wherein the one or more peripheral devices comprise at least one of an external display, a speaker system, an input device and a Bluetooth device.
14. The apparatus of claim 1 wherein the connected one or more external devices comprise the docking station.
15. A computer program product comprising a non-transitory processor-readable storage medium having stored therein program code of one or more software programs, wherein the program code when executed by at least one processing device causes the at least one processing device to perform steps of:
obtaining information characterizing a status of one or more batteries of a computing device;
determining whether at least one connector port of the computing device is connected to one or more external devices, the at least one connector port being configured (i) to receive power from the connected one or more external devices for charging the one or more batteries of the computing device and (ii) to transfer data between the computing device and the connected one or more external devices; and
responsive to determining that the at least one connector port of the computing device is connected to the one or more external devices, selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices based at least in part on the obtained information characterizing the status of the one or more batteries of the computing device, wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices is performed while maintaining data transfer functionality between the computing device and the connected one or more external devices, and wherein the connected one or more external devices comprise at least one of one or more peripheral devices and a docking station connecting at least one of the one or more peripheral devices to the computing device.
16. The computer program product of claim 15 wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices comprises disabling charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices responsive to the obtained information characterizing the status of the one or more batteries of the computing device indicating that a charge level of the one or more batteries exceeds a designated threshold charge level.
17. The computer program product of claim 15 wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices comprises enabling charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices responsive to the obtained information characterizing the status of the one or more batteries of the computing device indicating that a charge level of the one or more batteries is below a designated threshold charge level.
18. A method comprising steps of:
obtaining information characterizing a status of one or more batteries of a computing device;
determining whether at least one connector port of the computing device is connected to one or more external devices, the at least one connector port being configured (i) to receive power from the connected one or more external devices for charging the one or more batteries of the computing device and (ii) to transfer data between the computing device and the connected one or more external devices; and
responsive to determining that the at least one connector port of the computing device is connected to the one or more external devices, selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices based at least in part on the obtained information characterizing the status of the one or more batteries of the computing device, wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices is performed while maintaining data transfer functionality between the computing device and the connected one or more external devices, and wherein the connected one or more external devices comprise at least one of one or more peripheral devices and a docking station connecting at least one of the one or more peripheral devices to the computing device;
wherein the method is performed by at least one processing device comprising a processor coupled to a memory.
19. The method of claim 18 wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices comprises disabling charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices responsive to the obtained information characterizing the status of the one or more batteries of the computing device indicating that a charge level of the one or more batteries exceeds a designated threshold charge level.
20. The method of claim 18 wherein selectively enabling the charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices comprises enabling charging of the one or more batteries of the computing device utilizing power received from the connected one or more external devices responsive to the obtained information characterizing the status of the one or more batteries of the computing device indicating that a charge level of the one or more batteries is below a designated threshold charge level.