Apple and Google sued each another in a court filing on Wednesday, accusing each other of copying or violating patents for earphones and earbuds.

The companies’ complaint in the U.S. District Court for the Northern District of California says they each own the patents covering hearing aids and earphones, and that Apple and its rival Amazon are using them to patent a patent that covers “sound recording devices.”

Amazon is also suing Apple, alleging that the earphones infringe on two of its patents covering the use of “microphones, headphones, microphones, and speaker-generated sound.”

The complaint also says Apple is infringing on two patents related to “virtual reality,” one related to headphones and the other to headphones.

Apple said it plans to defend the lawsuit vigorously and has set up a new legal team, including the lead attorney on the case, Jeffrey Mollison.

Mollison is also Apple’s senior vice president for patent litigation, and he previously served as Apple’s chief patent counsel.

The complaint also accuses Amazon of using patents related “to virtual reality technology to patent an innovative feature of the technology,” the third of which was created by the Apple patent.

Amazon has also accused Apple of infringing its “headphone-based virtual reality system,” the complaint says.

Apple did not immediately respond to a request for comment.

The case was filed by Apple on behalf of consumers who purchased the earbud-like earphones or earphones that were featured in the movie “The Lego Movie.”

Amazon is also the only patentholder on the earphone, but it’s unclear if it’s Apple or Amazon that is suing.