Improve performance of generations in the resource cache

Tracking generations in the resouce cache caused a performance
regression, likely from allocating an Entry object for every resource
retrieval. This optimizes that by having the retrieval of the value be
separate from retrieval of the generation. This makes it so that on
cache hits there is no difference from before the generation change and
a cache miss only adds the overhead of a method call to retrieve an int.

Test: ran with forest to determine improvement
Fixes: 285575799, 285489092, 285730765, 285607129, 285489541, 285943600
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:094f7289f1ae341bbb9fdbb17f2aff66e507dbfd)
Merged-In: I5144f08bb38d0e600b7f556df834292e50afb91c
Change-Id: I5144f08bb38d0e600b7f556df834292e50afb91c
6 files changed