diff --git a/packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java b/packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java index a4f1ef4fa7560..ef0fa012d56d9 100644 --- a/packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java +++ b/packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java @@ -90,6 +90,9 @@ public class TouchInsetManager { final Region cumulativeRegion = Region.obtain(); mTrackedViews.stream().forEach(view -> { + if (!view.isAttachedToWindow()) { + return; + } final Rect boundaries = new Rect(); view.getDrawingRect(boundaries); ((ViewGroup) view.getRootView()).offsetDescendantRectToMyCoords(view, boundaries);