From a584bcd04d287e7771b0420156a1892a7962e4ff Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Wed, 24 Jan 2018 12:19:56 -0800 Subject: 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 --- java/com/android/incallui/InCallActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'java/com/android') diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java index 990560674..535b894f6 100644 --- a/java/com/android/incallui/InCallActivity.java +++ b/java/com/android/incallui/InCallActivity.java @@ -822,7 +822,11 @@ public class InCallActivity extends TransactionSafeFragmentActivity 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} */ -- cgit v1.2.3