A 49-year-old former Royal Oak Middle School teacher and high school tennis coach is facing a charge of aggravated indecent exposure after allegedly masturbating in view of another fellow member in the shower of a Troy LA Fitness gym, police said.

The incident took place on Aug. 21 at 8 a.m. at the LA Fitness on the 700 block of East Big Beaver.

Police say that a 35-year-old man was using the shower in a stall with no shower curtain. He looked over and saw through a rip in the curtain of a nearby shower a man in that shower watching him and masturbating.

The victim then confronted the suspect, who police identify as Timothy Janowiak, 49, of Berkley. After being confronted, Janowiak allegedly tried leaving the gym, but the victim continued confronting him, and eventually called 911.

Jankowiak is due for a probable cause conference on Sept. 11 at 9 a.m. at Troy's 52-4 District Court.

Jankowiak is a former Royal Oak Middle School teacher who coached tennis at the high school, the district confirmed Tuesday in a statement from Royal Oak Schools Superintendent Mary Beth Fitzpatrick.

"Last April, the former teacher resigned from Royal Oak Schools while the district was investigating a parent report that the teacher had been inappropriately sending text messages to a student," Fitzpatrick said in a statement sent to family members of students in the Royal Oak schools system. "Royal Oak Police and Child Protective Services were contacted during this investigation, and the teacher was immediately removed from the classroom and placed on administrative leave.

"Again, safety is our number one priority at Royal Oak Schools, and we will not tolerate any inappropriate conduct, including through text messages or social media. All such reports will be investigated thoroughly."