FileDocCategorySizeDatePackage
PresenceUtils.javaAPI DocAndroid 1.5 API2965Wed May 06 22:42:46 BST 2009com.android.im.app

PresenceUtils

public final class PresenceUtils extends Object

Fields Summary
Constructors Summary
private PresenceUtils()

Methods Summary
public static intconvertStatus(int status)

        switch (status) {
        case Presence.AVAILABLE:
            return Im.Presence.AVAILABLE;

        case Presence.AWAY:
            return Im.Presence.AWAY;

        case Presence.DO_NOT_DISTURB:
            return Im.Presence.DO_NOT_DISTURB;

        case Presence.IDLE:
            return Im.Presence.IDLE;

        case Presence.OFFLINE:
            return Im.Presence.OFFLINE;

        default:
            Log.w(ImApp.LOG_TAG, "[ContactView] Unknown presence status " + status);
            return Im.Presence.AVAILABLE;
        }
    
public static intgetStatusIconId(int status)

        switch (status) {
        case Im.Presence.AVAILABLE:
            return BrandingResourceIDs.DRAWABLE_PRESENCE_ONLINE;

        case Im.Presence.IDLE:
            return BrandingResourceIDs.DRAWABLE_PRESENCE_AWAY;

        case Im.Presence.AWAY:
            return BrandingResourceIDs.DRAWABLE_PRESENCE_AWAY;

        case Im.Presence.DO_NOT_DISTURB:
            return BrandingResourceIDs.DRAWABLE_PRESENCE_BUSY;

        case Im.Presence.INVISIBLE:
            return BrandingResourceIDs.DRAWABLE_PRESENCE_INVISIBLE;

        default:
            return BrandingResourceIDs.DRAWABLE_PRESENCE_OFFLINE;
        }
    
public static intgetStatusStringRes(int status)

        switch (status) {
        case Im.Presence.AVAILABLE:
            return BrandingResourceIDs.STRING_PRESENCE_AVAILABLE;

        case Im.Presence.AWAY:
            return BrandingResourceIDs.STRING_PRESENCE_AWAY;

        case Im.Presence.DO_NOT_DISTURB:
            return BrandingResourceIDs.STRING_PRESENCE_BUSY;

        case Im.Presence.IDLE:
            return BrandingResourceIDs.STRING_PRESENCE_IDLE;

        case Im.Presence.INVISIBLE:
            return BrandingResourceIDs.STRING_PRESENCE_INVISIBLE;

        case Im.Presence.OFFLINE:
            return BrandingResourceIDs.STRING_PRESENCE_OFFLINE;

        default:
            return BrandingResourceIDs.STRING_PRESENCE_AVAILABLE;
        }