These are the statutory fair use factors the jury was required to consider (17 U.S.C. 107): (1) the purpose and character of the use, including whether such use is of a commercial nature or is for nonprofit educational purposes; (2) the nature of the copyrighted work; (3) the amount and substantiality of the portion used in relation to the copyrighted work as a whole; and (4) the effect of the use upon the potential…
As to factor number 2, the nature of the copyrighted work: For the last 20 years or so, courts have been backing away from the expansive approach of Whelan v. Jaslow and instead using a Computer Associates v. Altai "abstraction, filtration, comparison" analysis; in the end, courts typically hold that copyright protection for functional aspects of software is "thin." See, e.g., UC law professor (and MacArthur "genius grant" recipient) Pam Samuelson's 2013 review of the case law. [1]
From what I've read of the facts, number 3 -- the amount and substantiality of the portion used from the copyrighted work in relation to the work as a whole -- might have weighed heavily in Google's favor.
As to number 4, I didn't get a sense whether or not the evidence showed that Android has had a material adverse effect on the market for Java; that weighed heavily in the Supreme Court's thinking in the 2 Live Crew case.
[0] https://supreme.justia.com/cases/federal/us/510/569/case.htm...
[1] http://scholarlycommons.law.northwestern.edu/cgi/viewcontent...