FileDocCategorySizeDatePackage
ContactListAdapter.javaAPI DocAndroid 1.5 API2717Wed May 06 22:42:46 BST 2009com.android.im.service

ContactListAdapter

public class ContactListAdapter extends IContactList.Stub

Fields Summary
private com.android.im.engine.ContactList
mAdaptee
private long
mDataBaseId
Constructors Summary
public ContactListAdapter(com.android.im.engine.ContactList adaptee, long dataBaseId)

        mAdaptee = adaptee;
        mDataBaseId = dataBaseId;
    
Methods Summary
public intaddContact(java.lang.String address)

        if (address == null) {
            Log.e(RemoteImService.TAG, "Address can't be null!");
            return ImErrorInfo.ILLEGAL_CONTACT_ADDRESS;
        }

        try {
            mAdaptee.addContact(address);
        } catch (IllegalArgumentException e) {
            return ImErrorInfo.ILLEGAL_CONTACT_ADDRESS;
        } catch (ImException e) {
            return e.getImError().getCode();
        }

        return ImErrorInfo.NO_ERROR;
    
public com.android.im.engine.AddressgetAddress()

        return mAdaptee.getAddress();
    
public longgetDataBaseId()

        return mDataBaseId;
    
public java.lang.StringgetName()

        return mAdaptee.getName();
    
public booleanisDefault()

        return mAdaptee.isDefault();
    
public intremoveContact(java.lang.String address)

        Contact contact = mAdaptee.getContact(address);
        if (contact == null) {
            return ImErrorInfo.ILLEGAL_CONTACT_ADDRESS;
        }

        try {
            mAdaptee.removeContact(contact);
        } catch (ImException e) {
            return e.getImError().getCode();
        }

        return ImErrorInfo.NO_ERROR;
    
public voidsetDefault(boolean isDefault)

        mAdaptee.setDefault(isDefault);
    
public voidsetName(java.lang.String name)

        if (name == null) {
            Log.e(RemoteImService.TAG, "Name can't be null!");
            return;
        }

        mAdaptee.setName(name);