summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2016-07-27 10:23:35 -0400
committergitbuildkicker <android-build@google.com>2016-08-25 09:20:51 -0700
commit71c5b4497e8a25df20bb2531da972f5b2371073d (patch)
tree45e909784ad9ea6995154cb212ebd70fbeef1e6b
parentc4d27e949190d0dda13807d445544793e58aeb6c (diff)
downloadbase-71c5b4497e8a25df20bb2531da972f5b2371073d.tar.gz
Avoid potential re-entry as a result of child mutation
Don't set the callback until we're all done making changes. Bug: 30902893 Change-Id: Ia1560692a83ecb2c50f5e77fa4d1e8155a78a204 (cherry picked from commit b46ba3b2b0268688852cdf3d1fb4afe4873d63be) (cherry picked from commit 66b3a0d1aa48d5d663dcad86468605c565bb1880)
-rw-r--r--graphics/java/android/graphics/drawable/DrawableContainer.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index d5143dae7851..cc7f5c7cf753 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -851,8 +851,8 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
private Drawable prepareDrawable(Drawable child) {
child.setLayoutDirection(mLayoutDirection);
- child.setCallback(mOwner);
child = child.mutate();
+ child.setCallback(mOwner);
return child;
}