diff options
author | Yorke Lee <yorkelee@google.com> | 2014-09-18 18:49:47 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-18 18:49:47 +0000 |
commit | debeb6b926bd54653f2228240a959704ca580040 (patch) | |
tree | f7206d613f7652976ef2bd1020b3328c57b01ca5 /InCallUI | |
parent | 9f73f11b5d3b4eb1baf9c37b1dfe610eddbc6b68 (diff) | |
parent | 8474c49be93dad181b26beb7d01b2d05ae740b43 (diff) |
am 1fbc2095: am bba6f8dc: Merge "Add null check for calls in CallList" into lmp-dev
* commit '1fbc20952221467356c98c63f9c9eed4d2952aa5':
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"); } |