romannurik/muzei — pull request #94 by ianhanniballake (2014-11-24 20:11:27+00:00)
Title: New API: Retrieve current Artwork details and Image

Instead of external applications needing to re-implement all of Muzei or redownload images that Muzei has already cached, we provide a ContentProvider with a single table and single row which stores the current Artwork details and implements openFile() to give access to the already cached artwork Bitmap.

MuzeiContract has been added to the api library as well as helper methods for serializing/deserializing Artwork with ContentProvider classes. To remove the requirement to have an always running ContentObserver, Muzei also sends out a ACTION_ARTWORK_CHANGED broadcast so that apps can be started only when data is changed.

Added an example-contract-widget module which displays the current artwork (and has a content description of the current title or byline) to demonstrate the API on phones/tablets.

In addition, this API also bridges over the Artwork detail and image onto Android Wear devices, ensuring only one copy of the image is sent over Bluetooth to the Wearable and providing the exact same API for both types of devices.