OSDN Git Service

Protect against crash while sysui is initing
authorJason Monk <jmonk@google.com>
Wed, 8 Mar 2017 14:11:51 +0000 (09:11 -0500)
committerJason Monk <jmonk@google.com>
Wed, 8 Mar 2017 14:11:51 +0000 (09:11 -0500)
Sometimes when switching users not all the views are there yet, but
we will get another layout callback once they are, and can update
our animators then.

Change-Id: I029839e5c69c8c441cf89b0536a90e223dc35180
Fixes: 35949496
Test: Switch users

packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java

index 3337090..a30b03b 100644 (file)
@@ -175,7 +175,8 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
             View view = mQs.getView();
             if (count < mNumQuickTiles && mAllowFancy) {
                 // Quick tiles.
-                com.android.systemui.plugins.qs.QSTileView quickTileView = mQuickQsPanel.getTileView(tile);
+                QSTileView quickTileView = mQuickQsPanel.getTileView(tile);
+                if (quickTileView == null) continue;
 
                 lastX = loc1[0];
                 getRelativePosition(loc1, quickTileView.getIcon().getIconView(), view);