Prevent LayerDrawable bounds updates from being re-entrant

Collect child invalidations during layer bounds change, then dispatch a
single invalidation if any children requested invalidation. This prevents
re-entrance from, for example, a LayerDrawable.updateLayerBounds() call
invoking setBounds() on a child, which necessarily calls invalidateSelf()
and immediately propagates up to ImageView.invalidateDrawable(), which
then calls configureBounds() and puts us back in updateLayerBounds().

Bug: 28636072
Change-Id: I36c9eefc18904d493292d51b37e4b05cfddcf794
1 file changed