If a view is not accelerated but has its layer type set to
LAYER_TYPE_HARDWARE, then the framework will use the old drawing cache
approach, to cache it in a bitmap. This works fine, but when the layer
is set to NONE, that drawing cache is not destroyed, as it would be were
the layer set to LAYER_TYPE_SOFTWARE. This prevents future invalidations on
the view from working correctly because the bitmap cache has never been
destroyed and recreated.
The fix is to always destroy the drawing cache when the layer type is
changed from SOFTWARE or HARDWARE, to make sure that it gets set appropriately
regardless of the state of the view's acceleration.
Change-Id: I449649e6d370477825015505da76564455a156e6