throw new IllegalArgumentException(\} } else {
// Fake up some data for the simulator results = new ArrayList(4); ArrayList
contact = new ArrayList
contact = new ArrayList
contact = new ArrayList
contact = new ArrayList
return new ArrayListCursor(ADDRESS_BOOK_COLUMN_NAMES, results);
} @Override
public String getType(Uri url) { switch (URL_MATCHER.match(url)) { case ADN: case FDN: case SDN:
return \default:
throw new IllegalArgumentException(\} } @Override
public Uri insert(Uri url, ContentValues initialValues) { Uri resultUri; int efType;
String pin2 = null; if (DBG) log(\
int match = URL_MATCHER.match(url); switch (match) { case ADN:
efType = IccConstants.EF_ADN; break;
case FDN:
efType = IccConstants.EF_FDN;
pin2 = initialValues.getAsString(\break; default:
throw new UnsupportedOperationException(\+ url); }
String tag = initialValues.getAsString(\String number = initialValues.getAsString(\
boolean success = addIccRecordToEf(efType, tag, number, pin2); if (!success) { return null; }
StringBuilder buf = new StringBuilder(\switch (match) { case ADN:
buf.append(\break; case FDN:
buf.append(\break; }
// TODO: we need to find out the rowId for the newly added record
buf.append(0);
resultUri = Uri.parse(buf.toString());
/** // notify interested parties that an insertion happened
* getContext().getContentResolver().notifyInsert( resultUri, rowID, * null); */
return resultUri; }
private String normalizeValue(String inVal) { int len = inVal.length(); String retVal = inVal;
if (inVal.charAt(0) == '\\'' && inVal.charAt(len - 1) == '\\'') { retVal = inVal.substring(1, len - 1); }
return retVal; } @Override
public int delete(Uri url, String where, String[] whereArgs) { int efType; if (DBG) log(\
int match = URL_MATCHER.match(url); switch (match) { case ADN:
efType = IccConstants.EF_ADN; break; case FDN:
efType = IccConstants.EF_FDN; break; default:
throw new UnsupportedOperationException(\+ url); }
// parse where clause String tag = null; String number = null; String pin2 = null;
String[] tokens = where.split(\int n = tokens.length; while (--n >= 0) { String param = tokens[n]; if (DBG)
log(\String[] pair = param.split(\if (pair.length != 2) {
Log.e(TAG, \continue; }