summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-04-01 03:03:53 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-04-01 03:03:53 +0000
commit1d63b6c88a53c1650e50e2c87a48635f7a2c638f (patch)
treef30e4fcd3df1dfd1b1b3e348407323fbc16cfd79
parent22404310108ebca5246ac370bbf26a97f4ab3361 (diff)
parentadd5c6a9f2e049fe9998c924d9d3831299fa20c0 (diff)
Merge "Fix possible NPE" into rvc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java3
2 files changed, 8 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
index 7185d08b7d52..fee33dcd7677 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
@@ -543,7 +543,8 @@ public class BubbleStackView extends FrameLayout {
.setStiffness(SpringForce.STIFFNESS_LOW)
.setDampingRatio(SpringForce.DAMPING_RATIO_LOW_BOUNCY));
mExpandedViewYAnim.addEndListener((anim, cancelled, value, velocity) -> {
- if (mIsExpanded && mExpandedBubble != null) {
+ if (mIsExpanded && mExpandedBubble != null
+ && mExpandedBubble.getExpandedView() != null) {
mExpandedBubble.getExpandedView().updateView();
}
});
@@ -562,7 +563,7 @@ public class BubbleStackView extends FrameLayout {
// Update the insets after we're done translating otherwise position
// calculation for them won't be correct.
() -> {
- if (mExpandedBubble != null) {
+ if (mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) {
mExpandedBubble.getExpandedView().updateInsets(insets);
}
});
@@ -577,7 +578,7 @@ public class BubbleStackView extends FrameLayout {
// Reposition & adjust the height for new orientation
if (mIsExpanded) {
mExpandedViewContainer.setTranslationY(getExpandedViewY());
- if (mExpandedBubble != null) {
+ if (mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) {
mExpandedBubble.getExpandedView().updateView();
}
}
@@ -1264,6 +1265,7 @@ public class BubbleStackView extends FrameLayout {
void showExpandedViewContents(int displayId) {
if (mExpandedBubble != null
+ && mExpandedBubble.getExpandedView() != null
&& mExpandedBubble.getExpandedView().getVirtualDisplayId() == displayId) {
mExpandedBubble.setContentVisibility(true);
}
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java b/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java
index 31656a00c3ed..c292769f1066 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java
@@ -356,6 +356,9 @@ public class PhysicsAnimationLayout extends FrameLayout {
/** Immediately re-orders the view to the given index. */
public void reorderView(View view, int index) {
+ if (view == null) {
+ return;
+ }
final int oldIndex = indexOfChild(view);
super.removeView(view);