Fix two NPEs in TelephonyConnection
1. A trinary condition was screwed up and not doing a null check
properly
2. Add a null check in refreshConferenceSupported
Change-Id: Ib0a0d6c19b5e473e7c3c5ab8d1148142ae677ffa
Fixes: 35380056
Fixes: 64734432
Test: manual
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index a403d1f..d4bb17b 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -151,9 +151,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 =
@@ -1738,6 +1739,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) {