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

Commit 28c76b6f authored by Chaitanya Saggurthi's avatar Chaitanya Saggurthi Committed by Ricardo Cerqueira
Browse files

Get proper network type when records loaded

Get preferred netwotk type based on phone ID when records loaded.

Change-Id: I3899a4287edbebf7228e8ed53e4b406ad2c9ef93
parent 455dc31e
Loading
Loading
Loading
Loading
+25 −3
Original line number Original line Diff line number Diff line
@@ -934,6 +934,11 @@ public class TelephonyManager {
    private static final String sLteOnCdmaProductType =
    private static final String sLteOnCdmaProductType =
        SystemProperties.get(TelephonyProperties.PROPERTY_LTE_ON_CDMA_PRODUCT_TYPE, "");
        SystemProperties.get(TelephonyProperties.PROPERTY_LTE_ON_CDMA_PRODUCT_TYPE, "");


    /** @hide */
     public static int getLteOnCdmaModeStatic() {
        return getLteOnCdmaModeStatic(getDefaultSim());
    }

    /**
    /**
     * Return if the current radio is LTE on CDMA. This
     * Return if the current radio is LTE on CDMA. This
     * is a tri-state return value as for a period of time
     * is a tri-state return value as for a period of time
@@ -944,12 +949,12 @@ public class TelephonyManager {
     *
     *
     * @hide
     * @hide
     */
     */
    public static int getLteOnCdmaModeStatic() {
    public static int getLteOnCdmaModeStatic(int slotId) {
        int retVal;
        int retVal;
        int curVal;
        int curVal;
        String productType = "";
        String productType = "";


        curVal = SystemProperties.getInt(TelephonyProperties.PROPERTY_LTE_ON_CDMA_DEVICE,
        curVal = getTelephonyProperty(TelephonyProperties.PROPERTY_LTE_ON_CDMA_DEVICE, slotId,
                    PhoneConstants.LTE_ON_CDMA_UNKNOWN);
                    PhoneConstants.LTE_ON_CDMA_UNKNOWN);
        retVal = curVal;
        retVal = curVal;
        if (retVal == PhoneConstants.LTE_ON_CDMA_UNKNOWN) {
        if (retVal == PhoneConstants.LTE_ON_CDMA_UNKNOWN) {
@@ -2629,7 +2634,7 @@ public class TelephonyManager {
    }
    }


    /** {@hide} */
    /** {@hide} */
    public int getDefaultSim() {
    public static int getDefaultSim() {
        //TODO Need to get it from Telephony Devcontroller
        //TODO Need to get it from Telephony Devcontroller
        return 0;
        return 0;
    }
    }
@@ -2780,6 +2785,23 @@ public class TelephonyManager {
        return propVal == null ? defaultVal : propVal;
        return propVal == null ? defaultVal : propVal;
    }
    }


    /**
     * Gets the telephony property.
     *
     * @hide
     */
    public static int getTelephonyProperty(String property, int slotId, int defaultVal) {
        String propVal = null;
        String prop = SystemProperties.get(property);
        if ((prop != null) && (prop.length() > 0)) {
            String values[] = prop.split(",");
            if ((slotId >= 0) && (slotId < values.length) && (values[slotId] != null)) {
                propVal = values[slotId];
            }
        }
        return propVal == null ? defaultVal : Integer.parseInt(propVal);
    }

    /** @hide */
    /** @hide */
    public int getSimCount() {
    public int getSimCount() {
        if(isMultiSimEnabled()) {
        if(isMultiSimEnabled()) {