The act endangered the safety of fellow passengers and crew members during the flight, the police said.