From 85325584318d930deae329dc14e19acd9fcda295 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Sat, 9 Apr 2016 20:43:40 -0700 Subject: [PATCH] Fixed a crash when changing density with HUN visible The Quick settings page indicator was trying to access views that don't exist yet. Fixes: 27927374 Change-Id: I1600ce8432b6550268da20443d32193b1d2debe4 --- .../SystemUI/src/com/android/systemui/qs/PageIndicator.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/PageIndicator.java b/packages/SystemUI/src/com/android/systemui/qs/PageIndicator.java index e050b0d68d202..9239dedc11237 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/PageIndicator.java +++ b/packages/SystemUI/src/com/android/systemui/qs/PageIndicator.java @@ -120,9 +120,8 @@ public class PageIndicator extends ViewGroup { } ImageView first = (ImageView) getChildAt(firstIndex); ImageView second = (ImageView) getChildAt(secondIndex); - if (second == null) { - // Weird state where number of pages must not have propagated yet. - return; + if (first == null || second == null) { + // may happen during reInflation or other weird cases } // Lay the two views on top of each other. second.setTranslationX(first.getX() - second.getX());