An electronic device, comprising: a plurality of ports which comprise a first port (101_a) and a second port (101 b); a battery configured to receive a charging power through at least one of the plurality of ports; a control circuit configured to control charging of the battery by using power from a plurality of charging devices connected to the plurality of ports; a charging circuit configured to charge the battery by using power supplied from the plurality of charging devices; and a plurality of communication circuits (131, 132) to communicate with the plurality of charging devices, wherein the control circuit electrically connected with the plurality of communication circuits and the charging circuit is configured to set a charging power level of each of the plurality of charging devices and a battery charging power capacity of the charging circuit, and wherein the control circuit is further configured to: when a second charging device is connected to the second port while supplying a charging power from a first charging device connected to the first port to the battery, set a charging power level of the second charging device in response to charging power level of the first charging device; and when a charging power capacity of the first charging device is less than the battery charging power capacity of the charging circuit and when the charging power capacity of the second charging device is greater than or equal to the battery charging power capacity of the charging circuit, switch from charging the battery with the first charging device to charging the battery with the second charging device. a plurality of ports which comprise a first port (101_a) and a second port (101 b); a battery configured to receive a charging power through at least one of the plurality of ports; a control circuit configured to control charging of the battery by using power from a plurality of charging devices connected to the plurality of ports; a charging circuit configured to charge the battery by using power supplied from the plurality of charging devices; and a plurality of communication circuits (131, 132) to communicate with the plurality of charging devices, wherein the control circuit electrically connected with the plurality of communication circuits and the charging circuit is configured to set a charging power level of each of the plurality of charging devices and a battery charging power capacity of the charging circuit, and wherein the control circuit is further configured to: when a second charging device is connected to the second port while supplying a charging power from a first charging device connected to the first port to the battery, set a charging power level of the second charging device in response to charging power level of the first charging device; and when a charging power capacity of the first charging device is less than the battery charging power capacity of the charging circuit and when the charging power capacity of the second charging device is greater than or equal to the battery charging power capacity of the charging circuit, switch from charging the battery with the first charging device to charging the battery with the second charging device. when a second charging device is connected to the second port while supplying a charging power from a first charging device connected to the first port to the battery, set a charging power level of the second charging device in response to charging power level of the first charging device; and when a charging power capacity of the first charging device is less than the battery charging power capacity of the charging circuit and when the charging power capacity of the second charging device is greater than or equal to the battery charging power capacity of the charging circuit, switch from charging the battery with the first charging device to charging the battery with the second charging device.