A U.S. federal lawsuit alleges that Apple wiretapped users who switched from iPhones to Android phones. The lawsuit claims that Apple’s iMessage system prevented text messages sent from iPhones from being delivered to Android phones. The lawsuit also claims that iPhone texts are “illegally intercepted and interned by Apple” when sent to Android users and are then held indefinitely. If the allegations are accurate, then Apple may be in violation of the Stored Communications Act and the Federal Wiretap Act.

The case arose from a technical fiasco for the company that lasted for nearly three years. During that time period, iPhones could not reliably send text messages to Android phones if the phone number had previously been used for an iPhone. The problem was finally fixed earlier this year.

Apple says that the problems with the text messages stemmed from a flaw in the iMessage program. Once a phone number was registered as an iPhone number via Apple’s iCloud system, the messages were only delivered when the phone was connected to iCloud. Because Android phones cannot connect to iCloud, the messages were not delivered to their intended recipients.

Former Apple customers Adrienne Moore and Adam Bachaut are the plaintiffs in the lawsuit. Both Moore and Backhaut were both former iPhone users who switched to Android phones. Transferring a phone number from an iPhone to an Android requires a multi-step, 45-day-long procedure. The plaintiffs found after the switch that they were not receiving texts from other iPhone users.

The litigation has focused on exactly how iMessage handled texts that were not being delivered to Android phones. Internal documents show that Apple was aware of a problem with iMessage that required “investigation” and “resolution.” Much of the litigation has been conducted in secrecy to protect Apple’s internal information.

Apple has denied the claims in the lawsuit. The company has argued that Apple can’t wiretap its own facilities and says because the company did not intend to literally spy on texts to Android customers, there is no case.

Get Analysts' Upgrades and Downgrades Daily - Enter your email address below to receive a concise daily summary of analysts' upgrades, downgrades and new coverage with MarketBeat.com's FREE daily email newsletter.