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

Commit 5a84de6e authored by Wink Saville's avatar Wink Saville
Browse files

resolved conflicts for merge of 74af525e to master

Change-Id: I60a6d7ecd1809dd13b1ca791baff52d82d846f2d
parents 65f47d88 74af525e
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import com.android.internal.telephony.ITelephony;
import com.android.internal.telephony.ITelephonyRegistry;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.TelephonyProperties;

import java.util.List;
@@ -630,6 +629,28 @@ public class TelephonyManager {
        }
    }

    /**
     * Return if the current radio is LTE on CDMA. This
     * is a tri-state return value as for a period of time
     * the mode may be unknown.
     *
     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
     * or {@link Phone#LTE_ON_CDMA_TRUE}
     *
     * @hide
     */
    public int getLteOnCdmaMode() {
        try {
            return getITelephony().getLteOnCdmaMode();
        } catch (RemoteException ex) {
            // Assume no ICC card if remote exception which shouldn't happen
            return Phone.LTE_ON_CDMA_UNKNOWN;
        } catch (NullPointerException ex) {
            // This could happen before phone restarts due to crashing
            return Phone.LTE_ON_CDMA_UNKNOWN;
        }
    }

    //
    //
    // Subscriber Info
+24 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.os.RegistrantList;
import android.os.Registrant;
import android.os.Handler;
import android.os.AsyncResult;
import android.os.SystemProperties;
import android.util.Log;

/**
@@ -791,4 +792,27 @@ public abstract class BaseCommands implements CommandsInterface {

    protected void onRadioAvailable() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int getLteOnCdmaMode() {
        return getLteOnCdmaModeStatic();
    }

    /**
     * Return if the current radio is LTE on CDMA. This
     * is a tri-state return value as for a period of time
     * the mode may be unknown.
     *
     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
     * or {@link Phone#LTE_ON_CDMA_TRUE}
     */
    public static int getLteOnCdmaModeStatic() {
        int retVal = SystemProperties.getInt(TelephonyProperties.PROPERTY_NETWORK_LTE_ON_CDMA,
                Phone.LTE_ON_CDMA_FALSE);
        Log.d(LOG_TAG, "getLteOnCdmaMode=" + retVal);
        return retVal;
    }
}
+12 −4
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@ import android.os.SystemProperties;
 * {@hide}
 */
public interface CommandsInterface {
    static final boolean LTE_AVAILABLE_ON_CDMA =
        SystemProperties.getBoolean(TelephonyProperties.PROPERTY_NETWORK_LTE_ON_CDMA, false);
    enum RadioState {
        RADIO_OFF(0),         /* Radio explictly powered off (eg CFUN=0) */
        RADIO_UNAVAILABLE(0), /* Radio unavailable (eg, resetting or not booted) */
@@ -79,7 +77,7 @@ public interface CommandsInterface {
        }

        public boolean isGsm() {
            if (LTE_AVAILABLE_ON_CDMA) {
            if (BaseCommands.getLteOnCdmaModeStatic() == Phone.LTE_ON_CDMA_TRUE) {
                return false;
            } else {
                return this == SIM_NOT_READY
@@ -89,7 +87,7 @@ public interface CommandsInterface {
        }

        public boolean isCdma() {
            if (LTE_AVAILABLE_ON_CDMA) {
            if (BaseCommands.getLteOnCdmaModeStatic() == Phone.LTE_ON_CDMA_TRUE) {
                return true;
            } else {
                return this ==  RUIM_NOT_READY
@@ -1572,4 +1570,14 @@ public interface CommandsInterface {
     *          Callback message containing {@link IccCardStatus} structure for the card.
     */
    public void getIccCardStatus(Message result);

    /**
     * Return if the current radio is LTE on CDMA. This
     * is a tri-state return value as for a period of time
     * the mode may be unknown.
     *
     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
     * or {@link Phone#LTE_ON_CDMA_TRUE}
     */
    public int getLteOnCdmaMode();
}
+10 −0
Original line number Diff line number Diff line
@@ -259,5 +259,15 @@ interface ITelephony {
     * Return true if an ICC card is present
     */
    boolean hasIccCard();

    /**
     * Return if the current radio is LTE on CDMA. This
     * is a tri-state return value as for a period of time
     * the mode may be unknown.
     *
     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
     * or {@link PHone#LTE_ON_CDMA_TRUE}
     */
    int getLteOnCdmaMode();
}
+6 −8
Original line number Diff line number Diff line
@@ -88,9 +88,6 @@ public abstract class IccCard {
    private static final int EVENT_QUERY_FACILITY_FDN_DONE = 10;
    private static final int EVENT_CHANGE_FACILITY_FDN_DONE = 11;

    static final boolean LTE_AVAILABLE_ON_CDMA =
            SystemProperties.getBoolean(TelephonyProperties.PROPERTY_NETWORK_LTE_ON_CDMA, false);

    /*
      UNKNOWN is a transient state, for example, after uesr inputs ICC pin under
      PIN_REQUIRED state, the query for ICC status returns UNKNOWN before it
@@ -436,7 +433,8 @@ public abstract class IccCard {
        /*
         * TODO: We need to try to remove this, maybe if the RIL sends up a RIL_UNSOL_SIM_REFRESH?
         */
        if (oldState != State.READY && newState == State.READY && LTE_AVAILABLE_ON_CDMA) {
        if (oldState != State.READY && newState == State.READY &&
                mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE) {
            if (mPhone.mIccRecords instanceof SIMRecords) {
                ((SIMRecords)mPhone.mIccRecords).onSimReady();
            }
@@ -627,7 +625,8 @@ public abstract class IccCard {
            currentRadioState == RadioState.SIM_NOT_READY     ||
            currentRadioState == RadioState.RUIM_NOT_READY    ||
            currentRadioState == RadioState.NV_NOT_READY      ||
            (currentRadioState == RadioState.NV_READY && !LTE_AVAILABLE_ON_CDMA)) {
            (currentRadioState == RadioState.NV_READY &&
                    (mPhone.getLteOnCdmaMode() != Phone.LTE_ON_CDMA_TRUE))) {
            return IccCard.State.NOT_READY;
        }

@@ -635,9 +634,8 @@ public abstract class IccCard {
            currentRadioState == RadioState.SIM_READY             ||
            currentRadioState == RadioState.RUIM_LOCKED_OR_ABSENT ||
            currentRadioState == RadioState.RUIM_READY ||
            (currentRadioState == RadioState.NV_READY && LTE_AVAILABLE_ON_CDMA)) {


            (currentRadioState == RadioState.NV_READY &&
                    (mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE))) {
            int index;

            // check for CDMA radio technology
Loading