public class IccPhoneBookInterfaceManager extends Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
ALLOW_SIM_OP_IN_UI_THREAD |
protected static boolean |
DBG |
protected static int |
EVENT_GET_SIZE_DONE |
protected static int |
EVENT_LOAD_DONE |
protected static int |
EVENT_UPDATE_DONE |
protected AdnRecordCache |
mAdnCache |
protected Handler |
mBaseHandler |
protected Object |
mLock |
protected Phone |
mPhone |
protected List<AdnRecord> |
mRecords |
protected int[] |
mRecordSize |
protected boolean |
mSuccess |
Constructor and Description |
---|
IccPhoneBookInterfaceManager(Phone phone) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkThread() |
void |
dispose() |
List<AdnRecord> |
getAdnRecordsInEf(int efid)
Loads the AdnRecords in efid and returns them as a
List of AdnRecords
throws SecurityException if no READ_CONTACTS permission
|
int[] |
getAdnRecordsSize(int efid)
Get the capacity of records in efid
|
protected void |
logd(String msg) |
protected void |
loge(String msg) |
boolean |
updateAdnRecordsInEfByIndex(int efid,
String newTag,
String newPhoneNumber,
int index,
String pin2)
Update an ADN-like EF record by record index
This is useful for iteration the whole ADN file, such as write the whole
phone book or erase/format the whole phonebook.
|
boolean |
updateAdnRecordsInEfBySearch(int efid,
String oldTag,
String oldPhoneNumber,
String newTag,
String newPhoneNumber,
String pin2)
Replace oldAdn with newAdn in ADN-like record in EF
getAdnRecordsInEf must be called at least once before this function,
otherwise an error will be returned.
|
void |
updateIccRecords(IccRecords iccRecords) |
protected void |
waitForResult(AtomicBoolean status) |
protected static final boolean DBG
protected Phone mPhone
protected AdnRecordCache mAdnCache
protected final Object mLock
protected int[] mRecordSize
protected boolean mSuccess
protected static final boolean ALLOW_SIM_OP_IN_UI_THREAD
protected static final int EVENT_GET_SIZE_DONE
protected static final int EVENT_LOAD_DONE
protected static final int EVENT_UPDATE_DONE
protected Handler mBaseHandler
public IccPhoneBookInterfaceManager(Phone phone)
public void dispose()
public void updateIccRecords(IccRecords iccRecords)
protected void logd(String msg)
protected void loge(String msg)
public boolean updateAdnRecordsInEfBySearch(int efid, String oldTag, String oldPhoneNumber, String newTag, String newPhoneNumber, String pin2)
efid
- must be one among EF_ADN, EF_FDN, and EF_SDNoldTag
- adn tag to be replacedoldPhoneNumber
- adn number to be replaced
Set both oldTag and oldPhoneNubmer to "" means to replace an
empty record, aka, insert new recordnewTag
- adn tag to be storednewPhoneNumber
- adn number ot be stored
Set both newTag and newPhoneNubmer to "" means to replace the old
record with empty one, aka, delete old recordpin2
- required to update EF_FDN, otherwise must be nullpublic boolean updateAdnRecordsInEfByIndex(int efid, String newTag, String newPhoneNumber, int index, String pin2)
efid
- must be one among EF_ADN, EF_FDN, and EF_SDNnewTag
- adn tag to be storednewPhoneNumber
- adn number to be stored
Set both newTag and newPhoneNubmer to "" means to replace the old
record with empty one, aka, delete old recordindex
- is 1-based adn record index to be updatedpin2
- required to update EF_FDN, otherwise must be nullpublic int[] getAdnRecordsSize(int efid)
efid
- the EF id of a ADN-like ICCpublic List<AdnRecord> getAdnRecordsInEf(int efid)
efid
- the EF id of a ADN-like ICCprotected void checkThread()
protected void waitForResult(AtomicBoolean status)