From 816e4c55053c41f61d45b0a379860d80a7df99cb Mon Sep 17 00:00:00 2001 From: Santos Cordon Date: Mon, 30 Sep 2013 11:36:24 -0700 Subject: Protect hideDialpad() code with isActivityStarted() check. Could hit NPE if the activity was not up or already brought down like with Fixed Dial Number where a disconnect comes almost immediately after dialing out. bug:10995838 Change-Id: I150d1ca135702814ac6d78722c3ad15ae5273c83 --- InCallUI/src/com/android/incallui/InCallPresenter.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'InCallUI/src/com/android') diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index 541661c57..4b3893994 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -246,7 +246,7 @@ public class InCallPresenter implements CallList.Listener { */ @Override public void onDisconnect(Call call) { - mInCallActivity.hideDialpadForDisconnect(); + hideDialpadForDisconnect(); maybeShowErrorDialogOnDisconnect(call); // We need to do the run the same code as onCallListChange. @@ -486,6 +486,15 @@ public class InCallPresenter implements CallList.Listener { } } + /** + * Hides the dialpad. Called when a call is disconnected (Requires hiding dialpad). + */ + private void hideDialpadForDisconnect() { + if (isActivityStarted()) { + mInCallActivity.hideDialpadForDisconnect(); + } + } + /** * When the state of in-call changes, this is the first method to get called. It determines if * the UI needs to be started or finished depending on the new state and does it. -- cgit v1.2.3