From Free Press's helpful explainer of the AP phone records scandal, noting the legal background:
Smith v. Maryland — In this 1979 decision, the Supreme Court found that people have no expectation of privacy when it comes to the numbers they call because they understand it has to be transmitted through a third party (telephone company). Thus, the [Digital Media Law Project] notes, "the government can obtain that information simply by issuing a subpoena to a telephone company or other third party."
As Mr. Bumble says, "If the law supposes that, the law is a ass–a idiot." Everyone who wouldn't be surprised–and displeased–to find out that your phone company was going around telling whomever was interested the details of whom you call when and how much, please raise your hand.
The inestimable Justice Thurgood Marshall said it well in his dissent to Smith v. Maryland: "But even assuming, as I do not, that individuals 'typically know' that a phone company monitors calls for internal reasons…it does not follow that they expect this information to be made available to the public in general or the government in particular."