diff options
author | Yorke Lee <yorkelee@google.com> | 2014-09-18 18:39:48 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-18 18:39:48 +0000 |
commit | 8474c49be93dad181b26beb7d01b2d05ae740b43 (patch) | |
tree | e8982b247e4b64954ba475bedd8cd51b9f2381af /InCallUI | |
parent | ec42b5efd1c512e3aade863de5a57a3e5f3ec403 (diff) | |
parent | f28f8678e41fc0a7f0580d738794b152f3b51656 (diff) |
am bba6f8dc: Merge "Add null check for calls in CallList" into lmp-dev
* commit 'bba6f8dc6cbcf59af9e0c169f2657887a79b4670':
Add null check for calls in CallList
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"); } |