Airlines that fly from certain countries in the Middle East and Africa to the U.S. must require passengers to check in almost all electronic devices rather than carry them into the cabin, said a U.S. official.