diff options
author | Yorke Lee <yorkelee@google.com> | 2013-09-26 13:47:36 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-26 13:47:36 -0700 |
commit | a4459deb34b3e6e9653ca2a5a890ef8e38aacd7a (patch) | |
tree | 9b84668a0a7d4405203a7b9c0a2f6574515cd19f | |
parent | 29fbce35a65ba1f2a63f0ceca98e4c6f31b5267e (diff) | |
parent | 2e3eb7c90b6e17217e1289adeffb04e4218740eb (diff) |
am 8a07fbec: am 6519346a: Fix potential NPE in ConferenceManagerPresenter
* commit '8a07fbecb3f06abe88d065df8631e062be1f31ae':
Fix potential NPE in ConferenceManagerPresenter
-rw-r--r-- | InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java | 13 |
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); } |