Skip to content
Commit bfa11e4a authored by Chet Haase's avatar Chet Haase
Browse files

Avoid changing internal state of shared drawable

An optimization in ImageView nulled out the internal bitmap of a cached
internal BitmapDrawable object created to wrap a bitmap set on the ImageView.
However, apps can get ahold of that cached object via Drawable.getBitmap(),
resulting in having the state of that object they may be using changing out
from under them.

The change is to null out the cached object when getDrawable() is called, to avoid
leaking internal state that we may change.
That way, the app can continue to use that object if they want to, but we are no longer
relying on it internally, and will create a new one when needed.

Issue #22930646  [1P Regression from L] ImageView is blanked out in Activity in Google Express

Change-Id: Ic86cb93be4897b6ba247c1fabcda507e4ba01300
parent e72377e1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment