From dba9934fb789d67bbd305aa384bf5917a001e715 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Tue, 27 Jun 2017 16:56:41 -0700 Subject: [PATCH] AdaptiveIconDrawable should not update layer bounds when bound is empty Test: build succeeds. Also, setting tint mode does not result in error. Bug: 37682281 Change-Id: I5991b8e58514a2130a793a5edb90baeafae9b148 --- .../java/android/graphics/drawable/AdaptiveIconDrawable.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java index 8616d58a03196..1d0cfa5ff0824 100644 --- a/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java +++ b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java @@ -289,6 +289,9 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback } private void updateLayerBounds(Rect bounds) { + if (bounds.isEmpty()) { + return; + } try { suspendChildInvalidation(); updateLayerBoundsInternal(bounds); @@ -1109,4 +1112,4 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback mCheckedStateful = false; } } -} \ No newline at end of file +}