summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mady Mellor <madym@google.com> 2020-04-10 13:40:05 -0700
committer Mady Mellor <madym@google.com> 2020-04-10 13:44:35 -0700
commit2dce0fe59359b86a6a8f419bb01f0c5a3ac6a35a (patch)
treeea3c9dc42d677ba54c56eec77bcdad5f0ff2f856
parent4cbb22353a857c31bd3413da6ca8d3de0e2fe59f (diff)
Fix preventable NPE & probable others
Test: treehugger Bug: 153698788 Change-Id: I77bab3f8db7dc633784a2bbb03c57125726c1ffe
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
index eff693436451..e9bcb755418a 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
@@ -1143,7 +1143,8 @@ public class BubbleStackView extends FrameLayout {
if (show
&& mShouldShowManageEducation
&& mManageEducationView.getVisibility() != VISIBLE
- && mIsExpanded) {
+ && mIsExpanded
+ && mExpandedBubble.getExpandedView() != null) {
mManageEducationView.setAlpha(0);
mManageEducationView.setVisibility(VISIBLE);
mManageEducationView.post(() -> {
@@ -1848,7 +1849,8 @@ public class BubbleStackView extends FrameLayout {
Log.d(TAG, "updateExpandedBubble()");
}
mExpandedViewContainer.removeAllViews();
- if (mIsExpanded && mExpandedBubble != null) {
+ if (mIsExpanded && mExpandedBubble != null
+ && mExpandedBubble.getExpandedView() != null) {
BubbleExpandedView bev = mExpandedBubble.getExpandedView();
mExpandedViewContainer.addView(bev);
bev.populateExpandedView();
@@ -1868,7 +1870,7 @@ public class BubbleStackView extends FrameLayout {
if (!mExpandedViewYAnim.isRunning()) {
// We're not animating so set the value
mExpandedViewContainer.setTranslationY(y);
- if (mExpandedBubble != null) {
+ if (mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) {
mExpandedBubble.getExpandedView().updateView();
}
} else {
@@ -1906,7 +1908,7 @@ public class BubbleStackView extends FrameLayout {
}
private void updatePointerPosition() {
- if (mExpandedBubble == null) {
+ if (mExpandedBubble == null || mExpandedBubble.getExpandedView() == null) {
return;
}
int index = getBubbleIndex(mExpandedBubble);
@@ -1988,7 +1990,7 @@ public class BubbleStackView extends FrameLayout {
* a back key down/up event pair is forwarded to the bubble Activity.
*/
boolean performBackPressIfNeeded() {
- if (!isExpanded() || mExpandedBubble == null) {
+ if (!isExpanded() || mExpandedBubble == null || mExpandedBubble.getExpandedView() == null) {
return false;
}
return mExpandedBubble.getExpandedView().performBackPressIfNeeded();