Skip to content

Commit 5d39ec4

Browse files
author
Jake Hamby
committed
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
1 parent 5d42a7d commit 5d39ec4

File tree

7 files changed

+34
-2
lines changed

7 files changed

+34
-2
lines changed

telephony/java/com/android/internal/telephony/Phone.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,8 @@ enum SuppService {
932932
boolean getCallForwardingIndicator();
933933

934934
/**
935-
* Get the line 1 phone number (MSISDN).<p>
935+
* Get the line 1 phone number (MSISDN). For CDMA phones, the MDN is returned
936+
* and {@link #getMsisdn()} will return the MSISDN on CDMA/LTE phones.<p>
936937
*
937938
* @return phone number. May return null if not
938939
* available or the SIM is not ready
@@ -1431,6 +1432,13 @@ void selectNetworkManually(OperatorInfo network,
14311432
*/
14321433
String getMeid();
14331434

1435+
/**
1436+
* Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
1437+
* {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
1438+
* the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
1439+
*/
1440+
String getMsisdn();
1441+
14341442
/**
14351443
* Retrieves IMEI for phones. Returns null if IMEI is not set.
14361444
*/

telephony/java/com/android/internal/telephony/PhoneBase.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,11 @@ public void requestIsimAuthentication(String nonce, Message result) {
11241124
Log.e(LOG_TAG, "requestIsimAuthentication() is only supported on LTE devices");
11251125
}
11261126

1127+
public String getMsisdn() {
1128+
logUnexpectedGsmMethodCall("getMsisdn");
1129+
return null;
1130+
}
1131+
11271132
/**
11281133
* Common error logger method for unexpected calls to CDMA-only methods.
11291134
*/

telephony/java/com/android/internal/telephony/PhoneProxy.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,10 @@ public String getMeid() {
686686
return mActivePhone.getMeid();
687687
}
688688

689+
public String getMsisdn() {
690+
return mActivePhone.getMsisdn();
691+
}
692+
689693
public String getImei() {
690694
return mActivePhone.getImei();
691695
}

telephony/java/com/android/internal/telephony/cdma/CDMALTEPhone.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ public IsimRecords getIsimRecords() {
140140
return mIccRecords.getIsimRecords();
141141
}
142142

143+
@Override
144+
public String getMsisdn() {
145+
return mIccRecords.getMsisdnNumber();
146+
}
147+
143148
@Override
144149
public void requestIsimAuthentication(String nonce, Message result) {
145150
mCM.requestIsimAuthentication(nonce, result);

telephony/java/com/android/internal/telephony/cdma/CdmaLteUiccRecords.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import android.os.SystemProperties;
2020
import android.util.Log;
2121

22+
import com.android.internal.telephony.AdnRecordLoader;
2223
import com.android.internal.telephony.GsmAlphabet;
2324
import com.android.internal.telephony.IccCardApplication.AppType;
2425
import com.android.internal.telephony.IccFileHandler;
@@ -276,6 +277,10 @@ protected void fetchSimRecords() {
276277
obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfPlLoaded()));
277278
recordsToLoad++;
278279

280+
new AdnRecordLoader(phone).loadFromEF(EF_MSISDN, EF_EXT1, 1,
281+
obtainMessage(EVENT_GET_MSISDN_DONE));
282+
recordsToLoad++;
283+
279284
iccFh.loadEFTransparent(EF_CSIM_LI,
280285
obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfCsimLiLoaded()));
281286
recordsToLoad++;

telephony/java/com/android/internal/telephony/gsm/GSMPhone.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,11 @@ public String getLine1Number() {
877877
return mIccRecords.getMsisdnNumber();
878878
}
879879

880+
@Override
881+
public String getMsisdn() {
882+
return mIccRecords.getMsisdnNumber();
883+
}
884+
880885
public String getLine1AlphaTag() {
881886
return mIccRecords.getMsisdnAlphaTag();
882887
}

telephony/java/com/android/internal/telephony/gsm/SIMRecords.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public class SIMRecords extends IccRecords {
127127
private static final int EVENT_GET_MWIS_DONE = 7;
128128
private static final int EVENT_GET_VOICE_MAIL_INDICATOR_CPHS_DONE = 8;
129129
protected static final int EVENT_GET_AD_DONE = 9; // Admin data on SIM
130-
private static final int EVENT_GET_MSISDN_DONE = 10;
130+
protected static final int EVENT_GET_MSISDN_DONE = 10;
131131
private static final int EVENT_GET_CPHS_MAILBOX_DONE = 11;
132132
private static final int EVENT_GET_SPN_DONE = 12;
133133
private static final int EVENT_GET_SPDI_DONE = 13;

0 commit comments

Comments
 (0)