Patent attributes
An electronic device comprises a processor, a charging port, and memory that stores program code. When the program code is executed by the processor, the electronic device charges a battery of the electronic device using the charging port when a charger is connected to the charging port, stops charging in response to detecting that the charging port is abnormal, and displays a first window on a display interface of the electronic device in response to detecting that the charging port is abnormal. The first window comprises a first prompt information and a second prompt information. The first prompt information is used to prompt that liquid intake exists in the charging port, and the second prompt information is used to prompt a user to exclude a liquid intake situation of the charging port.