Cache call type icons
Looking at the trace attached to b/28142787 it looks like
CallTypeIconsView.Resources is created frequently. In my local testing
with 9 items in my call log, it was created 23 times on load and 3 more
times on scroll.
According to the trace, creating a Resources object can be expensive.
In one frame decodeBitmap was called 3 times and took 1.4 milliseconds.
This CL works around the issue by caching the Resources object. This
should be ok. The only downside of this is:
- the cache won't be updated if the DPI variant changes
- the cache won't be released if we get a memory pressure event
Bug: 28142787
Change-Id: Ibc2ef02f7c92022deabedd70b1af135a10c9df29
(cherry picked from commit 341185547f9d54566055b270f69f1b93f0301c36)
1 file changed