FileDocCategorySizeDatePackage
PhoneSubInfo.javaAPI DocAndroid 5.1 API11823Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony

PhoneSubInfo

public class PhoneSubInfo extends Object

Fields Summary
static final String
LOG_TAG
private static final boolean
DBG
private static final boolean
VDBG
private Phone
mPhone
private android.content.Context
mContext
private static final String
READ_PHONE_STATE
private static final String
CALL_PRIVILEGED
private static final String
READ_PRIVILEGED_PHONE_STATE
Constructors Summary
public PhoneSubInfo(Phone phone)


       
        mPhone = phone;
        mContext = phone.getContext();
    
Methods Summary
public voiddispose()

    
protected voiddump(java.io.FileDescriptor fd, java.io.PrintWriter pw, java.lang.String[] args)

        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
                != PackageManager.PERMISSION_GRANTED) {
            pw.println("Permission Denial: can't dump PhoneSubInfo from from pid="
                    + Binder.getCallingPid()
                    + ", uid=" + Binder.getCallingUid());
            return;
        }

        pw.println("Phone Subscriber Info:");
        pw.println("  Phone Type = " + mPhone.getPhoneName());
        pw.println("  Device ID = " + mPhone.getDeviceId());
    
protected voidfinalize()

        try {
            super.finalize();
        } catch (Throwable throwable) {
            loge("Error while finalizing:", throwable);
        }
        if (DBG) log("PhoneSubInfo finalized");
    
public java.lang.StringgetCompleteVoiceMailNumber()
Retrieves the complete voice mail number.

hide

        mContext.enforceCallingOrSelfPermission(CALL_PRIVILEGED,
                "Requires CALL_PRIVILEGED");
        String number = mPhone.getVoiceMailNumber();
        if (VDBG) log("VM: PhoneSubInfo.getCompleteVoiceMailNUmber: " + number);
        return number;
    
public java.lang.StringgetDeviceId()
Retrieves the unique device ID, e.g., IMEI for GSM phones and MEID for CDMA phones.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getDeviceId();
    
public java.lang.StringgetDeviceSvn()
Retrieves the software version number for the device, e.g., IMEI/SV for GSM phones.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getDeviceSvn();
    
public java.lang.StringgetGroupIdLevel1()
Retrieves the Group Identifier Level1 for GSM phones.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getGroupIdLevel1();
    
public java.lang.StringgetIccSerialNumber()
Retrieves the serial number of the ICC, if applicable.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getIccSerialNumber();
    
public java.lang.StringgetIccSimChallengeResponse(int subId, int appType, java.lang.String data)
Returns the response of the SIM application on the UICC to authentication challenge/response algorithm. The data string and challenge response are Base64 encoded Strings. Can support EAP-SIM, EAP-AKA with results encoded per 3GPP TS 31.102.

param
appType ICC application family (@see com.android.internal.telephony.PhoneConstants#APPTYPE_xxx)
param
data authentication challenge data
return
challenge response

        // FIXME: use subId!!
        mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE,
                "Requires READ_PRIVILEGED_PHONE_STATE");

        UiccCard uiccCard = mPhone.getUiccCard();
        if (uiccCard == null) {
            Rlog.e(LOG_TAG, "getIccSimChallengeResponse() UiccCard is null");
            return null;
        }

        UiccCardApplication uiccApp = uiccCard.getApplicationByType(appType);
        if (uiccApp == null) {
            Rlog.e(LOG_TAG, "getIccSimChallengeResponse() no app with specified type -- " +
                    appType);
            return null;
        } else {
            Rlog.e(LOG_TAG, "getIccSimChallengeResponse() found app " + uiccApp.getAid()
                    + "specified type -- " + appType);
        }

        int authContext = uiccApp.getAuthContext();

        if (data.length() < 32) {
            /* must use EAP_SIM context */
            Rlog.e(LOG_TAG, "data is too small to use EAP_AKA, using EAP_SIM instead");
            authContext = UiccCardApplication.AUTH_CONTEXT_EAP_SIM;
        }

        if(authContext == UiccCardApplication.AUTH_CONTEXT_UNDEFINED) {
            Rlog.e(LOG_TAG, "getIccSimChallengeResponse() authContext undefined for app type " +
                    appType);
            return null;
        }

        return uiccApp.getIccRecords().getIccSimChallengeResponse(authContext, data);
    
public java.lang.StringgetImei()
Retrieves the IMEI.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getImei();
    
public java.lang.StringgetIsimChallengeResponse(java.lang.String nonce)
Returns the response of ISIM Authetification through RIL. Returns null if the Authentification hasn't been successed or isn't present iphonesubinfo.

return
the response of ISIM Authetification, or null if not available

        mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE,
                "Requires READ_PRIVILEGED_PHONE_STATE");
        IsimRecords isim = mPhone.getIsimRecords();
        if (isim != null) {
            return isim.getIsimChallengeResponse(nonce);
        } else {
            return null;
        }
    
public java.lang.StringgetIsimDomain()
Returns the IMS home network domain name that was loaded from the ISIM.

return
the IMS domain name, or null if not present or not loaded

        mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE,
                "Requires READ_PRIVILEGED_PHONE_STATE");
        IsimRecords isim = mPhone.getIsimRecords();
        if (isim != null) {
            return isim.getIsimDomain();
        } else {
            return null;
        }
    
public java.lang.StringgetIsimImpi()
Returns the IMS private user identity (IMPI) that was loaded from the ISIM.

return
the IMPI, or null if not present or not loaded

        mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE,
                "Requires READ_PRIVILEGED_PHONE_STATE");
        IsimRecords isim = mPhone.getIsimRecords();
        if (isim != null) {
            return isim.getIsimImpi();
        } else {
            return null;
        }
    
public java.lang.String[]getIsimImpu()
Returns the IMS public user identities (IMPU) that were loaded from the ISIM.

return
an array of IMPU strings, with one IMPU per string, or null if not present or not loaded

        mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE,
                "Requires READ_PRIVILEGED_PHONE_STATE");
        IsimRecords isim = mPhone.getIsimRecords();
        if (isim != null) {
            return isim.getIsimImpu();
        } else {
            return null;
        }
    
public java.lang.StringgetIsimIst()
Returns the IMS Service Table (IST) that was loaded from the ISIM.

return
IMS Service Table or null if not present or not loaded

        mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE,
                "Requires READ_PRIVILEGED_PHONE_STATE");
        IsimRecords isim = mPhone.getIsimRecords();
        if (isim != null) {
            return isim.getIsimIst();
        } else {
            return null;
        }
     
public java.lang.String[]getIsimPcscf()
Returns the IMS Proxy Call Session Control Function(PCSCF) that were loaded from the ISIM.

return
an array of PCSCF strings with one PCSCF per string, or null if not present or not loaded

        mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE,
                "Requires READ_PRIVILEGED_PHONE_STATE");
        IsimRecords isim = mPhone.getIsimRecords();
        if (isim != null) {
            return isim.getIsimPcscf();
        } else {
            return null;
        }
    
public java.lang.StringgetLine1AlphaTag()
Retrieves the alpha identifier for line 1.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getLine1AlphaTag();
    
public java.lang.StringgetLine1Number()
Retrieves the phone number string for line 1.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getLine1Number();
    
public java.lang.StringgetMsisdn()
Retrieves the MSISDN string.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getMsisdn();
    
public java.lang.StringgetNai()
Retrieves the NAI.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getNai();
    
public java.lang.StringgetSubscriberId()
Retrieves the unique subscriber ID, e.g., IMSI for GSM phones.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getSubscriberId();
    
public java.lang.StringgetVoiceMailAlphaTag()
Retrieves the alpha identifier associated with the voice mail number.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        return mPhone.getVoiceMailAlphaTag();
    
public java.lang.StringgetVoiceMailNumber()
Retrieves the voice mail number.

        mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
        String number = PhoneNumberUtils.extractNetworkPortion(mPhone.getVoiceMailNumber());
        if (VDBG) log("VM: PhoneSubInfo.getVoiceMailNUmber: " + number);
        return number;
    
private voidlog(java.lang.String s)

        Rlog.d(LOG_TAG, s);
    
private voidloge(java.lang.String s, java.lang.Throwable e)

        Rlog.e(LOG_TAG, s, e);