From 8a30b31a7765b9a3beaacd2ebc9467fedba73d3f Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Fri, 13 Jun 2014 10:50:32 -0700 Subject: [PATCH] Fix CTS regression in fitSystemWindows Don't attempt to apply null insets from a call to fitSystemWindows. Immediately return false since null insets cannot be applied. Bug 15452706 Change-Id: I1ad4cc0288db36b3e9485481173e64b2140a0204 --- core/java/android/view/View.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 41037a52b85b3..b9e56f36b5430 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -6116,6 +6116,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ protected boolean fitSystemWindows(Rect insets) { if ((mPrivateFlags3 & PFLAG3_APPLYING_INSETS) == 0) { + if (insets == null) { + // Null insets by definition have already been consumed. + // This call cannot apply insets since there are none to apply, + // so return false. + return false; + } // If we're not in the process of dispatching the newer apply insets call, // that means we're not in the compatibility path. Dispatch into the newer // apply insets path and take things from there.