Officials: Controversial Surveillance Law Helped Stop Smartphone Attack