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

Commit 050f7a76 authored by Jeremy Goldman's avatar Jeremy Goldman
Browse files

If the CarrierConfigManager is still null, return that the preference is

not available.

Test: atest -c VideoCallingPreferenceControllerTest
Bug: 186594185
Change-Id: I4650d9f77f6a4a0cb84d6e20f02e4ab1d1841131
parent 9c69df3b
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;