ImageCache and ImageProvider changes

Summary

Description of change

containsKey change
ImageProvider changes

Migration guide

ImageCache change
ImageProvider change

Timeline

References

Summary

ImageCache now has a method called containsKey.
ImageProvider subclasses should not override resolve,
but instead should implement new methods on ImageProvider.
These changes were submitted as a single commit to the framework.

Description of change

The sections below describe the changes to containsKey
and ImageProvider.

containsKey change

Clients of the ImageCache, such as a custom ImageProvider,
may want to know if the cache is already tracking an image.
Adding the containsKey method allows callers to discover
this without calling a method like putIfAbsent,
which can trigger an undesired call to ImageProvider.load.

The default implementation checks both pending and cached
image buckets.