Merge "Fix preventable NPE & probable others" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-04-10 23:03:15 +00:00
committed by Android (Google) Code Review

View File

@@ -1349,7 +1349,8 @@ public class BubbleStackView extends FrameLayout {
if (show if (show
&& mShouldShowManageEducation && mShouldShowManageEducation
&& mManageEducationView.getVisibility() != VISIBLE && mManageEducationView.getVisibility() != VISIBLE
&& mIsExpanded) { && mIsExpanded
&& mExpandedBubble.getExpandedView() != null) {
mManageEducationView.setAlpha(0); mManageEducationView.setAlpha(0);
mManageEducationView.setVisibility(VISIBLE); mManageEducationView.setVisibility(VISIBLE);
mManageEducationView.post(() -> { mManageEducationView.post(() -> {
@@ -1909,7 +1910,8 @@ public class BubbleStackView extends FrameLayout {
Log.d(TAG, "updateExpandedBubble()"); Log.d(TAG, "updateExpandedBubble()");
} }
mExpandedViewContainer.removeAllViews(); mExpandedViewContainer.removeAllViews();
if (mIsExpanded && mExpandedBubble != null) { if (mIsExpanded && mExpandedBubble != null
&& mExpandedBubble.getExpandedView() != null) {
BubbleExpandedView bev = mExpandedBubble.getExpandedView(); BubbleExpandedView bev = mExpandedBubble.getExpandedView();
mExpandedViewContainer.addView(bev); mExpandedViewContainer.addView(bev);
bev.populateExpandedView(); bev.populateExpandedView();
@@ -1929,7 +1931,7 @@ public class BubbleStackView extends FrameLayout {
if (!mExpandedViewYAnim.isRunning()) { if (!mExpandedViewYAnim.isRunning()) {
// We're not animating so set the value // We're not animating so set the value
mExpandedViewContainer.setTranslationY(y); mExpandedViewContainer.setTranslationY(y);
if (mExpandedBubble != null) { if (mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) {
mExpandedBubble.getExpandedView().updateView(); mExpandedBubble.getExpandedView().updateView();
} }
} else { } else {
@@ -1967,7 +1969,7 @@ public class BubbleStackView extends FrameLayout {
} }
private void updatePointerPosition() { private void updatePointerPosition() {
if (mExpandedBubble == null) { if (mExpandedBubble == null || mExpandedBubble.getExpandedView() == null) {
return; return;
} }
int index = getBubbleIndex(mExpandedBubble); int index = getBubbleIndex(mExpandedBubble);
@@ -2049,7 +2051,7 @@ public class BubbleStackView extends FrameLayout {
* a back key down/up event pair is forwarded to the bubble Activity. * a back key down/up event pair is forwarded to the bubble Activity.
*/ */
boolean performBackPressIfNeeded() { boolean performBackPressIfNeeded() {
if (!isExpanded() || mExpandedBubble == null) { if (!isExpanded() || mExpandedBubble == null || mExpandedBubble.getExpandedView() == null) {
return false; return false;
} }
return mExpandedBubble.getExpandedView().performBackPressIfNeeded(); return mExpandedBubble.getExpandedView().performBackPressIfNeeded();