Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e751017 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix phone process crash due to null carrier config"

parents 0fd38780 bc8832aa
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -475,7 +475,7 @@ public class AccessNetworksManager extends Handler {
            b = mCarrierConfigManager.getConfigForSubId(mPhone.getSubId(),
                    CarrierConfigManager
                            .KEY_CARRIER_QUALIFIED_NETWORKS_SERVICE_PACKAGE_OVERRIDE_STRING);
            if (!b.isEmpty()) {
            if (b != null && !b.isEmpty()) {
                // If carrier config overrides it, use the one from carrier config
                String carrierConfigPackageName = b.getString(CarrierConfigManager
                        .KEY_CARRIER_QUALIFIED_NETWORKS_SERVICE_PACKAGE_OVERRIDE_STRING);
@@ -506,7 +506,7 @@ public class AccessNetworksManager extends Handler {
            b = mCarrierConfigManager.getConfigForSubId(mPhone.getSubId(),
                    CarrierConfigManager
                            .KEY_CARRIER_QUALIFIED_NETWORKS_SERVICE_CLASS_OVERRIDE_STRING);
            if (!b.isEmpty()) {
            if (b != null && !b.isEmpty()) {
                // If carrier config overrides it, use the one from carrier config
                String carrierConfigClassName = b.getString(CarrierConfigManager
                        .KEY_CARRIER_QUALIFIED_NETWORKS_SERVICE_CLASS_OVERRIDE_STRING);
+2 −2
Original line number Diff line number Diff line
@@ -630,13 +630,13 @@ public class DataServiceManager extends Handler {

    @NonNull
    private PersistableBundle getCarrierConfigSubset(String key) {
        PersistableBundle configs = new PersistableBundle();
        PersistableBundle configs = null;
        try {
            configs = mCarrierConfigManager.getConfigForSubId(mPhone.getSubId(), key);
        } catch (RuntimeException e) {
            loge("CarrierConfigLoader is not available.");
        }
        return configs;
        return configs != null ? configs : new PersistableBundle();
    }

    private void sendCompleteMessage(Message msg, @DataServiceCallback.ResultCode int code) {
+2 −2
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ public class EmergencyNumberTracker extends Handler {

    @NonNull
    private PersistableBundle getCarrierConfigSubset(String key) {
        PersistableBundle bundle = new PersistableBundle();
        PersistableBundle bundle = null;

        if (mPhone != null) {
            CarrierConfigManager ccm =
@@ -386,7 +386,7 @@ public class EmergencyNumberTracker extends Handler {
                loge("CarrierConfigLoader is not available.");
            }
        }
        return bundle;
        return bundle != null ? bundle : new PersistableBundle();
    }

    private String getInitialCountryIso() {
+2 −2
Original line number Diff line number Diff line
@@ -1819,13 +1819,13 @@ public class UiccProfile extends IccCard {

    @NonNull
    private PersistableBundle getCarrierConfigSubset(int subId, String... keys) {
        PersistableBundle bundle = new PersistableBundle();
        PersistableBundle bundle = null;
        try {
            bundle = mCarrierConfigManager.getConfigForSubId(subId, keys);
        } catch (RuntimeException e) {
            loge("CarrierConfigLoader is not available.");
        }
        return bundle;
        return bundle != null ? bundle : new PersistableBundle();
    }

    private static String eventToString(int event) {