Merge "Fix two NPEs in TelephonyConnection" into oc-mr1-dev
am: c8e7134083
Change-Id: I9ca181aea1dc35f72b31c91f60ff8125c248e255
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index d8079f7..d41a8f0 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -149,9 +149,10 @@
notifyConferenceMergeFailed();
break;
case MSG_SUPP_SERVICE_NOTIFY:
+ Phone phone = getPhone();
Log.v(TelephonyConnection.this, "MSG_SUPP_SERVICE_NOTIFY on phoneId : "
- + getPhone() != null ? Integer.toString(getPhone().getPhoneId())
- : "null");
+ + (phone != null ? Integer.toString(phone.getPhoneId())
+ : "null"));
SuppServiceNotification mSsNotification = null;
if (msg.obj != null && ((AsyncResult) msg.obj).result != null) {
mSsNotification =
@@ -1746,6 +1747,15 @@
private void refreshConferenceSupported() {
boolean isVideoCall = VideoProfile.isVideo(getVideoState());
Phone phone = getPhone();
+ if (phone == null) {
+ Log.w(this, "refreshConferenceSupported = false; phone is null");
+ if (isConferenceSupported()) {
+ setConferenceSupported(false);
+ notifyConferenceSupportedChanged(false);
+ }
+ return;
+ }
+
boolean isIms = phone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS;
boolean isVoWifiEnabled = false;
if (isIms) {