SAN FRANCISCO — On one of the first days of a high-stakes antitrust trial, a cellphone rang out in the courtroom. Lawyers and observers nervously checked their pockets and purses. Eventually, they looked to U.S. District Judge William Orrick III.

“Does anybody have that attractive sound? If so, would you take it out of the courtroom, please?” he asked.