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

Commit 47588e23 authored by Jordan Liu's avatar Jordan Liu
Browse files

Update reference to config_onlySingleDcAllowed

Update the reference to the old config to use the new methods in
CarrierConfigManager.

Bug: 29873049
Change-Id: I8b5cfb9791999524cffffe159cc6b872ce86fe62
Merged-In: I8b5cfb9791999524cffffe159cc6b872ce86fe62
parent dd6d6cfe
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.os.PersistableBundle;
import android.os.RegistrantList;
import android.os.ServiceManager;
import android.os.SystemClock;
@@ -55,6 +56,7 @@ import android.preference.PreferenceManager;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.provider.Telephony;
import android.telephony.CarrierConfigManager;
import android.telephony.CellLocation;
import android.telephony.PcoData;
import android.telephony.Rlog;
@@ -2245,8 +2247,20 @@ public class DcTracker extends Handler {
     * @return true if only single DataConnection is allowed
     */
    private boolean isOnlySingleDcAllowed(int rilRadioTech) {
        int[] singleDcRats = mPhone.getContext().getResources().getIntArray(
                com.android.internal.R.array.config_onlySingleDcAllowed);
        // Default single dc rats with no knowledge of carrier
        int[] singleDcRats = null;
        // get the carrier specific value, if it exists, from CarrierConfigManager
        // generally configManager and bundle should not be null, but if they are it should be okay
        // to leave singleDcRats null as well
        CarrierConfigManager configManager = (CarrierConfigManager)
                mPhone.getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
        if (configManager != null) {
            PersistableBundle bundle = configManager.getConfig();
            if (bundle != null) {
                singleDcRats = bundle.getIntArray(
                        CarrierConfigManager.KEY_ONLY_SINGLE_DC_ALLOWED_INT_ARRAY);
            }
        }
        boolean onlySingleDcAllowed = false;
        if (Build.IS_DEBUGGABLE &&
                SystemProperties.getBoolean("persist.telephony.test.singleDc", false)) {