Add null check before updating NotificationItemView
It's possible that the notifications were removed between the popup opening
and updating its UI. In that case, mNotificationItemView will be null.
Bug: 146152941
Change-Id: I60b44ea6d766720613cf2f25481fa3fc17cab6af
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index e70673a..d2d48ca 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -37,7 +37,6 @@
import android.os.Handler;
import android.os.Looper;
import android.util.AttributeSet;
-import android.util.Log;
import android.util.Pair;
import android.view.MotionEvent;
import android.view.View;
@@ -66,7 +65,6 @@
import com.android.launcher3.popup.PopupDataProvider.PopupDataChangeListener;
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider;
-import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.touch.ItemLongClickListener;
import com.android.launcher3.util.PackageUserKey;
@@ -339,7 +337,9 @@
}
public void applyNotificationInfos(List<NotificationInfo> notificationInfos) {
- mNotificationItemView.applyNotificationInfos(notificationInfos);
+ if (mNotificationItemView != null) {
+ mNotificationItemView.applyNotificationInfos(notificationInfos);
+ }
}
private void updateHiddenShortcuts() {