Patent attributes
Electronic devices may be provided with sensors for determining the presence and position of extendable and removable antennas. The antennas may extend by rotating about an axis, by reciprocating along their length, or by flexing from a retracted position to an extended position. The electronic device may determine when a removable antenna is attached or detached using signals from the sensors. The electronic device may determine the extent to which an antenna has been extended using signals from the sensors. The electronic device may control the operation of a radio-frequency transceiver that is coupled to the antenna based on signals from the sensors. The electronic device may turn the transceiver off when the antenna is retracted or removed. When the antenna is partially extended, the electronic device may place the transceiver in a low-power mode or place a dual-band transceiver into a single-band mode.