Fix NPE with contact cache, and guard against race condition.

Because the image loading and contact interactions information are
loaded asynchronously at the same time, one of them may be loaded before
the other. To ensure that the main thread is aware when whether one or
both of them have completed, keep a flag in ContactCacheInfo. This will
prevent the callbacks from being cleared before all callbacks are
completed.
Also guard against NPEs by making sure the cache entry is added to the
map of callIds to cacheEntries and check for null before proceeding in
the callback for contact interactions.

Bug: 25618632

Change-Id: I7662242e040948a1e445f66c362f2eaea4cf03af
1 file changed
tree: 03419ca5afb01c643916fb27e0b52c6f23296ef0
  1. InCallUI/