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

Commit d6913243 authored by Jeremy Goldman's avatar Jeremy Goldman Committed by Android (Google) Code Review
Browse files

Merge "If the CarrierConfigManager is still null, return that the preference...

Merge "If the CarrierConfigManager is still null, return that the preference is not available." into sc-dev
parents 4ec4cf32 050f7a76
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.settings.network.telephony;
import android.content.Context;
import android.os.PersistableBundle;
import android.telephony.CarrierConfigManager;
import android.telephony.PhoneStateListener;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyCallback;
import android.telephony.TelephonyManager;
@@ -143,6 +142,16 @@ public class VideoCallingPreferenceController extends TelephonyTogglePreferenceC
            return false;
        }

        // When called within Settings Search, this variable may still be null.
        if (mCarrierConfigManager == null) {
            Log.e(TAG, "CarrierConfigManager set to null.");
            mCarrierConfigManager = mContext.getSystemService(CarrierConfigManager.class);
            if (mCarrierConfigManager == null) {
                Log.e(TAG, "Unable to reinitialize CarrierConfigManager.");
                return false;
            }
        }

        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
        if (carrierConfig == null) {
            return false;