Null-check tooltip view to avoid race condition crash.

I think this happens if you tap the tooltip just as the dialog times out? Can't hurt to check.

Fixes: 191281724
Test: crashes at least as infrequently as before, probably less
Change-Id: I3c83e775a7fd278dc255242518412ba790625fdb
This commit is contained in:
Josh Tsuji
2021-06-28 11:15:13 -04:00
parent 82f0979e7b
commit 8e82c86669

View File

@@ -1127,7 +1127,12 @@ public class VolumeDialogImpl implements VolumeDialog,
.alpha(0.f)
.setStartDelay(0)
.setDuration(mDialogHideAnimationDurationMs)
.withEndAction(() -> mODICaptionsTooltipView.setVisibility(INVISIBLE))
.withEndAction(() -> {
// It might have been nulled out by tryToRemoveCaptionsTooltip.
if (mODICaptionsTooltipView != null) {
mODICaptionsTooltipView.setVisibility(INVISIBLE);
}
})
.start();
}
}