diff options
author | Yorke Lee <yorkelee@google.com> | 2014-09-18 18:28:03 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-18 18:28:03 +0000 |
commit | f28f8678e41fc0a7f0580d738794b152f3b51656 (patch) | |
tree | 0b2b2f6c18241edeff9393eec017c4cfb3ef0022 /InCallUI | |
parent | b710f1364304307c914a562a27439192e59590b0 (diff) | |
parent | bf321581c30f14567aeef7a1ed4edf75392216cf (diff) |
Merge "Add null check for calls in CallList" into lmp-dev
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/TelecomAdapter.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/TelecomAdapter.java b/InCallUI/src/com/android/incallui/TelecomAdapter.java index 5f32c7e47..62b1bfc83 100644 --- a/InCallUI/src/com/android/incallui/TelecomAdapter.java +++ b/InCallUI/src/com/android/incallui/TelecomAdapter.java @@ -64,12 +64,18 @@ final class TelecomAdapter implements InCallPhoneListener { } private android.telecom.Call getTelecommCallById(String callId) { - return CallList.getInstance().getCallById(callId).getTelecommCall(); + final Call call = CallList.getInstance().getCallById(callId); + return call == null ? null : call.getTelecommCall(); } void answerCall(String callId, int videoState) { if (mPhone != null) { - getTelecommCallById(callId).answer(videoState); + final android.telecom.Call call = getTelecommCallById(callId); + if (call != null) { + call.answer(videoState); + } else { + Log.e(this, "error answerCall, call not in call list: " + callId); + } } else { Log.e(this, "error answerCall, mPhone is null"); } @@ -77,7 +83,12 @@ final class TelecomAdapter implements InCallPhoneListener { void rejectCall(String callId, boolean rejectWithMessage, String message) { if (mPhone != null) { - getTelecommCallById(callId).reject(rejectWithMessage, message); + final android.telecom.Call call = getTelecommCallById(callId); + if (call != null) { + call.reject(rejectWithMessage, message); + } else { + Log.e(this, "error rejectCall, call not in call list: " + callId); + } } else { Log.e(this, "error rejectCall, mPhone is null"); } |