diff options
author | Jay Shrauner <shrauner@google.com> | 2015-08-07 15:39:57 -0700 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2015-08-08 01:47:01 +0000 |
commit | b55c656d50042aafe356ea9b13689aefc22ba5c0 (patch) | |
tree | 51233219d25cb78fed679852ca2948e96740c220 | |
parent | 202a140e8e89c8fffec84aeefb606d58cb50f6d6 (diff) |
DO NOT MERGE Null check CallList mapping in callbacks
In onPostDialWait, onDetailsChanged, and onConferenceableCallsChanged
callbacks, check to make sure the call list contains a mapping for the
Telecom Call object.
Bug:23031241
Change-Id: I2a9703d9c303fe0b2e320d811d21c71e5c429269
(cherry picked from commit 71a6555ac854303dc023c5e6c9a27c63ec956e3d)
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallPresenter.java | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index ff1a50fcb..cf162c728 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -120,28 +120,34 @@ public class InCallPresenter implements CallList.Listener, private final android.telecom.Call.Callback mCallCallback = new android.telecom.Call.Callback() { @Override - public void onPostDialWait(android.telecom.Call call, String remainingPostDialSequence) { - onPostDialCharWait(mCallList.getCallByTelecommCall(call).getId(), - remainingPostDialSequence); + public void onPostDialWait(android.telecom.Call telecomCall, + String remainingPostDialSequence) { + final Call call = mCallList.getCallByTelecommCall(telecomCall); + if (call == null) { + Log.w(this, "Call not found in call list: " + telecomCall); + return; + } + onPostDialCharWait(call.getId(), remainingPostDialSequence); } @Override - public void onDetailsChanged(android.telecom.Call call, + public void onDetailsChanged(android.telecom.Call telecomCall, android.telecom.Call.Details details) { + final Call call = mCallList.getCallByTelecommCall(telecomCall); + if (call == null) { + Log.w(this, "Call not found in call list: " + telecomCall); + return; + } for (InCallDetailsListener listener : mDetailsListeners) { - listener.onDetailsChanged(mCallList.getCallByTelecommCall(call), - details); + listener.onDetailsChanged(call, details); } } @Override - public void onConferenceableCallsChanged( - android.telecom.Call call, List<android.telecom.Call> conferenceableCalls) { - Log.i(this, "onConferenceableCallsChanged: " + call); - for (InCallDetailsListener listener : mDetailsListeners) { - listener.onDetailsChanged(mCallList.getCallByTelecommCall(call), - call.getDetails()); - } + public void onConferenceableCallsChanged(android.telecom.Call telecomCall, + List<android.telecom.Call> conferenceableCalls) { + Log.i(this, "onConferenceableCallsChanged: " + telecomCall); + onDetailsChanged(telecomCall, telecomCall.getDetails()); } }; |