An electronic device comprising: a housing: a display device exposed through a first part of the housing; a recess formed in a second part of the housing; a receptacle formed in the recess; a plurality of conductive contacts disposed inside the receptacle, wherein the plurality of conductive contacts correspond to a plurality of external contacts of an external connector and include a first contact; a first circuit configured to supply or receive a current of a first level or larger to or from the first contact, when an external connector is inserted into the receptacle; a first switching device comprising switching circuitry configured to electrically switch between connecting the first circuit with the first contact and interrupting an electrical connection between the first circuit and the first contact; a second circuit configured to detect existence of a foreign object, such as moisture or brine, contacting the first contact in the receptacle, when the external connector is inserted into the receptacle with therein also the foreign object, and a control circuit configured to control the first switching device based at least in part on information regarding the detected existence of the foreign object, wherein the second circuit is configured to detect the existence of the foreign object by detecting an abnormal relative to a defined voltage level or impedance caused by the foreign object at the first contact. a housing: a display device exposed through a first part of the housing; a recess formed in a second part of the housing; a receptacle formed in the recess; a plurality of conductive contacts disposed inside the receptacle, wherein the plurality of conductive contacts correspond to a plurality of external contacts of an external connector and include a first contact; a first circuit configured to supply or receive a current of a first level or larger to or from the first contact, when an external connector is inserted into the receptacle; a first switching device comprising switching circuitry configured to electrically switch between connecting the first circuit with the first contact and interrupting an electrical connection between the first circuit and the first contact; a second circuit configured to detect existence of a foreign object, such as moisture or brine, contacting the first contact in the receptacle, when the external connector is inserted into the receptacle with therein also the foreign object, and a control circuit configured to control the first switching device based at least in part on information regarding the detected existence of the foreign object, wherein the a display device exposed through a first part of the housing; a recess formed in a second part of the housing; a receptacle formed in the recess; a plurality of conductive contacts disposed inside the receptacle, wherein the plurality of conductive contacts correspond to a plurality of external contacts of an external connector and include a first contact; a first circuit configured to supply or receive a current of a first level or larger to or from the first contact, when an external connector is inserted into the receptacle; a first switching device comprising switching circuitry configured to electrically switch between connecting the first circuit with the first contact and interrupting an electrical connection between the first circuit and the first contact; a second circuit configured to detect existence of a foreign object, such as moisture or brine, contacting the first contact in the receptacle, when the external connector is inserted into the receptacle with therein also the foreign object, and a control circuit configured to control the first switching device based at least in part on information regarding the detected existence of the foreign object, wherein the second circuit is configured to detect the existence of the foreign object by detecting an abnormal relative to a defined voltage level or impedance caused by the foreign object at the first contact.