From 6e6af2c7ee1640ee492afade87e2ee0ae10485d7 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Tue, 20 Sep 2016 14:34:26 -0400 Subject: [PATCH] Protect against crash on user switch Somehow one of the tiles doesn't have a view yet. Assume that this is a transient part of the tiles getting recreated and that the skipped tile will get picked up in the next layout. Change-Id: Ia1370d66119bfcfa7b00bd087bcb0d72a072666a Fixes: 31394359 --- packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java index a21408d4929ed..5c8a6e25f6c24 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java @@ -160,6 +160,10 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha for (QSTile tile : tiles) { QSTileBaseView tileView = mQsPanel.getTileView(tile); + if (tileView == null) { + Log.e(TAG, "tileView is null " + tile.getTileSpec()); + continue; + } final TextView label = ((QSTileView) tileView).getLabel(); final View tileIcon = tileView.getIcon().getIconView(); if (count < mNumQuickTiles && mAllowFancy) {