summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-09-18 18:28:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-18 18:28:03 +0000
commitf28f8678e41fc0a7f0580d738794b152f3b51656 (patch)
tree0b2b2f6c18241edeff9393eec017c4cfb3ef0022 /InCallUI
parentb710f1364304307c914a562a27439192e59590b0 (diff)
parentbf321581c30f14567aeef7a1ed4edf75392216cf (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.java17
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");
}