Fixed a regression where we incorrectly reported that the dialpad was visible.
A request was made to update the value of #isDialpadVisible, in the process a
regression was introduced that would cause #isDialpadVisible to return true
when the dialpad's root view was null. This caused a NPE when we tried to
animate it.
We should now return the correct value in the scenarios important to our
partners as well our users and animations.
Bug: 64657832,72384544
Test: manual/logging
PiperOrigin-RevId: 183122628
Change-Id: I981e944dbb003064163b8ec11883dbc5381cba0e
diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java
index 9905606..535b894 100644
--- a/java/com/android/incallui/InCallActivity.java
+++ b/java/com/android/incallui/InCallActivity.java
@@ -822,7 +822,11 @@
public boolean isDialpadVisible() {
DialpadFragment dialpadFragment = getDialpadFragment();
- return dialpadFragment != null && dialpadFragment.getUserVisibleHint();
+ return dialpadFragment != null
+ && dialpadFragment.isAdded()
+ && !dialpadFragment.isHidden()
+ && dialpadFragment.getView() != null
+ && dialpadFragment.getUserVisibleHint();
}
/** Returns the {@link DialpadFragment} that's shown by this activity, or {@code null} */