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
Loading
Please register or sign in to comment