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

Commit 5d39ec4a authored by Jake Hamby's avatar Jake Hamby
Browse files

Add method to retrieve MSISDN for CDMA/LTE devices.

For CDMA/LTE devices, the MDN and MSISDN may be different.
Add a new method getMsisdn() to the Phone interface to return the
MSISDN. For GSM/UMTS, this will be the same as getLine1Number().
For CDMA/LTE, getLine1Number() will continue to return the MDN
and getMsisdn() will return the MSISDN.

Change-Id: Iba0ca24858992b21f63ae7ec0c27d2e90d4b0903
parent 5d42a7df
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -932,7 +932,8 @@ public interface Phone {
    boolean getCallForwardingIndicator();
    boolean getCallForwardingIndicator();


    /**
    /**
     * Get the line 1 phone number (MSISDN).<p>
     * Get the line 1 phone number (MSISDN). For CDMA phones, the MDN is returned
     * and {@link #getMsisdn()} will return the MSISDN on CDMA/LTE phones.<p>
     *
     *
     * @return phone number. May return null if not
     * @return phone number. May return null if not
     * available or the SIM is not ready
     * available or the SIM is not ready
@@ -1431,6 +1432,13 @@ public interface Phone {
     */
     */
    String getMeid();
    String getMeid();


    /**
     * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
     * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
     * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
     */
    String getMsisdn();

    /**
    /**
     * Retrieves IMEI for phones. Returns null if IMEI is not set.
     * Retrieves IMEI for phones. Returns null if IMEI is not set.
     */
     */
+5 −0
Original line number Original line Diff line number Diff line
@@ -1124,6 +1124,11 @@ public abstract class PhoneBase extends Handler implements Phone {
        Log.e(LOG_TAG, "requestIsimAuthentication() is only supported on LTE devices");
        Log.e(LOG_TAG, "requestIsimAuthentication() is only supported on LTE devices");
    }
    }


    public String getMsisdn() {
        logUnexpectedGsmMethodCall("getMsisdn");
        return null;
    }

    /**
    /**
     * Common error logger method for unexpected calls to CDMA-only methods.
     * Common error logger method for unexpected calls to CDMA-only methods.
     */
     */
+4 −0
Original line number Original line Diff line number Diff line
@@ -686,6 +686,10 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.getMeid();
        return mActivePhone.getMeid();
    }
    }


    public String getMsisdn() {
        return mActivePhone.getMsisdn();
    }

    public String getImei() {
    public String getImei() {
        return mActivePhone.getImei();
        return mActivePhone.getImei();
    }
    }
+5 −0
Original line number Original line Diff line number Diff line
@@ -140,6 +140,11 @@ public class CDMALTEPhone extends CDMAPhone {
        return mIccRecords.getIsimRecords();
        return mIccRecords.getIsimRecords();
    }
    }


    @Override
    public String getMsisdn() {
        return mIccRecords.getMsisdnNumber();
    }

    @Override
    @Override
    public void requestIsimAuthentication(String nonce, Message result) {
    public void requestIsimAuthentication(String nonce, Message result) {
        mCM.requestIsimAuthentication(nonce, result);
        mCM.requestIsimAuthentication(nonce, result);
+5 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ import android.os.AsyncResult;
import android.os.SystemProperties;
import android.os.SystemProperties;
import android.util.Log;
import android.util.Log;


import com.android.internal.telephony.AdnRecordLoader;
import com.android.internal.telephony.GsmAlphabet;
import com.android.internal.telephony.GsmAlphabet;
import com.android.internal.telephony.IccCardApplication.AppType;
import com.android.internal.telephony.IccCardApplication.AppType;
import com.android.internal.telephony.IccFileHandler;
import com.android.internal.telephony.IccFileHandler;
@@ -276,6 +277,10 @@ public final class CdmaLteUiccRecords extends SIMRecords {
                obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfPlLoaded()));
                obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfPlLoaded()));
        recordsToLoad++;
        recordsToLoad++;


        new AdnRecordLoader(phone).loadFromEF(EF_MSISDN, EF_EXT1, 1,
                obtainMessage(EVENT_GET_MSISDN_DONE));
        recordsToLoad++;

        iccFh.loadEFTransparent(EF_CSIM_LI,
        iccFh.loadEFTransparent(EF_CSIM_LI,
                obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfCsimLiLoaded()));
                obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfCsimLiLoaded()));
        recordsToLoad++;
        recordsToLoad++;
Loading