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
This commit is contained in:
Jason Monk
2016-09-20 14:34:26 -04:00
parent 7b68411de0
commit 6e6af2c7ee

View File

@@ -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) {