summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-09-26 13:44:38 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-26 13:44:38 -0700
commit2e3eb7c90b6e17217e1289adeffb04e4218740eb (patch)
treef261da5d1d8a835bce003e3e117f782f3c4f0d9f
parentc65ca96b36750b06a2c8ad1ceb4470b295cb9037 (diff)
parentff1ca1369f3d9469bd770903dcc2b23edb727973 (diff)
am 6519346a: Fix potential NPE in ConferenceManagerPresenter
* commit '6519346a812e27ae02be610ff15cc51d104b297c': Fix potential NPE in ConferenceManagerPresenter
-rw-r--r--InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java
index 041614db6..d0f62d78b 100644
--- a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java
+++ b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java
@@ -21,6 +21,7 @@ import android.content.Context;
import com.android.incallui.ContactInfoCache.ContactCacheEntry;
import com.android.incallui.InCallPresenter.InCallState;
import com.android.incallui.InCallPresenter.InCallStateListener;
+import com.android.services.telephony.common.Call;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSortedSet;
@@ -57,11 +58,13 @@ public class ConferenceManagerPresenter
public void onStateChange(InCallState state, CallList callList) {
if (getUi().isFragmentVisible()) {
Log.v(this, "onStateChange" + state);
- if (state == InCallState.INCALL && callList.getActiveOrBackgroundCall() != null &&
- callList.getActiveOrBackgroundCall().isConferenceCall()) {
- Log.v(this, "Number of existing calls is " +
- String.valueOf(callList.getActiveCall().getChildCallIds().size()));
- update(callList);
+ if (state == InCallState.INCALL) {
+ final Call call = callList.getActiveOrBackgroundCall();
+ if (call != null && call.isConferenceCall()) {
+ Log.v(this, "Number of existing calls is " +
+ String.valueOf(call.getChildCallIds().size()));
+ update(callList);
+ }
} else {
getUi().setVisible(false);
}