Avoid race condition during grayscale animation of QS tile

DrawableIcon returns the same instance of its Drawable
for both getDrawable() and getInvisibleDrawable().
This could cause a race condition during grayscale animation
of a QS tile which uses the same icon for both ON and OFF state.

Clone the original Drawable and use it for invisible drawable
to solve this.

Fixes: 65437135
Test: manual - put a custom tile at the first position of QS panel
               and tap it

Change-Id: Ie74edd9c5e58118a70b5abd8096cdd1297940ef5
1 file changed