Infectious yawning (that is, the tendancy of one person's yawn to trigger yawning in others) has been noted in humans, chimpanzees, and some other animals. It is not known why this occurs. The "oxygen deficiency" theory you mention, believed since the days of Hippocrates, is not well regarded today as yawning actually reduces oxygen intake. However, you specifically asked about infectious yawning. There is evidence that yawning increases the level of alertness, and there are studies that suggest that infectious yawning evolved as a mechanism for keeping a group alert and therefore safer from predators.
Yawning is a form of alerting the body to keep it to stand, and not a forerunner sign of sleep, according to a study undertaken by a team of U.S. scientists. When a person is yawning, the inhaled air reduces the temperature of blood vessels in the nasal cavity, allowing the cold blood to reach the brain. When the brain is cooled, the body enters a state of alert and can operate at full capacity, according to the study conducted by researchers at State University of New York.People who breathe through the nose more are yawning less, because blood vessels in the nasal cavity are already cold.
The researchers also found that the phenomenon of "yawning group", called "contagious yawning "is an evolved protective mechanism that makes one group of people to become more alert.
Experts say that, to avoid embarrassing moments of yawning in public something cold must be applied on the forehead.
Researchers have examined for this study 44 persons.
Subjects watched for many hours recordings with persons which are yawning. Specialists have recorded the number of "contagious yawning ". Also, while watching those recordings, the volunteers were asked to breathe oral, nasal and normal. 50% of normal breathing or nose breathing, were yawning while they looked at the records. None of those who breathe through the nose was affected by the yawning. Also, people who have put a cold handkerchief on their forehead did not yawning, unlike the volunteers who have put a warm handkerchief on their forehead.