public abstract class IccRecords extends Handler implements IccConstants
Modifier and Type | Class and Description |
---|---|
static interface |
IccRecords.IccRecordLoaded
Generic ICC record loaded callback.
|
Handler.Callback
CDMA_SMS_RECORD_LENGTH, DF_ADF, DF_CDMA, DF_GRAPHICS, DF_GSM, DF_PHONEBOOK, DF_TELECOM, EF_AD, EF_ADN, EF_CFF_CPHS, EF_CFIS, EF_CSIM_CDMAHOME, EF_CSIM_EPRL, EF_CSIM_IMSIM, EF_CSIM_LI, EF_CSIM_MDN, EF_CSIM_MIPUPP, EF_CSIM_SPN, EF_CSP_CPHS, EF_CST, EF_DOMAIN, EF_EXT1, EF_EXT2, EF_EXT3, EF_EXT5, EF_EXT6, EF_FDN, EF_GID1, EF_GID2, EF_ICCID, EF_IMG, EF_IMPI, EF_IMPU, EF_INFO_CPHS, EF_IST, EF_LI, EF_MAILBOX_CPHS, EF_MBDN, EF_MBI, EF_MSISDN, EF_MWIS, EF_OPL, EF_PBR, EF_PCSCF, EF_PL, EF_PNN, EF_PSI, EF_RUIM_SPN, EF_SDN, EF_SMS, EF_SPDI, EF_SPN, EF_SPN_CPHS, EF_SPN_SHORT_CPHS, EF_SST, EF_VOICE_MAIL_INDICATOR_CPHS, MF_SIM, SMS_RECORD_LENGTH
Constructor and Description |
---|
IccRecords(UiccCardApplication app,
Context c,
CommandsInterface ci) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Call when the IccRecords object is no longer going to be used.
|
void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args) |
protected static String |
findBestLanguage(byte[] languages,
String[] locales) |
AdnRecordCache |
getAdnCache() |
abstract int |
getDisplayRule(String plmn)
Returns the SpnDisplayRule based on settings on the SIM and the
specified plmn (currently-registered PLMN).
|
String |
getFullIccId()
Returns the full ICC ID including hex digits.
|
String |
getGid1()
Get the Group Identifier Level 1 (GID1) on a SIM for GSM.
|
String |
getGid2()
Get the Group Identifier Level 2 (GID2) on a SIM.
|
String |
getIccId()
Returns the ICC ID stripped at the first hex character.
|
String |
getIccSimChallengeResponse(int authContext,
String data)
Returns the response of the SIM application on the UICC to authentication
challenge/response algorithm.
|
String |
getIMSI()
Get the International Mobile Subscriber ID (IMSI) on a SIM
for GSM, UMTS and like networks.
|
IsimRecords |
getIsimRecords()
Return an interface to retrieve the ISIM records for IMS, if available.
|
String |
getMsisdnAlphaTag() |
String |
getMsisdnNumber() |
String |
getNAI()
Get the Network Access ID (NAI) on a CSIM for CDMA like networks.
|
String |
getOperatorNumeric()
Returns the 5 or 6 digit MCC/MNC of the operator that
provided the SIM card.
|
boolean |
getRecordsLoaded() |
String |
getServiceProviderName()
Return Service Provider Name stored in SIM (EF_SPN=0x6F46) or in RUIM (EF_RUIM_SPN=0x6F41).
|
String |
getSimLanguage()
Returns the SIM language derived from the EF-LI and EF-PL sim records.
|
UsimServiceTable |
getUsimServiceTable() |
int |
getVoiceCallForwardingFlag()
Get the current Voice call forwarding flag for GSM/UMTS and the like SIMs
|
String |
getVoiceMailAlphaTag() |
String |
getVoiceMailNumber() |
abstract int |
getVoiceMessageCount()
Called by GsmCdmaPhone to update VoiceMail count
|
void |
handleMessage(Message msg)
Subclasses must implement this to receive messages.
|
boolean |
isCspPlmnEnabled()
Return true if "Restriction of menu options for manual PLMN selection"
bit is set or EF_CSP data is unavailable, return false otherwise.
|
boolean |
isProvisioned()
Indicates wether SIM is in provisioned state or not.
|
protected abstract void |
log(String s)
Write string to log file
|
protected abstract void |
loge(String s)
Write error string to log file.
|
protected abstract void |
onAllRecordsLoaded() |
protected void |
onIccRefreshInit()
Called by subclasses (SimRecords and RuimRecords) whenever
IccRefreshResponse.REFRESH_RESULT_INIT event received
|
abstract void |
onReady() |
protected abstract void |
onRecordLoaded() |
abstract void |
onRefresh(boolean fileChanged,
int[] fileList)
Called by STK Service when REFRESH is received.
|
void |
registerForImsiReady(Handler h,
int what,
Object obj) |
void |
registerForNetworkSelectionModeAutomatic(Handler h,
int what,
Object obj) |
void |
registerForNewSms(Handler h,
int what,
Object obj) |
void |
registerForRecordsEvents(Handler h,
int what,
Object obj) |
void |
registerForRecordsLoaded(Handler h,
int what,
Object obj) |
void |
setImsi(String imsi)
Imsi could be set by ServiceStateTrackers in case of cdma
|
void |
setMsisdnNumber(String alphaTag,
String number,
Message onComplete)
Set subscriber number to SIM record
The subscriber number is stored in EF_MSISDN (TS 51.011)
When the operation is complete, onComplete will be sent to its handler
|
protected void |
setServiceProviderName(String spn) |
protected void |
setSimLanguage(byte[] efLi,
byte[] efPl) |
protected void |
setSystemProperty(String key,
String val) |
void |
setVoiceCallForwardingFlag(int line,
boolean enable,
String number)
Set the voice call forwarding flag for GSM/UMTS and the like SIMs
|
abstract void |
setVoiceMailNumber(String alphaTag,
String voiceNumber,
Message onComplete)
Set voice mail number to SIM record
The voice mail number can be stored either in EF_MBDN (TS 51.011) or
EF_MAILBOX_CPHS (CPHS 4.2)
If EF_MBDN is available, store the voice mail number to EF_MBDN
If EF_MAILBOX_CPHS is enabled, store the voice mail number to EF_CHPS
So the voice mail number will be stored in both EFs if both are available
Return error only if both EF_MBDN and EF_MAILBOX_CPHS fail.
|
abstract void |
setVoiceMessageWaiting(int line,
int countWaiting)
Sets the SIM voice message waiting indicator records
|
String |
toString()
Returns a string representation of the object.
|
void |
unregisterForImsiReady(Handler h) |
void |
unregisterForNetworkSelectionModeAutomatic(Handler h) |
void |
unregisterForNewSms(Handler h) |
void |
unregisterForRecordsEvents(Handler h) |
void |
unregisterForRecordsLoaded(Handler h) |
dispatchMessage, dump, getLooper, getMessageName, getTraceName, hasCallbacks, hasMessages, hasMessages, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, post, postAtFrontOfQueue, postAtTime, postAtTime, postDelayed, removeCallbacks, removeCallbacks, removeCallbacksAndMessages, removeMessages, removeMessages, runWithScissors, sendEmptyMessage, sendEmptyMessageAtTime, sendEmptyMessageDelayed, sendMessage, sendMessageAtFrontOfQueue, sendMessageAtTime, sendMessageDelayed
protected static final boolean DBG
protected static final boolean VDBG
protected AtomicBoolean mDestroyed
protected Context mContext
protected CommandsInterface mCi
protected IccFileHandler mFh
protected UiccCardApplication mParentApp
protected TelephonyManager mTelephonyManager
protected RegistrantList mRecordsLoadedRegistrants
protected RegistrantList mImsiReadyRegistrants
protected RegistrantList mRecordsEventsRegistrants
protected RegistrantList mNewSmsRegistrants
protected RegistrantList mNetworkSelectionModeAutomaticRegistrants
protected int mRecordsToLoad
protected AdnRecordCache mAdnCache
protected boolean mRecordsRequested
protected String mIccId
protected String mFullIccId
protected String mMsisdn
protected String mMsisdnTag
protected String mNewMsisdn
protected String mNewMsisdnTag
protected String mVoiceMailNum
protected String mVoiceMailTag
protected String mNewVoiceMailNum
protected String mNewVoiceMailTag
protected boolean mIsVoiceMailFixed
protected String mImsi
protected int mMncLength
protected int mMailboxIndex
protected String mGid1
protected String mGid2
protected String mPrefLang
protected static final int UNINITIALIZED
protected static final int UNKNOWN
public static final int SPN_RULE_SHOW_SPN
public static final int SPN_RULE_SHOW_PLMN
protected static final int EVENT_SET_MSISDN_DONE
public static final int EVENT_MWI
public static final int EVENT_CFI
public static final int EVENT_SPN
public static final int EVENT_GET_ICC_RECORD_DONE
protected static final int EVENT_APP_READY
public static final int CALL_FORWARDING_STATUS_DISABLED
public static final int CALL_FORWARDING_STATUS_ENABLED
public static final int CALL_FORWARDING_STATUS_UNKNOWN
public IccRecords(UiccCardApplication app, Context c, CommandsInterface ci)
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public void dispose()
public abstract void onReady()
public AdnRecordCache getAdnCache()
public String getIccId()
getFullIccId()
should be used to get the full ID including
hex digits.public String getFullIccId()
public void unregisterForRecordsLoaded(Handler h)
public void unregisterForImsiReady(Handler h)
public void unregisterForRecordsEvents(Handler h)
public void unregisterForNewSms(Handler h)
public void registerForNetworkSelectionModeAutomatic(Handler h, int what, Object obj)
public void unregisterForNetworkSelectionModeAutomatic(Handler h)
public String getIMSI()
public void setImsi(String imsi)
imsi
- public String getNAI()
public String getMsisdnNumber()
public String getGid1()
public String getGid2()
public void setMsisdnNumber(String alphaTag, String number, Message onComplete)
alphaTag
- alpha-tagging of the dailing nubmer (up to 10 characters)number
- dailing nubmer (up to 20 digits)
if the number starts with '+', then set to international TOAonComplete
- onComplete.obj will be an AsyncResult
((AsyncResult)onComplete.obj).exception == null on success
((AsyncResult)onComplete.obj).exception != null on failpublic String getMsisdnAlphaTag()
public String getVoiceMailNumber()
public String getServiceProviderName()
protected void setServiceProviderName(String spn)
public abstract void setVoiceMailNumber(String alphaTag, String voiceNumber, Message onComplete)
alphaTag
- alpha-tagging of the dailing nubmer (upto 10 characters)voiceNumber
- dailing nubmer (upto 20 digits)
if the number is start with '+', then set to international TOAonComplete
- onComplete.obj will be an AsyncResult
((AsyncResult)onComplete.obj).exception == null on success
((AsyncResult)onComplete.obj).exception != null on failpublic String getVoiceMailAlphaTag()
public abstract void setVoiceMessageWaiting(int line, int countWaiting)
line
- GSM Subscriber Profile Number, one-based. Only '1' is supportedcountWaiting
- The number of messages waiting, if known. Use
-1 to indicate that an unknown number of
messages are waitingpublic abstract int getVoiceMessageCount()
public abstract void onRefresh(boolean fileChanged, int[] fileList)
fileChanged
- indicates whether any files changedfileList
- if non-null, a list of EF files that changedprotected void onIccRefreshInit()
public boolean getRecordsLoaded()
public void handleMessage(Message msg)
Handler
handleMessage
in class Handler
public String getSimLanguage()
protected void setSimLanguage(byte[] efLi, byte[] efPl)
protected static String findBestLanguage(byte[] languages, String[] locales) throws UnsupportedEncodingException
UnsupportedEncodingException
protected abstract void onRecordLoaded()
protected abstract void onAllRecordsLoaded()
public abstract int getDisplayRule(String plmn)
public boolean isCspPlmnEnabled()
public String getOperatorNumeric()
public int getVoiceCallForwardingFlag()
public void setVoiceCallForwardingFlag(int line, boolean enable, String number)
line
- to enable/disableenable
- number
- to which CFU is enabledpublic boolean isProvisioned()
protected abstract void log(String s)
s
- is the string to writeprotected abstract void loge(String s)
s
- is the string to writepublic IsimRecords getIsimRecords()
public UsimServiceTable getUsimServiceTable()
public String getIccSimChallengeResponse(int authContext, String data)
authContext
- parameter P2 that specifies the authentication context per 3GPP TS 31.102 (Section 7.1.2)data
- authentication challenge datapublic void dump(FileDescriptor fd, PrintWriter pw, String[] args)