FileDocCategorySizeDatePackage
AddressUtils.javaAPI DocAndroid 1.5 API2622Wed May 06 22:42:46 BST 2009com.android.mms.util

AddressUtils

public class AddressUtils extends Object

Fields Summary
private static final String
TAG
Constructors Summary
private AddressUtils()


      
        // Forbidden being instantiated.
    
Methods Summary
public static booleancontainsEmailAddress(java.lang.String[] addresses)

        for (String address : addresses) {
            if (Mms.isEmailAddress(address)) {
                return true;
            }
        }
        return false;
    
public static java.lang.StringgetFrom(android.content.Context context, android.net.Uri uri)

        String msgId = uri.getLastPathSegment();
        Uri.Builder builder = Mms.CONTENT_URI.buildUpon();

        builder.appendPath(msgId).appendPath("addr");

        Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(),
                            builder.build(), new String[] {Addr.ADDRESS, Addr.CHARSET},
                            Addr.TYPE + "=" + PduHeaders.FROM, null, null);

        if (cursor != null) {
            try {
                if (cursor.moveToFirst()) {
                    String from = cursor.getString(0);

                    if (!TextUtils.isEmpty(from)) {
                        byte[] bytes = PduPersister.getBytes(from);
                        int charset = cursor.getInt(1);
                        return new EncodedStringValue(charset, bytes)
                                .getString();
                    }
                }
            } finally {
                cursor.close();
            }
        }
        return context.getString(R.string.hidden_sender_address);