fix crash from carriersignalAgent under sip call
fionaxu [Wed, 3 May 2017 18:46:54 +0000 (11:46 -0700)]
Bug: 37917990
Test: Manual test with sip call
Change-Id: Ia6d74928655d60d35062e6a8e920788759d99efd
(cherry picked from commit d2569726c9c5a93c852ec6ddd5ca80c760845061)

src/java/com/android/internal/telephony/CarrierSignalAgent.java

index 72da030..4d6d464 100644 (file)
@@ -101,7 +101,8 @@ public class CarrierSignalAgent {
             if (DBG) log("CarrierSignalAgent receiver action: " + action);
             if (action.equals(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED)) {
                 // notify carrier apps before cache get purged
-                if (IccCardConstants.State.ABSENT == mPhone.getIccCard().getState()) {
+                if (mPhone.getIccCard() != null
+                        && IccCardConstants.State.ABSENT == mPhone.getIccCard().getState()) {
                     notifyCarrierSignalReceivers(
                             new Intent(TelephonyIntents.ACTION_CARRIER_SIGNAL_RESET));
                 }