From a53c3b2197b73d5b6a697ae2077e04065df84d9e Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Thu, 14 Jan 2016 16:06:36 -0500 Subject: Don't verify the scrollbar drawable Avoids infinite invalidations caused by re-use of scrollbar drawable during a single draw() pass. Does not address the general problem of drawable reuse causing unnecessary invalidations as a result of calls to setBounds() invoking invalidateSelf(). Bug: 26533725 Change-Id: I99e9c2dfe4ddfc833569e40e7268dcb03e931fc9 --- core/java/android/view/View.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index dea004e..720d9a8 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -16937,8 +16937,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ @CallSuper protected boolean verifyDrawable(Drawable who) { - return who == mBackground || (mScrollCache != null && mScrollCache.scrollBar == who) - || (mForegroundInfo != null && mForegroundInfo.mDrawable == who); + // Avoid verifying the scroll bar drawable so that we don't end up in + // an invalidation loop. This effectively prevents the scroll bar + // drawable from triggering invalidations and scheduling runnables. + return who == mBackground || (mForegroundInfo != null && mForegroundInfo.mDrawable == who); } /** -- cgit v1.1