From d274e92414988c72708af270e3799b83b4e3b40c Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Mon, 23 Mar 2015 16:21:11 -0700 Subject: Fix NPE in endCallClicked Save the call id before setting disconnect state in case a state change callback causes the primary call object to be cleared. Bug:19893538 Change-Id: Ib6583bfb25023bf514ee073e4970b18844d8561b --- InCallUI/src/com/android/incallui/CallCardPresenter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'InCallUI/src') diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 647cdfdff..690e2470d 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -695,9 +695,10 @@ public class CallCardPresenter extends Presenter } Log.i(this, "Disconnecting call: " + mPrimary); + final String callId = mPrimary.getId(); mPrimary.setState(Call.State.DISCONNECTING); CallList.getInstance().onUpdate(mPrimary); - TelecomAdapter.getInstance().disconnectCall(mPrimary.getId()); + TelecomAdapter.getInstance().disconnectCall(callId); } private String getNumberFromHandle(Uri handle) { -- cgit v1.2.3