An electronic device comprises a USB Type-C interface, a switching circuit, a first signal path, and a second signal path, wherein the USB Type-C interface is configured to connect to a USB Type-C device; the switching circuit is connected to a first pin of the USB Type-C interface, the first signal path, and the second signal path; when the USB Type-C interface is connected to the USB Type-C device, the first signal path is connected to the first pin of the USB Type-C interface through the switching circuit, and a level of the first pin of the USB Type-C interface is a first level; and when the USB Type-C interface is disconnected from the USB Type-C device, the second signal path is connected to the first pin of the USB Type-C interface through the switching circuit, and a level of the first pin of the USB Type-C interface is a second level, wherein the first level is greater than the second level; wherein the first pin of the USB Type-C interface is a CC pin; wherein the first signal path comprises a PD circuit, and the PD circuit is configured to detect a level of a second pin of the switching circuit, and when the level of the second pin meets a second preset condition, determine that the USB Type-C interface is disconnected from the USB Type-C device, and send a second signal to the switching circuit, so that the second signal path is connected to the first pin of the USB Type-C interface; and wherein the second signal path comprises a power supply module, a detection module, and a first resistor, and the power supply module is configured to output first power, and is connected to a third pin of the switching circuit through the first resistor, and a level of the first power is less than a level of a signal output by the PD circuit; and the detection module is configured to detect a level of the third pin of the switching circuit, and when the level of the third pin meets a first preset condition, determine that the USB Type-C interface is connected to the USB Type-C device, and send a first signal to the switching circuit, so that the first signal path is connected to the first pin of the USB Type-C interface. the USB Type-C interface is configured to connect to a USB Type-C device; the switching circuit is connected to a first pin of the USB Type-C interface, the first signal path, and the second signal path; when the USB Type-C interface is connected to the USB Type-C device, the first signal path is connected to the first pin of the USB Type-C interface through the switching circuit, and a level of the first pin of the USB Type-C interface is a first level; and when the USB Type-C interface is disconnected from the USB Type-C device, the second signal path is connected to the first pin of the USB Type-C interface through the switching circuit, and a level of the first pin of the USB Type-C interface is a second level, wherein the first level is greater than the second level; wherein the first pin of the USB Type-C interface is a CC pin; wherein the first signal path comprises a PD circuit, and the PD circuit is configured to detect a level of a second pin of the switching circuit, and when the level of the second pin meets a second preset condition, determine that the USB Type-C interface is disconnected from the USB Type-C device, and send a second signal to the switching circuit, so that the second signal path is connected to the first pin of the USB Type-C interface; and wherein the second signal path comprises a power supply module, a detection module, and a first resistor, and the power supply module is configured to output first power, and is connected to a third pin of the switching circuit through the first resistor, and a level of the first power is less than a level of a signal output by the PD circuit; and the detection module is configured to detect a level of the third pin of the switching circuit, and when the level of the third pin meets a first preset condition, determine that the USB Type-C interface is connected to the USB Type-C device, and send a first signal to the switching circuit, so that the first signal path is connected to the first pin of the USB Type-C interface.